summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-05 18:17:09 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-05 18:17:09 +0200
commit5d84ff5483f2db57762311714ff3c779db1e0f96 (patch)
tree0691e7395a292b152af3525b1e65a11b15bad46f /Makefile
parent5973954b7428aa95ec8f0b2424b5725d2815049f (diff)
removed zend code from the argument.h header file
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile50
1 files changed, 34 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index ce4c59e..60e82e8 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,8 @@ INSTALL_LIB = ${INSTALL_PREFIX}/lib
# you can change that here.
#
-LIBRARY = libphpcpp.so
+PHP_LIBRARY = libphpcpp.so
+HHVM_LIBRARY = libhhvmcpp.so
#
@@ -84,7 +85,9 @@ LINKER = g++
# you want to leave that flag out on production servers).
#
-COMPILER_FLAGS = -Wall -c `php-config --includes` -g -std=c++11 -fpic -o
+COMPILER_FLAGS = -Wall -c -g -std=c++11 -fpic
+PHP_COMPILER_FLAGS = ${COMPILER_FLAGS} `php-config --includes`
+HHVM_COMPILER_FLAGS = ${COMPILER_FLAGS}
#
# Linker flags
@@ -96,7 +99,9 @@ COMPILER_FLAGS = -Wall -c `php-config --includes` -g -std=c++11 -fpic -o
# to the linker flags
#
-LINKER_FLAGS = -shared `php-config --ldflags`
+LINKER_FLAGS = -shared
+PHP_LINKER_FLAGS = ${LINKER_FLAGS} `php-config --ldflags`
+HHVM_LINKER_FLAGS = ${LINKER_FLAGS}
#
@@ -118,19 +123,22 @@ MKDIR = mkdir -p
# src/ directory for all *.cpp files. No changes are probably necessary here
#
-LIBRARY_SOURCES = $(wildcard src/*.cpp)
-
+SOURCES = $(wildcard src/*.cpp)
+PHP_SOURCES = $(wildcard src/zend/*.cpp)
+HHVM_SOURCES = $(wildcard src/hhvm/*.cpp)
#
# The object files
#
# The intermediate object files are generated by the compiler right before
-# the linker turns all these object files into the libphpcpp.so shared library.
-# We also use a Makefile function here that takes all source files.
+# the linker turns all these object files into the libphpcpp.so and
+# libhhvmcpp.so shared libraries. We also use a Makefile function here that
+# takes all source files.
#
-LIBRARY_OBJECTS = $(LIBRARY_SOURCES:%.cpp=%.o)
-
+OBJECTS = $(SOURCES:%.cpp=%.o)
+PHP_OBJECTS = $(PHP_SOURCES:%.cpp=%.o)
+HHVM_OBJECTS = $(HHVM_SOURCES:%.cpp=%.o)
#
# Configuration program
@@ -149,25 +157,35 @@ CONFIG_FLAGS = `php-config --includes` -o
# dependencies that are used by the compiler.
#
-all: ${LIBRARY_OBJECTS} ${LIBRARY} ${CONFIG_UTILITY}
+all: ${PHP_LIBRARY} ${CONFIG_UTILITY}
+
+${PHP_LIBRARY}: ${OBJECTS} ${PHP_OBJECTS}
+ ${LINKER} ${PHP_LINKER_FLAGS} -o $@ ${OBJECTS} ${PHP_OBJECTS}
-${LIBRARY}: ${LIBRARY_OBJECTS}
- ${LINKER} ${LINKER_FLAGS} -o $@ ${LIBRARY_OBJECTS}
+${HHVM_LIBRARY}: ${OBJECTS} ${HHVM_OBJECTS}
+ ${LINKER} ${HHVM_LINKER_FLAGS} -o $@ ${OBJECTS} ${HHVM_OBJECTS}
${CONFIG_UTILITY}:
${COMPILER} ${CONFIG_FLAGS} $@ ${CONFIG_SOURCES}
clean:
- ${RM} ${LIBRARY_OBJECTS} ${LIBRARY} ${CONFIG_UTILITY}
+ ${RM} ${OBJECTS} ${PHP_OBJECTS} ${HHVM_OBJECTS} ${PHP_LIBRARY} ${HHVM_LIBRARY} ${CONFIG_UTILITY}
+
+${OBJECTS}:
+ ${COMPILER} ${PHP_COMPILER_FLAGS} -o $@ ${@:%.o=%.cpp}
+
+${PHP_OBJECTS}:
+ ${COMPILER} ${PHP_COMPILER_FLAGS} -o $@ ${@:%.o=%.cpp}
-${LIBRARY_OBJECTS}:
- ${COMPILER} ${COMPILER_FLAGS} $@ ${@:%.o=%.cpp}
+${HHVM_OBJECTS}:
+ ${COMPILER} ${HHVM_COMPILER_FLAGS} -o $@ ${@:%.o=%.cpp}
install:
${MKDIR} ${INSTALL_HEADERS}/phpcpp
${CP} phpcpp.h ${INSTALL_HEADERS}
${CP} include/*.h ${INSTALL_HEADERS}/phpcpp
- ${CP} ${LIBRARY} ${INSTALL_LIB}
+ ${CP} ${PHP_LIBRARY} ${INSTALL_LIB}
+ ${CP} ${HHVM_LIBRARY} ${INSTALL_LIB}
${CONFIG_UTILITY} > ${INSTALL_HEADERS}/phpcpp/config.h
test: