build: Compute CC version, build date and uname string only once.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 1 Apr 2015 12:32:50 +0000 (12:32 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 28 Dec 2015 15:47:36 +0000 (15:47 +0000)
This should speed up the build somewhat, and it gets rid of a pointless
duplication in the Makefile.

Makefile.real

index 94d8edf287c67f57b33cd90482dd1625ecfb2a64..36d6e2343dd314cb6c95a7170168f0e95296e750 100644 (file)
@@ -10,6 +10,7 @@ uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
 uname_rs := $(shell uname -rs)
 cc_version := $(shell $(CC) --version | head -n 1)
 GIT_VERSION := $(shell ./GIT-VERSION-GEN git-version.h)
+build_date := $(shell date)
 
 ifeq ("$(origin O)", "command line")
        build_dir := $(O)
@@ -82,9 +83,9 @@ $(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,\
 $(subst z,Z,$1))))))))))))))))))))))))))
 
 CPPFLAGS += -DBINDIR='"$(bindir)"'
-CPPFLAGS += -DBUILD_DATE='"$(shell date)"'
-CPPFLAGS += -DUNAME_RS='"$(shell uname -rs)"'
-CPPFLAGS += -DCC_VERSION='"$(shell $(CC) --version | head -n 1)"'
+CPPFLAGS += -DBUILD_DATE='"$(build_date)"'
+CPPFLAGS += -DUNAME_RS='"$(uname_rs)"'
+CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
 CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F)
 CPPFLAGS += $(arch_cppflags)
 CPPFLAGS += -I/usr/local/include