codeSample/C/preproc_array/Makefile
2016-11-18 15:06:46 +01:00

21 lines
379 B
Makefile

CPPFLAGS ?= -Werror -Wall -std=c99
program = test
sources = $(wildcard *.c)
objects = $(sources:%.c=%.o)
depends = $(sources:%.c=%.d)
%.d: %.c
@$(CPP) $(CPPFLAGS) -c -MP -MM -MT "$@ $*.o" $< >$@
$(program): $(objects)
$(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS)
.PHONY: clean
clean:
rm -f $(program) $(objects) $(depends)
ifneq ($(MAKECMDGOALS),clean)
-include $(depends)
endif