summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile44
1 files changed, 23 insertions, 21 deletions
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)