From aace23ead78fa22edb2533565acfa379e451c5eb Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 25 Oct 2024 17:06:42 +0100 Subject: Hello, world! --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7ba8b50 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +CC=gcc +RELEASE=0 + +GFLAGS=-Wall -Wextra -Wswitch-enum -std=c11 +DFLAGS=-fsanitize=address -fsanitize=undefined -ggdb +RFLAGS=-O3 + +ifeq ($(RELEASE), 0) +CFLAGS=$(GFLAGS) $(DFLAGS) +else +CFLAGS=$(GFLAGS) $(RFLAGS) +endif + +DIST=build +OUT=avm.out + +all: $(DIST)/$(OUT) + +$(DIST)/$(OUT): main.c | $(DIST) + $(CC) $(CFLAGS) $^ -o $@ + +.PHONY: run +run: $(DIST)/$(OUT) + ./$^ + +$(DIST): + mkdir $(DIST) -- cgit v1.2.3-13-gbd6f