aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile
blob: fa64d3a5e117779b0c9c336a1c5d57c430858420 (plain)
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
CC=gcc-6
OUTPUT_OPTION=-MMD -MP -o $@

CFLAGS += -Wall -Ofast --std=c99 -Wvla -I../include
MODULES := options file
CFLAGS += $(patsubst %,-I%,$(MODULES))

LIBS :=
SRC := main.c
include $(patsubst %,%/module.mk,$(MODULES))
OBJ := $(patsubst %.c,%.o,$(filter %.c,$(SRC)))
DEP := $(patsubst %.c,%.d,$(filter %.c,$(SRC)))

all : prog

prog : $(OBJ)
	$(CC) -o $@ $(OBJ) $(LIBS)

debug : CFLAGS += -O0 -g
debug : clean prog

valgrind: debug
	valgrind ./prog

-include $(DEP)

.PHONY: clean

clean:
	rm -f $(OBJ) $(DEP) prog
	rm -rf *.dSYM