From: Andre Noll Date: Wed, 1 Apr 2015 12:32:50 +0000 (+0000) Subject: build: Compute CC version, build date and uname string only once. X-Git-Tag: v0.5.6~83 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=e080d112e6a79c3f78c33d004010bff03b40b38d;p=paraslash.git build: Compute CC version, build date and uname string only once. This should speed up the build somewhat, and it gets rid of a pointless duplication in the Makefile. --- diff --git a/Makefile.real b/Makefile.real index 94d8edf2..36d6e234 100644 --- a/Makefile.real +++ b/Makefile.real @@ -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