rosettacode-c/Makefile
@@@No user configured@@@ 9b76c4f9f7 Build binaries in bin/
2016-05-16 01:53:40 +02:00

22 lines
513 B
Makefile

SRC = $(wildcard src/*.c)
DEPS = $(wildcard deps/**/*.c)
OBJS = $(patsubst %.c,%.o,$(DEPS))
BINS = $(patsubst src/%,bin/%,$(patsubst %.c,%,$(SRC)))
# CFLAGS = -std=c99 -Ideps -Wall -Wno-unused-function -U__STRICT_ANSI__
CFLAGS = -ggdb -std=c99 -Ideps -Wall -Wno-unused-function -pedantic
all: $(BINS)
echo "BINS=$(BINS)"
$(BINS): $(SRC) $(OBJS)
$(CC) $(CFLAGS) -o $@ src/$(notdir $@).c $(OBJS) $(LDFLAGS)
%.o: %.c
$(CC) $< -c -o $@ $(CFLAGS)
clean:
$(foreach c, $(BINS), rm -f $(c);)
rm -f $(OBJS)