Skip to content

Commit 87b079a

Browse files
Merge branch 'master' of github.com:CopernicaMarketingSoftware/PHP-CPP
2 parents dcf92fa + 1e01b0c commit 87b079a

File tree

16 files changed

+93
-69
lines changed

16 files changed

+93
-69
lines changed

Examples/CallPhpFunctions/Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
CPP = g++
22
RM = rm -f
33
CPP_FLAGS = -Wall -c -I. -O2 -std=c++11
4-
5-
PREFIX = /usr
6-
#Edit these lines to correspond with your own directories
4+
PHP_CONFIG = $(shell which php-config)
75
LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir)
8-
PHP_CONFIG_DIR = /etc/php5/cli/conf.d
6+
PHP_CONFIG_DIR = $(shell ${PHP_CONFIG} --ini-dir)
97

108
LD = g++
119
LD_FLAGS = -Wall -shared -O2
@@ -28,5 +26,9 @@ ${OBJECTS}:
2826
${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
2927

3028
install:
31-
cp -f ${RESULT} ${LIBRARY_DIR}
32-
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}
29+
cp -f ${RESULT} ${LIBRARY_DIR}/
30+
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}/
31+
32+
uninstall:
33+
rm ${LIBRARY_DIR}/${RESULT}
34+
rm ${PHP_CONFIG_DIR}/${PHPINIFILE}

Examples/ConstStaticProp/cpp/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ CPP = g++
22
RM = rm -f
33
CPP_FLAGS = -Wall -c -I. -O2 -std=c++11
44

5-
PREFIX = /usr
6-
#Edit these lines to correspond with your own directories
5+
PHP_CONFIG = $(shell which php-config)
76
LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir)
8-
PHP_CONFIG_DIR = /etc/php5/cli/conf.d
7+
PHP_CONFIG_DIR = $(shell ${PHP_CONFIG} --ini-dir)
98

109
LD = g++
1110
LD_FLAGS = -Wall -shared -O2
@@ -28,5 +27,9 @@ ${OBJECTS}:
2827
${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
2928

3029
install:
31-
cp -f ${RESULT} ${LIBRARY_DIR}
32-
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}
30+
cp -f ${RESULT} ${LIBRARY_DIR}/
31+
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}/
32+
33+
uninstall:
34+
rm ${LIBRARY_DIR}/${RESULT}
35+
rm ${PHP_CONFIG_DIR}/${PHPINIFILE}

Examples/CppClassesInPhp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ NAME = cppclassinphp
2929
# one for each extension. Use this variable to specify this directory.
3030
#
3131

32-
INI_DIR = /etc/php5/conf.d
32+
INI_DIR = $(shell php-config --ini-dir)
3333

3434

3535
#

Examples/DlUnrestricted/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ NAME = dlunrestricted
2929
# one for each extension. Use this variable to specify this directory.
3030
#
3131

32-
INI_DIR = /etc/php5/mods-available
32+
INI_DIR = $(shell php-config --ini-dir)
3333

3434

3535
#

Examples/EmptyExtension/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ NAME = yourextension
2929
# one for each extension. Use this variable to specify this directory.
3030
#
3131

32-
INI_DIR = /etc/php5/mods-available/
32+
INI_DIR = $(shell php-config --ini-dir)
3333

3434

3535
#

Examples/Exceptions/ExceptionCatch/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ CPP = g++
22
RM = rm -f
33
CPP_FLAGS = -Wall -c -I. -O2 -std=c++11
44

5-
PREFIX = /usr
6-
#Edit these lines to correspond with your own directories
5+
PHP_CONFIG = $(shell which php-config)
76
LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir)
8-
PHP_CONFIG_DIR = /etc/php5/cli/conf.d
7+
PHP_CONFIG_DIR = $(shell ${PHP_CONFIG} --ini-dir)
98

109
LD = g++
1110
LD_FLAGS = -Wall -shared -O2
@@ -28,5 +27,9 @@ ${OBJECTS}:
2827
${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
2928

3029
install:
31-
cp -f ${RESULT} ${LIBRARY_DIR}
32-
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}
30+
cp -f ${RESULT} ${LIBRARY_DIR}/
31+
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}/
32+
33+
uninstall:
34+
rm ${LIBRARY_DIR}/${RESULT}
35+
rm ${PHP_CONFIG_DIR}/${PHPINIFILE}

