codeSample/C/preproc_array/Makefile

21 lines
379 B
Makefile
Raw Permalink Normal View History

2016-11-18 15:06:46 +01:00
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