summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-12-29 23:18:13 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-12-29 23:18:13 -0500
commitb9160874be69ca4a08df3f19e2477d0b5fae4c52 (patch)
tree192a4a48bc5f0f5d613a10e8d81a1b329072438d
parent7d68a92e0b043f0fec0561e88aec68d1fe96c9cc (diff)
Compile with -static, set -m32 if in an i686 directory
-rw-r--r--Makefile4
-rw-r--r--Makefile.d/modules.mk4
-rw-r--r--Makefile.d/modules/coreboot.mk14
-rw-r--r--Makefile.d/modules/flashrom.mk6
-rw-r--r--Makefile.d/modules/seabios.mk2
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 $</.config
- $(MAKE) -C $<
+ $(MAKE) CC='$(CC)' -C $<
mkdir -p $(@D)
touch $@