summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 82c9da1188f5b6dd7407a73ac444692a52bc29d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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)

debug: $(SRC)
	$(CC) $(DBG_FLAGS) -D_FOOD_DEBUG -fsanitize=address $(CFLAGS) -o $(TARGET) $^ $(LIBS)

noasan: $(SRC)
	$(CC) $(DBG_FLAGS) $(CFLAGS) -o $(TARGET) $^ $(LIBS)

tests:
	$(MAKE) -C test

clean-tests:
	$(MAKE) clean -C test

.PHONY: clean

clean:
	rm -f *.o
	rm -f $(TARGET)

install: $(TARGET)
	@cp -v $(TARGET) /usr/local/bin/$(TARGET)

uninstall:
	@rm -v /usr/local/bin/$(TARGET)