Makefile: rebuild on flags changes
This invalidates all caches in case a flag like DEBUG=1 is specified on the make command line.
This commit is contained in:
parent
4372db2169
commit
8a219c4979
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,5 +2,6 @@
|
||||
build
|
||||
__pycache__
|
||||
configure.mk
|
||||
flags.mk
|
||||
result
|
||||
gcroots
|
||||
|
11
Makefile
11
Makefile
@ -253,6 +253,13 @@ graph.svg: Makefile
|
||||
# Rebuild everything if the makefile changed
|
||||
.EXTRA_PREREQS += Makefile
|
||||
|
||||
# Rebuild everything if a flag changed
|
||||
.EXTRA_PREREQS += flags.mk
|
||||
|
||||
# Store current make flags
|
||||
FLAGS=$(filter-out -%,$(MAKEFLAGS))
|
||||
$(shell test '$(FLAGS)' != "`cat flags.mk 2>&1`" && echo '$(FLAGS)' > flags.mk)
|
||||
|
||||
# Search for source code in vendor/ subdirectory
|
||||
vpath %.f90 $(SRCDIR):$(SRCDIR)/vendor
|
||||
|
||||
@ -275,7 +282,7 @@ $(OBJDIR)/%.d: %.f90 | $(OBJDIR)
|
||||
%.a : ; $(AR) $(ARFLAGS) $@ $?
|
||||
|
||||
# Load the generated rules
|
||||
include $(DEPS)
|
||||
-include $(DEPS)
|
||||
|
||||
# Compile a generic Fortran source
|
||||
$(OBJDIR)/%.o: %.f90 | $(OBJDIR) $(INCDIR)
|
||||
@ -287,4 +294,4 @@ $(INCDIR)/%.inc: $(SRCDIR)/%.awk | $(INCDIR)
|
||||
|
||||
# Create directories
|
||||
$(DIRS):
|
||||
mkdir -p '$@'
|
||||
@mkdir -p '$@'
|
||||
|
Loading…
Reference in New Issue
Block a user