diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-03-02 10:59:16 +0100 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-03-02 10:59:16 +0100 |
commit | c2805aa3ff0ca390553ce8a103d0926a37d960c2 (patch) | |
tree | f98833dc4933c20ac5cd615fad5545de796b7ab1 /makefiles | |
parent | 1d99bd87f762f8a2daad14afda88748c9e3815d6 (diff) | |
download | wolfbones-c2805aa3ff0ca390553ce8a103d0926a37d960c2.tar.gz wolfbones-c2805aa3ff0ca390553ce8a103d0926a37d960c2.tar.bz2 |
first version of a platform.mk.vars cache to speed up the build
Diffstat (limited to 'makefiles')
-rw-r--r-- | makefiles/gmake/compiler.mk | 12 | ||||
-rwxr-xr-x | makefiles/gmake/guess_env | 19 | ||||
-rw-r--r-- | makefiles/gmake/platform.mk | 10 | ||||
-rw-r--r-- | makefiles/gmake/top.mk | 5 |
4 files changed, 24 insertions, 22 deletions
diff --git a/makefiles/gmake/compiler.mk b/makefiles/gmake/compiler.mk index 623c6a2..e88ad79 100644 --- a/makefiles/gmake/compiler.mk +++ b/makefiles/gmake/compiler.mk @@ -15,8 +15,8 @@ ifeq "$(COMPILER)" "gcc" -GCC_MAJOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --gcc-major-version $(CC)) -GCC_MINOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --gcc-minor-version $(CC)) +GCC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --gcc-major-version $(CC)) +GCC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --gcc-minor-version $(CC)) # -Wswitch-default: not good for switches with enums # -Wsystem-headers: bad idea, as header files are usually happily broken :-) @@ -151,8 +151,8 @@ endif # start of tcc section # currently we don't need this, the tcc flags are fairly consistent -#TCC_MAJOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --tcc-major-version $(CC)) -#TCC_MINOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --tcc-minor-version $(CC)) +#TCC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --tcc-major-version $(CC)) +#TCC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --tcc-minor-version $(CC)) ifeq "$(COMPILER)" "tcc" COMPILE_FLAGS = \ @@ -164,8 +164,8 @@ endif # start of icc section # currently we don't need this, the icc flags are fairly consistent -#ICC_MAJOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --icc-major-version $(CC)) -#ICC_MINOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --icc-minor-version $(CC)) +#ICC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --icc-major-version $(CC)) +#ICC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --icc-minor-version $(CC)) # -vec-report0: turn of SSE2 vector usage messages (they are common since P-4 anyway!) diff --git a/makefiles/gmake/guess_env b/makefiles/gmake/guess_env index 3e87828..b2704d9 100755 --- a/makefiles/gmake/guess_env +++ b/makefiles/gmake/guess_env @@ -2,10 +2,6 @@ # operating system and major, minor version, more should not be necessary -if test -r "$HOME/guess_env.inc"; then - . "$HOME/guess_env.inc" -else - UNAME_SYSTEM=`(uname -s) 2>/dev/null` UNAME_RELEASE=`(uname -r) 2>/dev/null` UNAME_VERSION=`(uname -v) 2>/dev/null` @@ -121,8 +117,6 @@ if test $COMPILER = 'spro'; then SPRO_MAJOR_VERSION=`echo $SPRO_VERSION | cut -d : -f 1` fi -fi - case "$1" in --platform) echo $PLATFORM ;; @@ -159,9 +153,13 @@ case "$1" in --spro-major-version) echo $SPRO_MAJOR_VERSION ;; - - --all) - cat <<EOF +esac + +echo $PWD >> ~/x + +# regenerate the cache file, otherwise building is far too slow! +if test ! -f makefiles/gmake/platform.mk.vars; then + cat >makefiles/gmake/platform.mk.vars <<EOF ARCH=$ARCH PLATFORM=$PLATFORM OS_MAJOR_VERSION=$OS_MAJOR_VERSION @@ -175,5 +173,4 @@ ICC_MAJOR_VERSION=$ICC_MAJOR_VERSION ICC_MINOR_VERSION=$ICC_MINOR_VERSION SPRO_MAJOR_VERSION=$SPRO_MAJOR_VERSION EOF - ;; -esac +fi diff --git a/makefiles/gmake/platform.mk b/makefiles/gmake/platform.mk index 95843fb..8fc3905 100644 --- a/makefiles/gmake/platform.mk +++ b/makefiles/gmake/platform.mk @@ -16,10 +16,12 @@ # # author: Andreas Baumann, abaumann at yahoo dot com -PLATFORM = $(shell $(TOPDIR)/makefiles/gmake/guess_env --platform $(CC)) -OS_MAJOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-major-version $(CC)) -OS_MINOR_VERSION = $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-minor-version $(CC)) -COMPILER = $(shell $(TOPDIR)/makefiles/gmake/guess_env --compiler $(CC)) +-include $(TOPDIR)/makefiles/gmake/platform.mk.vars + +PLATFORM ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --platform $(CC)) +OS_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-major-version $(CC)) +OS_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --os-minor-version $(CC)) +COMPILER ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --compiler $(CC)) PLATFORM_COMPILE_FLAGS = \ -D$(PLATFORM) \ diff --git a/makefiles/gmake/top.mk b/makefiles/gmake/top.mk index 8463c53..1210751 100644 --- a/makefiles/gmake/top.mk +++ b/makefiles/gmake/top.mk @@ -13,6 +13,8 @@ # - target 'dist' # - target 'help' +-include makefiles/gmake/platform.mk + .PHONY: all all: @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \ @@ -27,6 +29,7 @@ clean: distclean: @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \ (set -e; $(MAKE) -C $$d distclean || exit 1); done) + @-rm $(TOPDIR)/makefiles/gmake/platform.mk.vars .PHONY: install install: @@ -43,6 +46,6 @@ doc: .PHONY: help help: - @cat makefiles/help.mk + @cat $(TOPDIR)/makefiles/gmake/help.mk -include $(TOPDIR)/makefiles/gmake/dist.mk |