summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-24 15:07:15 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-24 15:07:15 +0100
commit811c83de9e6410435b6b9c10b058b04b2fcae5c3 (patch)
tree3c712df4d30ceec169774b5a7d59beb776338def /Makefile
parent9c482cbbe8077fc36435a57cb67a6630a433a42a (diff)
simplified makefile by using php-config to find the entire include path
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 10 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 6205b83..304ca56 100644
--- a/Makefile
+++ b/Makefile
@@ -8,15 +8,16 @@
#
#
-# Zend header files
-#
-# The variable PHP_DIR contains the location on your system where the regular
-# header files of the Zend engine can be found. Usually this is either
-# /usr/include/php5 or /usr/local/include/php5. Inside this directory you
-# will find sub-directories named TSRM, Zend, ext and main.
+# Php-config utility
#
+# PHP comes with a standard utility program called 'php-config'. This program
+# can be used to find out in which directories PHP is installed. Inside this
+# makefile this utility program is used to find include directories, shared
+# libraries and the path to the binary file. If your php-config is not
+# installed in the default directory, you can change that here.
+#
-PHP_DIR = `php-config --include-dir`
+PHP_CONFIG = php-config
#
@@ -27,7 +28,7 @@ PHP_DIR = `php-config --include-dir`
# You can see the command "whereis php"
#
-PHP_BIN = `php-config --php-binary`
+PHP_BIN = $(shell ${PHP_CONFIG} --php-binary)
#
@@ -82,7 +83,7 @@ LINKER = g++
# you want to leave that flag out on production servers).
#
-COMPILER_FLAGS = -Wall -c -I. -I${PHP_DIR} -I${PHP_DIR}/main -I${PHP_DIR}/ext -I${PHP_DIR}/Zend -I${PHP_DIR}/TSRM -g -std=c++11 -fpic -o
+COMPILER_FLAGS = -Wall -c `php-config --includes` -g -std=c++11 -fpic -o
#