Examples/Exceptions/ExceptionThrow/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ CPP = g++
22
RM = rm -f
33
CPP_FLAGS = -Wall -c -I. -O2 -std=c++11
44

5-
PREFIX = /usr
6-
#Edit these lines to correspond with your own directories
5+
PHP_CONFIG = $(shell which php-config)
76
LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir)
8-
PHP_CONFIG_DIR = /etc/php5/cli/conf.d
7+
PHP_CONFIG_DIR = $(shell ${PHP_CONFIG} --ini-dir)
98

109
LD = g++
1110
LD_FLAGS = -Wall -shared -O2
@@ -28,5 +27,9 @@ ${OBJECTS}:
2827
${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
2928

3029
install:
31-
cp -f ${RESULT} ${LIBRARY_DIR}
32-
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}
30+
cp -f ${RESULT} ${LIBRARY_DIR}/
31+
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}/
32+
33+
uninstall:
34+
rm ${LIBRARY_DIR}/${RESULT}
35+
rm ${PHP_CONFIG_DIR}/${PHPINIFILE}

Examples/Extension/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ CPP = g++
22
RM = rm -f
33
CPP_FLAGS = -Wall -c -I. -O2 -std=c++11
44

5-
PREFIX = /usr
6-
#Edit these lines to correspond with your own directories
5+
PHP_CONFIG = $(shell which php-config)
76
LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir)
8-
PHP_CONFIG_DIR = /etc/php5/cli/conf.d
7+
PHP_CONFIG_DIR = $(shell ${PHP_CONFIG} --ini-dir)
98

109
LD = g++
1110
LD_FLAGS = -Wall -shared -O2
@@ -28,5 +27,9 @@ ${OBJECTS}:
2827
${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
2928

3029
install:
31-
cp -f ${RESULT} ${LIBRARY_DIR}
32-
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}
30+
cp -f ${RESULT} ${LIBRARY_DIR}/
31+
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}/
32+
33+
uninstall:
34+
rm ${LIBRARY_DIR}/${RESULT}
35+
rm ${PHP_CONFIG_DIR}/${PHPINIFILE}

Examples/FunctionNoParameters/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ CPP = g++
22
RM = rm -f
33
CPP_FLAGS = -Wall -c -I. -O2 -std=c++11
44

5-
PREFIX = /usr
6-
#Edit these lines to correspond with your own directories
5+
PHP_CONFIG = $(shell which php-config)
76
LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir)
8-
PHP_CONFIG_DIR = /etc/php5/cli/conf.d
7+
PHP_CONFIG_DIR = $(shell ${PHP_CONFIG} --ini-dir)
98

109
LD = g++
1110
LD_FLAGS = -Wall -shared -O2
@@ -28,5 +27,9 @@ ${OBJECTS}:
2827
${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
2928

3029
install:
31-
cp -f ${RESULT} ${LIBRARY_DIR}
32-
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}
30+
cp -f ${RESULT} ${LIBRARY_DIR}/
31+
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}/
32+
33+
uninstall:
34+
rm ${LIBRARY_DIR}/${RESULT}
35+
rm ${PHP_CONFIG_DIR}/${PHPINIFILE}

Examples/FunctionReturnValue/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ CPP = g++
22
RM = rm -f
33
CPP_FLAGS = -Wall -c -I. -O2 -std=c++11
44

5-
PREFIX = /usr
6-
#Edit these lines to correspond with your own directories
5+
PHP_CONFIG = $(shell which php-config)
76
LIBRARY_DIR = $(shell ${PHP_CONFIG} --extension-dir)
8-
PHP_CONFIG_DIR = /etc/php5/cli/conf.d
7+
PHP_CONFIG_DIR = $(shell ${PHP_CONFIG} --ini-dir)
98

109
LD = g++
1110
LD_FLAGS = -Wall -shared -O2
@@ -28,5 +27,9 @@ ${OBJECTS}:
2827
${CPP} ${CPP_FLAGS} -fpic -o $@ ${@:%.o=%.cpp}
2928

3029
install:
31-
cp -f ${RESULT} ${LIBRARY_DIR}
32-
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}
30+
cp -f ${RESULT} ${LIBRARY_DIR}/
31+
cp -f ${PHPINIFILE} ${PHP_CONFIG_DIR}/
32+
33+
uninstall:
34+
rm ${LIBRARY_DIR}/${RESULT}
35+
rm ${PHP_CONFIG_DIR}/${PHPINIFILE}

0 commit comments

Comments
 (0)