mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-18 02:39:59 +00:00
Rework Makefile a bit.
rename TARGET to BOARD (fix #55) use .INTERMEDIATE trick to avoid building multiple times (fix #52) Don't touch build/*/.config if we don't have to (fix #51)
This commit is contained in:
parent
4a83273744
commit
e55a6a4df4
37
Makefile
37
Makefile
@ -5,9 +5,12 @@ build := $(pwd)/build
|
||||
config := $(pwd)/build
|
||||
|
||||
# Currently supported targets are x230, chell and qemu
|
||||
TARGET ?= x230
|
||||
BOARD ?= x230
|
||||
|
||||
all: $(TARGET).rom
|
||||
all: $(BOARD).rom
|
||||
|
||||
# Disable all built in rules
|
||||
.SUFFIXES:
|
||||
|
||||
|
||||
# Bring in all of the module definitions;
|
||||
@ -15,7 +18,9 @@ all: $(TARGET).rom
|
||||
# as part of creating the Heads firmware image.
|
||||
include modules/*
|
||||
|
||||
all: $(modules)
|
||||
# These will be built via their intermediate targets
|
||||
# This increases the build time, so it is commented out for now
|
||||
#all: $(foreach m,$(modules),$m.intermediate)
|
||||
|
||||
define prefix =
|
||||
$(foreach _, $2, $1$_)
|
||||
@ -68,8 +73,14 @@ define define_module =
|
||||
endif
|
||||
|
||||
# Copy our stored config file into the unpacked directory
|
||||
$(build)/$($1_dir)/.config: config/$($1_config) $(build)/$($1_dir)/.canary
|
||||
cp "$$<" "$$@"
|
||||
ifdef $1_config
|
||||
$(build)/$($1_dir)/.config: config/$($1_config) $(build)/$($1_dir)/.canary
|
||||
cp -a "$$<" "$$@"
|
||||
else
|
||||
$(build)/$($1_dir)/.config: $(build)/$($1_dir)/.canary
|
||||
touch "$$@"
|
||||
endif
|
||||
|
||||
|
||||
# Use the module's configure variable to build itself
|
||||
$(build)/$($1_dir)/.configured: \
|
||||
@ -79,14 +90,18 @@ define define_module =
|
||||
touch "$$@"
|
||||
|
||||
# Build the target after any dependencies
|
||||
$(call outputs,$1): \
|
||||
$(build)/$($1_dir)/.configured \
|
||||
$(call outputs,$($1_depends))
|
||||
make -C "$(build)/$($1_dir)" $($1_target)
|
||||
$(call outputs,$1): $1.intermediate
|
||||
|
||||
# Short hand target for the module
|
||||
$1: $(call outputs,$1)
|
||||
#$1: $(call outputs,$1)
|
||||
|
||||
# Target for all of the outputs, which depend on their dependent modules
|
||||
$1.intermediate: \
|
||||
$(build)/$($1_dir)/.configured \
|
||||
$(foreach d,$($1_depends),$d.intermediate)
|
||||
make -C "$(build)/$($1_dir)" $($1_target)
|
||||
|
||||
.INTERMEDIATE: $1.intermediate
|
||||
endef
|
||||
|
||||
$(foreach _, $(modules), $(eval $(call define_module,$_)))
|
||||
@ -208,6 +223,8 @@ initrd.cpio: $(initrd_bins) $(initrd_libs) initrd_lib_install
|
||||
echo "$@: Unchanged"; \
|
||||
rm "$@.tmp"; \
|
||||
fi
|
||||
|
||||
initrd.intermediate: initrd.cpio
|
||||
|
||||
|
||||
# populate the coreboot initrd image from the one we built.
|
||||
|
@ -1 +0,0 @@
|
||||
# nothing
|
@ -1 +0,0 @@
|
||||
# nothing
|
@ -1 +0,0 @@
|
||||
# nothing
|
@ -1 +0,0 @@
|
||||
# nothing
|
@ -1 +0,0 @@
|
||||
# nothing
|
@ -1 +0,0 @@
|
||||
# Nothing
|
@ -11,15 +11,15 @@ coreboot_repo := https://github.com/osresearch/coreboot
|
||||
|
||||
# Coreboot builds are specialized on a per-target basis.
|
||||
# The builds are done in a per-target subdirectory
|
||||
coreboot_config := coreboot-$(TARGET).config
|
||||
#coreboot_config := coreboot-$(TARGET).config
|
||||
|
||||
coreboot_configure := \
|
||||
make oldconfig obj=./$(TARGET) DOTCONFIG=../../config/coreboot-$(TARGET).config
|
||||
make oldconfig obj=./$(BOARD) DOTCONFIG=../../config/coreboot-$(BOARD).config
|
||||
|
||||
coreboot_target := \
|
||||
obj=./$(TARGET) DOTCONFIG=../../config/coreboot-$(TARGET).config -j 8
|
||||
obj=./$(BOARD) DOTCONFIG=../../config/coreboot-$(BOARD).config -j 8
|
||||
|
||||
coreboot_output := $(TARGET)/coreboot.rom
|
||||
coreboot_output := $(BOARD)/coreboot.rom
|
||||
|
||||
|
||||
# hack to force a build dependency on the cross compiler
|
||||
|
@ -7,5 +7,4 @@ cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7/cryptse
|
||||
cryptsetup_hash := dbb35dbf5f0c1749168c86c913fe98e872247bfc8425314b494c2423e7e43342
|
||||
|
||||
cryptsetup_configure := ./configure
|
||||
cryptsetup_config := cryptsetup.config
|
||||
cryptsetup_output :=
|
||||
|
@ -8,4 +8,3 @@ kexec_hash := cc7b60dad0da202004048a6179d8a53606943062dd627a2edba45a8ea3a85135
|
||||
|
||||
kexec_configure := ./configure
|
||||
kexec_output := build/sbin/kexec
|
||||
kexec_config := kexec.config
|
||||
|
@ -11,4 +11,3 @@ mbedtls_libraries := \
|
||||
|
||||
mbedtls_configure :=
|
||||
mbedtls_target := SHARED=1
|
||||
mbedtls_config := mbedtls.config
|
||||
|
@ -8,4 +8,3 @@ qrencode_hash := e794e26a96019013c0e3665cb06b18992668f352c5553d0a553f5d144f7f2a7
|
||||
|
||||
qrencode_output := .libs/libqrencode.so.$(qrencode_version)
|
||||
qrencode_configure := ./configure --without-tools
|
||||
qrencode_config := qrencode.config
|
||||
|
@ -42,4 +42,3 @@ tpmtotp_libraries := \
|
||||
libtpm/libtpm.so \
|
||||
|
||||
tpmtotp_configure :=
|
||||
tpmtotp_config := tpmtotp.config
|
||||
|
@ -11,4 +11,3 @@ xen_hash := 02badfce9a037bd1bd4a94210c1f6b85467746216c71795805102b514bcf1fc4
|
||||
xen_output := xen.gz
|
||||
xen_configure :=
|
||||
xen_target := -j 8
|
||||
xen_config := xen.config
|
||||
|
Loading…
Reference in New Issue
Block a user