From 382da0ada99a2874052f0e6ccb2c25e012d47fc9 Mon Sep 17 00:00:00 2001 From: gramanas Date: Sat, 13 Nov 2021 21:05:38 +0200 Subject: Update Makefile and add list ingredients draft --- Makefile | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 82c9da1..3b011df 100644 --- a/Makefile +++ b/Makefile @@ -1,33 +1,35 @@ -TARGET=food -SRC=*.c CC=gcc -CFLAGS=-D_GNU_SOURCE -std=c99 -pedantic -REL_FLAGS=-O3 -DBG_FLAGS=-Wall -g3 -make: $(SRC) - $(CC) $(REL_FLAGS) $(CFLAGS) -o $(TARGET) $^ $(LIBS) +CFLAGS=-D_GNU_SOURCE -std=c99 -pedantic -O3 +DBG_FLAGS=-Wall -g3 -D_FOOD_DEBUG -fsanitize=address -Og -debug: $(SRC) - $(CC) $(DBG_FLAGS) -D_FOOD_DEBUG -fsanitize=address $(CFLAGS) -o $(TARGET) $^ $(LIBS) +SRC=src/*.c -noasan: $(SRC) - $(CC) $(DBG_FLAGS) $(CFLAGS) -o $(TARGET) $^ $(LIBS) +.PHONY: all debug clean -tests: - $(MAKE) -C test +all: food #eval -clean-tests: - $(MAKE) clean -C test +food: $(SRC) food.c + $(CC) $(CFLAGS) -o food $^ $(LIBS) -.PHONY: clean +eval: $(SRC) eval.c + $(CC) $(CFLAGS) -o eval $^ $(LIBS) + +debug: CFLAGS += $(DBG_FLAGS) +debug: all clean: rm -f *.o - rm -f $(TARGET) + rm -f food eval + +# tests: +# $(MAKE) -C test + +# clean-tests: +# $(MAKE) clean -C test -install: $(TARGET) - @cp -v $(TARGET) /usr/local/bin/$(TARGET) +# install: $(TARGET) +# @cp -v $(TARGET) /usr/local/bin/$(TARGET) -uninstall: - @rm -v /usr/local/bin/$(TARGET) +# uninstall: +# @rm -v /usr/local/bin/$(TARGET) -- cgit v1.2.3