diff options
author | Peter Powell <petpow@saberuk.com> | 2019-10-16 11:55:14 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-10-16 12:34:24 +0100 |
commit | 08393c002803b93ac53a6a1a0a5272e76b6ae5e4 (patch) | |
tree | fdb60172821a1429f70cd3364a98ca36a11ed5b9 | |
parent | d0f802e30c492cb1b7e55f51063bfd38b29931c6 (diff) |
Use separate build dirs when rebuilding with a different compiler.
-rwxr-xr-x | make/calcdep.pl | 5 | ||||
-rw-r--r-- | make/template/main.mk | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl index 279fdffce..f96afee33 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -20,6 +20,7 @@ BEGIN { + push @INC, $ENV{SOURCEPATH}; require 5.10.0; unless (-f 'configure') { print "Error: $0 must be run from the main source directory!\n"; @@ -32,6 +33,8 @@ use warnings FATAL => qw(all); use File::Basename qw(basename); +use make::common; + use constant { BUILDPATH => $ENV{BUILDPATH}, SOURCEPATH => $ENV{SOURCEPATH} @@ -50,7 +53,7 @@ run; exit 0; sub run() { - mkdir BUILDPATH; + create_directory(BUILDPATH, 0770) or die "Could not create build directory: $!"; chdir BUILDPATH or die "Could not open build directory: $!"; unlink 'include'; symlink "${\SOURCEPATH}/include", 'include'; diff --git a/make/template/main.mk b/make/template/main.mk index 7e22cf254..1e6ba5cd0 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -32,7 +32,7 @@ CXX = @CXX@ COMPILER = @COMPILER_NAME@ SYSTEM = @SYSTEM_NAME@ -BUILDPATH ?= $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/build +BUILDPATH ?= $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/build/@COMPILER_NAME@-@COMPILER_VERSION@ SOCKETENGINE = @SOCKETENGINE@ CORECXXFLAGS = -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow LDLIBS = -lstdc++ |