summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-12-19 09:56:15 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-12-19 09:56:15 -0500
commit03a44d2ee839735dd44102c5c93b68ebc93b5d50 (patch)
tree0653a564f0073b0ae9665213be1b7381eca64f41
parent038579b8fd9b96a207cb45e0adf113e881d8ff8d (diff)
downloadbfs-03a44d2ee839735dd44102c5c93b68ebc93b5d50.tar.xz
Makefile: Fix behaviour if .flags doesn't exist yet
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
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)