summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-04-02 22:29:45 +0200
committerAlyssa Ross <hi@alyssa.is>2024-04-03 00:13:57 +0200
commit2f0d2c94c7a8d02310ad813402b4d8116b96f824 (patch)
treec2fa8cc27b37916ae647d49c20848d6e7ecae5e0
parent3bb81c5c00351230b328df95395447d0c2a7a119 (diff)
downloadspectrum-2f0d2c94c7a8d02310ad813402b4d8116b96f824.tar
spectrum-2f0d2c94c7a8d02310ad813402b4d8116b96f824.tar.gz
spectrum-2f0d2c94c7a8d02310ad813402b4d8116b96f824.tar.bz2
spectrum-2f0d2c94c7a8d02310ad813402b4d8116b96f824.tar.lz
spectrum-2f0d2c94c7a8d02310ad813402b4d8116b96f824.tar.xz
spectrum-2f0d2c94c7a8d02310ad813402b4d8116b96f824.tar.zst
spectrum-2f0d2c94c7a8d02310ad813402b4d8116b96f824.zip
Access PACKAGES through the shell instead of make
The command line here was still getting too long for the shell.
Previously, I assumed this was make-erofs.sh's command line, but it
was probably actually the command line for the shell invoked by make
with sh -c.  To reduce the length of this, don't have make pass the
whole PACKAGES list to the shell.  Instead have the shell read it from
the environment itself.

PACKAGES is not defined in the Makefile, so it has to be provided
either in the environment or on the make command line.  POSIX
specifies that macros defined on the make command line are added to
the environment, so this should still work in both cases.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
-rw-r--r--host/rootfs/Makefile2
-rw-r--r--img/app/Makefile2
-rw-r--r--vm/sys/net/Makefile2
3 files changed, 3 insertions, 3 deletions
diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile
index c6bd3be..700c803 100644
--- a/host/rootfs/Makefile
+++ b/host/rootfs/Makefile
@@ -77,7 +77,7 @@ BUILD_FILES = build/etc/mdev/modalias.sh build/etc/s6-rc
 
 $(dest): ../../scripts/make-erofs.sh $(FILES) $(BUILD_FILES) build/empty
 	( \
-	    printf '%s\n' $(PACKAGES) ;\
+	    printf '%s\n' $$PACKAGES ;\
 	    for file in $(FILES) $(LINKS); do printf '%s\n%s\n' $$file $$file; done ;\
 	    for file in $(BUILD_FILES); do printf '%s\n%s\n' $$file $${file#build/}; done ;\
 	    printf 'build/empty\n%s\n' $(DIRS) ;\
diff --git a/img/app/Makefile b/img/app/Makefile
index 78f1a00..31c9e82 100644
--- a/img/app/Makefile
+++ b/img/app/Makefile
@@ -53,7 +53,7 @@ build/empty:
 
 build/rootfs.erofs: ../../scripts/make-erofs.sh $(VM_FILES) $(VM_BUILD_FILES) build/empty
 	( \
-	    printf '%s\n' $(PACKAGES) ;\
+	    printf '%s\n' $$PACKAGES ;\
 	    for file in $(VM_FILES) $(VM_LINKS); do printf '%s\n%s\n' $$file $$file; done ;\
 	    for file in $(VM_BUILD_FILES); do printf '%s\n%s\n' $$file $${file#build/}; done ;\
 	    printf 'build/empty\n%s\n' $(VM_DIRS) ;\
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile
index eb1af5b..00757db 100644
--- a/vm/sys/net/Makefile
+++ b/vm/sys/net/Makefile
@@ -58,7 +58,7 @@ build/empty:
 
 build/rootfs.erofs: ../../../scripts/make-erofs.sh $(VM_FILES) $(VM_BUILD_FILES) build/empty
 	( \
-	    printf '%s\n' $(PACKAGES) ;\
+	    printf '%s\n' $$PACKAGES ;\
 	    for file in $(VM_FILES) $(VM_LINKS); do printf '%s\n%s\n' $$file $$file; done ;\
 	    for file in $(VM_BUILD_FILES); do printf '%s\n%s\n' $$file $${file#build/}; done ;\
 	    printf 'build/empty\n%s\n' $(VM_DIRS) ;\