chiark / gitweb /
Makefile: Introduce MAKEFILE_DEP
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 Mar 2021 11:01:09 +0000 (11:01 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 21 Mar 2021 11:06:05 +0000 (11:06 +0000)
This lets us say MAKEFILE_DEP='' to avoid unwanted rebuilding, while
we are editing the Makefile itself.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Makefile
media-scraper

index b6e97ad331142b4fe1add10790ba52cbdbcf9452..592f282a44db731fba10aa7f7429ec46f25429ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,8 @@ shapelib: templates/shapelib.html stamp/cargo.doc-otter-only
        @echo '  file://$(PWD)/$<'
        @echo '  file://$(abspath $(TARGET_DIR)/doc/otter/shapelib_toml/index.html)'
 
+MAKEFILE_DEP ?= Makefile
+
 #---------- funky macros etc. ----------
 
 cr = $(addprefix --,$(filter-out debug,$1))
@@ -237,7 +239,7 @@ bundled-sources:: $(addprefix $(TARGET_BUNDLED)/, $(BUNDLED_SOURCES_FILES))
 $(addprefix $(TARGET_BUNDLED)/, $(BUNDLED_SOURCES_LIT)): $(TARGET_BUNDLED)/%: %
        $(NAILING_CARGO_JUST_RUN) cp $(abspath $(src))/$< $(abspath $@)
 
-$(TARGET_BUNDLED)/index.html: bundled-sources-make-index Makefile
+$(TARGET_BUNDLED)/index.html: bundled-sources-make-index $(MAKEFILE_DEP)
        $(NAILING_CARGO_JUST_RUN) sh -ec '                      \
                cd $(abspath $(src)); mkdir -p $(dir $@);       \
                ./$< >$@.tmp $(BUNDLED_SOURCES_LINKS);          \
@@ -255,7 +257,7 @@ include $(addsuffix /files.make, $(LIBRARIES))
 
 USVG_PROCESSOR = usvg-processor
 LIBRARY_PROCESS_SVG = ./$(USVG_PROCESSOR) $@ $(wordlist 1,2,$^) '$(USVG_CMD) $(USVG_OPTIONS)'
-$(LIBRARY_FILES): $(USVG_PROCESSOR) $(USVG_BINARY) Makefile
+$(LIBRARY_FILES): $(USVG_PROCESSOR) $(USVG_BINARY) $(MAKEFILE_DEP)
 
 # actual command for each of $(LIBRARY_FILES) is in one of the files.make
 
@@ -279,7 +281,7 @@ templates/script.js: $(TS_SRC_FILES)
 #      @echo 'nodejs check $< ok'
 
 templates/otter_wasm.ns.d.ts: $(WASM_PACKED)/otter_wasm.d.ts \
-                               stamp/wasm-pack Makefile
+                               stamp/wasm-pack $(MAKEFILE_DEP)
        set -e; exec >$@.tmp;                           \
        echo 'declare namespace wasm_bindgen {';        \
        sed 's/^export default function init/export function init/' <$<; \
index 88a15d2b9f55dd52c28f0e6e9cae22cf71281828..5513ad3f786b743e7c8db25c3b0d0935c30a5ce3 100755 (executable)
@@ -239,7 +239,7 @@ END
            $cfp ="\$@.$ci.tmp";
            print $makefile <<END or die $!;
 LIBRARY_CLEAN += $ncoloured
-$ncoloured: $lupstream Makefile $makepath
+$ncoloured: $lupstream \$(MAKEFILE_DEP) $makepath
        \$(USVG_CMD) -c - <\$< >$cfp
 END
          }