summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-10-27 16:25:48 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-10-27 16:25:48 +0100
commit3d51521cc809f6ba23045bca03c261c5adca544e (patch)
treed956955329566a607586597580a0a4abf7b11d50
parente5b5f1a5d46ead5ed610c23363d8922e0404f715 (diff)
parent610875c47106392fc795d200c5a8bb67c16b8908 (diff)
Merge pull request #138 from slaff/master
Small improvements to the main Makefile for cross-compilation.
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index d2fcef3..93e22af 100644
--- a/Makefile
+++ b/Makefile
@@ -71,10 +71,19 @@ HHVM_STATIC_LIBRARY = libhhvmcpp.a
# library file. By default, g++ (the GNU C++ compiler) is used for both.
#
-COMPILER = g++
-LINKER = g++
-ARCHIVER = ar rcs
+ifdef CXX
+ COMPILER = ${CXX}
+ LINKER = ${CXX}
+else
+ COMPILER = g++
+ LINKER = g++
+endif
+ifdef AR
+ ARCHIVER = ${AR} rcs
+else
+ ARCHIVER = ar rcs
+endif
#
# Compiler flags
@@ -192,6 +201,7 @@ static_directories:
clean:
${RM} shared ${PHP_SHARED_LIBRARY} ${HHVM_SHARED_LIBRARY}
${RM} static ${PHP_STATIC_LIBRARY} ${HHVM_STATIC_LIBRARY}
+ find -name *.o | xargs ${RM}
${COMMON_SHARED_OBJECTS}:
${COMPILER} ${COMPILER_FLAGS} ${SHARED_COMPILER_FLAGS} -o $@ ${@:shared/%.o=%.cpp}