Skip to content

Commit 1c64e4c

Browse files
committed
module ordering works, so include entire module/* directory; fix initrd/bin mkdir; correct spelling of coreboot dep on bzImage
1 parent ef9485e commit 1c64e4c

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

Makefile

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ config := $(pwd)/build
66

77
all:
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

1812
all: $(modules)
1913

@@ -22,7 +16,7 @@ $(foreach _, $2, $1$_)
2216
endef
2317

2418
define outputs =
25-
$(call prefix,$(build)/$($1_dir)/,$($1_output))
19+
$(foreach m,$1,$(call prefix,$(build)/$($m_dir)/,$($m_output)))
2620
endef
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
#
7773
define initrd_bin =
7874
initrd/bin/$(notdir $1): $1
79-
@-mkdir "initrd/bin"
75+
@if [ ! -d initrd/bin ]; then mkdir "initrd/bin"; fi
8076
cmp --quiet "$$@" "$$^" || \
8177
cp -a "$$^" "$$@"
8278
initrd_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

Comments
 (0)