From b9160874be69ca4a08df3f19e2477d0b5fae4c52 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 29 Dec 2014 23:18:13 -0500 Subject: Compile with -static, set -m32 if in an i686 directory --- Makefile | 4 +++- Makefile.d/modules.mk | 4 ++-- Makefile.d/modules/coreboot.mk | 14 +++++++------- Makefile.d/modules/flashrom.mk | 6 +++--- Makefile.d/modules/seabios.mk | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index d3a7889..070c232 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ VERSION := $(shell if test -f version.txt; then cat version.txt; else git describe; fi) host_arch := $(shell uname -m) -#export CC := $(CC) -static + +export SHARED=0 +export CC = gcc -static $(if $(findstring i686,$@),-m32) # Just for convenience keymapdir = resources/utilities/grub-assemble/keymap diff --git a/Makefile.d/modules.mk b/Makefile.d/modules.mk index d08a55c..0a541f4 100644 --- a/Makefile.d/modules.mk +++ b/Makefile.d/modules.mk @@ -32,7 +32,7 @@ $(eval $(call multiglob,download,arch module)) tmp/builddeps-stamps/%: src/% cd $< && { test -f ./Makefile || test -x ./configure || ./autogen.sh; } cd $< && { test -f ./Makefile || ./configure $($(*F)_configure); } - $(MAKE) -C $< + $(MAKE) CC='$(CC)' -C $< mkdir -p $(@D) touch $@ @@ -41,4 +41,4 @@ $(foreach arch,$(arches),$(foreach module,$(modules), cleandeps-$(arch)/$(module cleandeps-%: PHONY cleandeps-%-custom rm -f tmp/builddeps-stamps/% cleandeps-%-custom: PHONY - test ! -f src/$*/Makefile || $(MAKE) -C src/$* clean + test ! -f src/$*/Makefile || $(MAKE) CC='$(CC)' -C src/$* clean diff --git a/Makefile.d/modules/coreboot.mk b/Makefile.d/modules/coreboot.mk index 1099039..0101d7a 100644 --- a/Makefile.d/modules/coreboot.mk +++ b/Makefile.d/modules/coreboot.mk @@ -41,21 +41,21 @@ tmp/builddeps-stamps/%/coreboot: \ # The 3 actual utility builddeps: tmp/builddeps-stamps/%/coreboot-cbfstool: src/%/coreboot/util/cbfstool - $(MAKE) -C $< + $(MAKE) CC='$(CC)' -C $< mkdir -p $(@D) touch $@ tmp/builddeps-stamps/%/coreboot-nvramtool: src/%/coreboot/util/nvramtool - $(MAKE) -C $< + $(MAKE) CC='$(CC)' -C $< mkdir -p $(@D) touch $@ tmp/builddeps-stamps/%/coreboot-crossgcc: src/%/coreboot/util/crossgcc - $(MAKE) -C src/$*/coreboot crossgcc-i386 + $(MAKE) CC='$(CC)' -C src/$*/coreboot crossgcc-i386 mkdir -p $(@D) touch $@ cleandeps-%/coreboot-custom: PHONY - test ! -f src/%/coreboot/Makefile || $(MAKE) -C src/%/coreboot clean - test ! -f src/%/coreboot/Makefile || $(MAKE) -C src/%/coreboot/util/cbfstool clean - test ! -f src/%/coreboot/Makefile || $(MAKE) -C src/%/coreboot/util/nvramtool clean - test ! -f src/%/coreboot/Makefile || $(MAKE) -C src/%/coreboot crossgcc-clean + test ! -f src/%/coreboot/Makefile || $(MAKE) CC='$(CC)' -C src/%/coreboot clean + test ! -f src/%/coreboot/Makefile || $(MAKE) CC='$(CC)' -C src/%/coreboot/util/cbfstool clean + test ! -f src/%/coreboot/Makefile || $(MAKE) CC='$(CC)' -C src/%/coreboot/util/nvramtool clean + test ! -f src/%/coreboot/Makefile || $(MAKE) CC='$(CC)' -C src/%/coreboot crossgcc-clean rm -f tmp/builddeps-stamps/%/coreboot-* diff --git a/Makefile.d/modules/flashrom.mk b/Makefile.d/modules/flashrom.mk index c70e6e2..d7dcb94 100644 --- a/Makefile.d/modules/flashrom.mk +++ b/Makefile.d/modules/flashrom.mk @@ -13,8 +13,8 @@ endef $(foreach arch,$(arches),tmp/builddeps-stamps/$(arch)/flashrom): \ tmp/builddeps-stamps/%/flashrom: src/%/flashrom - $(MAKE) -C $< patchname=_normal - $(MAKE) -C $< patchname=_lenovobios_macronix - $(MAKE) -C $< patchname=_lenovobios_sst + $(MAKE) CC='$(CC)' -C $< patchname=_normal + $(MAKE) CC='$(CC)' -C $< patchname=_lenovobios_macronix + $(MAKE) CC='$(CC)' -C $< patchname=_lenovobios_sst mkdir -p $(@D) touch $@ diff --git a/Makefile.d/modules/seabios.mk b/Makefile.d/modules/seabios.mk index 17abece..215bae3 100644 --- a/Makefile.d/modules/seabios.mk +++ b/Makefile.d/modules/seabios.mk @@ -3,6 +3,6 @@ seabios_source = git://git.seabios.org/seabios.git\#commit=9f505f715793d99235bd6 $(foreach arch,$(arches),tmp/builddeps-stamps/$(arch)/seabios): \ tmp/builddeps-stamps/%/seabios: src/%/seabios resources/seabios/config/config cp resources/seabios/config/config $