SRC = $(wildcard src/*.c) DEPS = $(wildcard deps/**/*.c) OBJS = $(DEPS:.c=.o) CFLAGS = -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__ BINS = exercice all: $(BINS) $(BINS): $(SRC) $(OBJS) $(CC) $(CFLAGS) -o $@ src/$(@:.exe=).c $(OBJS) $(LDFLAGS) %.o: %.c $(CC) $< -c -o $@ $(CFLAGS) clean: $(foreach c, $(BINS), rm $(c);) rm $(OBJS) src/*.o