-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (43 loc) · 1.56 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
## QT SPECIFIC
QTDEFS = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
QTINCLUDES = -I/usr/local/include/qt/ \
-I/usr/local/include/qt/mkspecs/unsupported/macx-clang-libc++ \
-I/usr/local/lib/qt/QtCore.framework/Versions/5/Headers \
-I/usr/local/lib/qt/QtGui.framework/Versions/5/Headers \
-I/usr/local/lib/qt/QtWidgets.framework/Versions/5/Headers \
-I/usr/local/include/qt \
-I.
QTLDFLAGS = -L/usr/local/lib/qt \
-framework QtGui \
-framework QtCore \
-framework QtWidgets \
-L/usr/local/opt/openssl/lib \
-L/usr/local/lib/qt \
-F/usr/local/lib/qt \
-L.
NAME = php-qt-ng
INI_DIR = $(shell php --ini | grep php.ini | cut -d":" -f 2)
EXTENSION_DIR = $(shell php-config --extension-dir)
EXTENSION = ${NAME}.so
INI = ${NAME}.ini
COMPILER = g++
LINKER = g++
COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -o ${QTDEFS} ${QTINCLUDES}
LINKER_FLAGS = -shared
LINKER_DEPENDENCIES = -lphpcpp $(QTLDFLAGS)
RM = rm -f
CP = cp -f
MKDIR = mkdir -p
SOURCES = $(shell find . -name '*.cpp' | sort -k 1nr | cut -f2-)
OBJECTS = $(SOURCES:%.cpp=%.o)
# From here the build instructions start
all: ${OBJECTS} ${EXTENSION}
${EXTENSION}: ${OBJECTS}
${LINKER} ${LINKER_FLAGS} -o $@ ${OBJECTS} ${LINKER_DEPENDENCIES}
${OBJECTS}:
${COMPILER} ${COMPILER_FLAGS} -o $@ ${@:%.o=%.cpp}
install:
${CP} ${EXTENSION} ${EXTENSION_DIR}
${CP} ${INI} ${INI_DIR}
clean:
${RM} ${EXTENSION} ${OBJECTS}