From 03a44d2ee839735dd44102c5c93b68ebc93b5d50 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 19 Dec 2020 09:56:15 -0500 Subject: Makefile: Fix behaviour if .flags doesn't exist yet --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cdbf664..832586a 100644 --- a/Makefile +++ b/Makefile @@ -169,6 +169,10 @@ $(BIN_GOALS): %.o: %.c .flags $(CC) $(ALL_CFLAGS) -c $< -o $@ +# Need a rule for .flags to convince make to apply the above pattern rule if +# .flags didn't exist when make was run +.flags: + # Make sure that "make release" builds everything, but "make release main.o" doesn't $(FLAG_GOALS): $(FLAG_PREREQS) @: @@ -193,7 +197,7 @@ endif +$(MAKE) -B check $(DISTCHECK_FLAGS) clean: - $(RM) $(BIN_GOALS) *.[od] *.gcda *.gcno tests/*.[od] tests/*.gcda tests/*.gcno + $(RM) $(BIN_GOALS) .flags *.[od] *.gcda *.gcno tests/*.[od] tests/*.gcda tests/*.gcno install: $(MKDIR) $(DESTDIR)$(PREFIX)/bin @@ -207,4 +211,6 @@ uninstall: .PHONY: default all $(FLAG_GOALS) check $(CHECKS) distcheck clean install uninstall +.SUFFIXES: + -include $(wildcard *.d) -- cgit v1.2.3