object.mk (434B)
1 2 # only make compile_flags.txt if there are objects 3 compile_flags.txt: Makefile 4 ifneq "$(wildcard *.c)$(wildcard *.h)" "" 5 @echo "[ECHO] $@"; 6 $(SILENT)echo $(CPPFLAGS) $(CFLAGS) | tr " " "\n" > $@ 7 endif 8 9 # Object rules 10 %.o: %.c | $(HEADERS) 11 @echo "[ CC ] $< -> $@" 12 $(SILENT)$(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) 13 14 # Object rules 15 %.o: %.cc | $(HEADERS) 16 @echo "[ CC ] $< -> $@" 17 $(SILENT)$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)