rosettacode-c/Makefile

21 lines
367 B
Makefile
Raw Normal View History

2016-05-15 20:56:38 +00:00
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