summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/mkwb/site.mk19
-rwxr-xr-xsrc/rules.in12
2 files changed, 17 insertions, 14 deletions
diff --git a/share/mkwb/site.mk b/share/mkwb/site.mk
index 76e9e51..be09055 100644
--- a/share/mkwb/site.mk
+++ b/share/mkwb/site.mk
@@ -1,12 +1,13 @@
-## mkwb canonical site rules. Sites consume this transitively
-## via deps.mk: mkdeps.sh emits `include <mkwb rules path>` as
-## the last line of deps.mk, so the site Makefile only needs an
-## `all:` anchor followed by `include deps.mk`. Order matters:
-## `all:` must come first (otherwise deps.mk's first target
-## becomes the default), and the site.mk include must come AFTER
-## deps.mk's variable assignments so that this file's
-## `all: $(derived-assets)` line can resolve its prereq list at
-## parse time.
+## mkwb canonical site rules. Sites consume this content by
+## inlining it at the end of their generated deps.mk: mkdeps.sh
+## runs `mkwb rules` (which cats this file) so deps.mk ends up
+## self-contained -- no make-time `include` of an external file.
+## The site Makefile only needs an `all:` anchor followed by
+## `include deps.mk`. Order matters: `all:` must come first
+## (otherwise deps.mk's first target becomes the default), and
+## the canonical rules below must follow deps.mk's variable
+## assignments so that `all: $(derived-assets)` can resolve its
+## prereq list at parse time.
##
## The including Makefile is expected to define at minimum:
##
diff --git a/src/rules.in b/src/rules.in
index b998091..78fa73f 100755
--- a/src/rules.in
+++ b/src/rules.in
@@ -1,6 +1,8 @@
#!/bin/sh
-# Print the absolute path of the canonical Makefile rules shipped
-# alongside mkwb. Sites consume it with:
-# include $(shell mkwb rules)
-# in their top-level Makefile.
-echo '@SHAREDIR@/mkwb/site.mk'
+# Print the contents of the canonical Makefile rules shipped
+# alongside mkwb. Site builds embed the output directly in their
+# generated deps.mk so no `include` directive (or shell-out) is
+# needed at make time:
+# # at the end of mkdeps.sh:
+# mkwb rules
+exec cat '@SHAREDIR@/mkwb/site.mk'