@@ -6,14 +6,8 @@ config := $(pwd)/build
66
77all :
88
9- include modules/qrencode
10- include modules/kexec
11- include modules/tpmtotp
12- include modules/mbedtls
13- include modules/busybox
14- include modules/linux
15- include modules/coreboot
16- include modules/coreboot-blobs
9+
10+ include modules/*
1711
1812all : $(modules )
1913
@@ -22,7 +16,7 @@ $(foreach _, $2, $1$_)
2216endef
2317
2418define outputs =
25- $(call prefix,$(build ) /$($1_dir ) /,$($1_output ) )
19+ $(foreach m,$1, $( call prefix,$(build ) /$($m_dir ) /,$($m_output ) ) )
2620endef
2721
2822#
@@ -41,7 +35,9 @@ define define_module =
4135
4236 # Unpack the tar file and touch the canary so that we know
4337 # that the files are all present
44- $(build ) /$($1_dir ) /.canary: $(packages ) /.$1_verify
38+ $(build ) /$($1_dir ) /.canary: \
39+ $(packages ) /.$1_verify \
40+ $(call outputs,$($1_depends ) )
4541 tar -xvf "$(packages ) /$($1_tar ) " -C "$(build ) "
4642 touch "$$@ "
4743
@@ -76,7 +72,7 @@ $(foreach _, $(modules), $(eval $(call define_module,$_)))
7672#
7773define initrd_bin =
7874initrd/bin/$(notdir $1) : $1
79- @- mkdir "initrd/bin"
75+ @if [ ! -d initrd/bin ]; then mkdir "initrd/bin"; fi
8076 cmp --quiet "$$@ " "$$^ " || \
8177 cp -a "$$^ " "$$@ "
8278initrd_bins += initrd/bin/$(notdir $1)
@@ -149,6 +145,7 @@ $(call outputs,linux): initrd.cpio
149145
150146# hack for the coreboot to find the linux kernel
151147$(build ) /$(coreboot_dir ) /bzImage : $(call outputs,linux)
152- cmp --quiet " $$ @" " $$ ^" || \
153- cp -a " $$ ^" " $$ @"
154- $(call outputs,corebot) : $(build ) /$(coreboot_dir ) /bzImage
148+ cmp --quiet " $@ " " $^" || \
149+ cp -a " $^" " $@ "
150+ $(call outputs,coreboot) : $(build ) /$(coreboot_dir ) /bzImage
151+
0 commit comments