Build system: prevent "--version: Command not found"
authorThomas Miedema <thomasmiedema@gmail.com>
Tue, 26 May 2015 13:15:38 +0000 (15:15 +0200)
committerThomas Miedema <thomasmiedema@gmail.com>
Sat, 30 May 2015 14:49:31 +0000 (16:49 +0200)
This would happen when running `make clean` before running
`./configure`.

[skip ci]

libraries/integer-gmp/gmp/ghc.mk

index 9c7a2a3..2e81956 100644 (file)
@@ -101,6 +101,8 @@ endif
 
 libraries/integer-gmp_dist-install_EXTRA_CC_OPTS += $(gmp_CC_OPTS)
 
+ifneq "$(CLEANING)" "YES"
+# When running `make clean` before `./configure`, CC_STAGE1 is undefined.
 CLANG = $(findstring clang, $(shell $(CC_STAGE1) --version))
 
 ifeq "$(CLANG)" "clang"
@@ -136,4 +138,5 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h:
        cd libraries/integer-gmp/gmp/objs && $(AR_STAGE1) x ../libgmp.a
        $(RANLIB_CMD) libraries/integer-gmp/gmp/libgmp.a
 
-endif
+endif # CLEANING
+endif # phase