Skip to content

Commit

Permalink
Makefile: have local gawk depend on local make being built if in unex…
Browse files Browse the repository at this point in the history
…pected version.

Maximized boards: have rom hashes outputted under hashes.txt. Still not clear why the Makefile "all" target is not doing that for each target.

- Fixes a bug where "make BOARD=xyz bootstrap" was needed prior of being able to build anything else otherwise HEADS_GAWK was expecting HEADS_MAKE to be built already, which was not the case.
(fixes linuxboot#1126)

- As of now, I do not see any OS make/gawk being used anymore. All modules except coreboot (which uses coreboot buildstack), including musl-cross-make, are being built with local make and local gawk.
Improves linuxboot#936 (comment) which showed that local make (/usb/bin/make, /usr/local/bin/make, /usr/sbin/make, /usr/local/sbin/make and /usr/bin/gawk were called locally. To redo)
  • Loading branch information
tlaurion committed Mar 4, 2022
1 parent 70b93be commit 790671f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ $(HEADS_MAKE): $(build)/$(make_dir)/.configured
$(VERBOSE_REDIRECT)

# Once we have a proper Make, we can just pass arguments into it
all linux cpio run: $(HEADS_MAKE)
LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $(MAKE_JOBS) $@
%.clean %.vol %.menuconfig: $(HEADS_MAKE)
LANG=C MAKE=$(HEADS_MAKE) $(HEADS_MAKE) $@
all linux cpio run: | $(HEADS_MAKE)
%.clean %.vol %.menuconfig: | $(HEADS_MAKE)

bootstrap: $(HEADS_MAKE)
endif
Expand Down Expand Up @@ -135,10 +133,10 @@ $(HEADS_GAWK): $(build)/$(gawk_dir)/.configured
$(VERBOSE_REDIRECT)

# Once we have a suitable version of gawk, we can rerun make
all linux cpio run: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $(MAKE_JOBS) $@
%.clean %.vol %.menuconfig: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $@
all linux cpio run: | $(HEADS_MAKE) $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $(MAKE_JOBS)
%.clean %.vol %.menuconfig: | $(HEADS_MAKE) $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE)

bootstrap: $(HEADS_GAWK)
endif
Expand Down
7 changes: 5 additions & 2 deletions boards/x230-maximized/x230-maximized.config
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,15 @@ export CONFIG_FLASHROM_OPTIONS="--force --noverify-all -p internal"
#
# When flashing via an external programmer it is easiest to have
# two separate files for these pieces.
all: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
@sha256sum $@ | tee -a "$(HASHES)"

all: $(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom
$(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-bottom.rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
$(call do,DD 8MB,$@,dd of=$@ if=$< bs=65536 count=128 skip=0 status=none)
@sha256sum $@
@sha256sum $@ | tee -a "$(HASHES)"

all: $(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom
$(build)/$(BOARD)/heads-$(BOARD)-$(HEADS_GIT_VERSION)-top.rom: $(build)/$(BOARD)/$(CB_OUTPUT_FILE)
$(call do,DD 4MB,$@,dd of=$@ if=$< bs=65536 count=64 skip=128 status=none)
@sha256sum $@
@sha256sum $@ | tee -a "$(HASHES)"

0 comments on commit 790671f

Please sign in to comment.