-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile.in
220 lines (184 loc) · 6.3 KB
/
Makefile.in
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#
# Roadsend PHP Compiler
#
# First, make sure you have a Makefile.config in place. This should be a symlink to
# one of the Makefile.<platform> files.
#
# important targets:
#
# all - full optimized production build
# debug - debug build (with bigloo safe and C debugging flags)
# profile - a debug build with bglprof/gprof flags enabled
#
# all-run - build support libraries, runtime, extensions, web backends and compiler
# (this shouldn't be called directly, use all/debug/profile)
# install - install libraries and binaries
# clean - clean entire devel tree
#
# runtime - build the runtime libraries (including extensions)
# web-backends build web backends (microserver, fastcgi)
# tags - generate tags files for extensions
#
# dotest - build "dotest" regression testing program
# test - run the stand alone test suite
# check - run main test suite, using dotest program (compares against Zend PHP)
# check-all - run main test suite, and all extension test suites
#
#
PCC_ROOT = .
include bigloo-rules.mk
PWD = `pwd`
BIGLOO = bigloo
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
sysconfdir = @sysconfdir@
ifeq ($(PCC_OS),PCC_MINGW)
DESTDIR_prefix = $(DESTDIR)$(prefix)
DESTDIR_exec_prefix = $(DESTDIR)$(exec_prefix)
DESTDIR_bindir = $(DESTDIR)$(bindir)
DESTDIR_libdir = $(DESTDIR)$(libdir)
DESTDIR_sysconfdir = $(DESTDIR)$(sysconfdir)
else
DESTDIR_prefix = $(DESTDIR)/$(prefix)
DESTDIR_exec_prefix = $(DESTDIR)/$(exec_prefix)
DESTDIR_bindir = $(DESTDIR)/$(bindir)
DESTDIR_libdir = $(DESTDIR)/$(libdir)
DESTDIR_sysconfdir = $(DESTDIR)/$(sysconfdir)
endif
all: unsafe
all-run: Makefile.config doc/pcc.conf libs tools runtime webconnect \
compiler extensions php-extensions web-backends debugger dotest
debug: safe
safe:
UNSAFE=f $(MAKE) all-run
unsafe:
UNSAFE=t $(MAKE) all-run
profile:
PROFILE=t $(MAKE) debug
Makefile.config:
touch $(PCC_ROOT)/Makefile.config
tags: unsafe
export UNSAFE
cd runtime && $(MAKE) tags
#setup parts of configuration file not known until compile time
doc/pcc.conf: doc/pcc.conf.var Makefile.config
STD_LIBS="${STD_LIBS}" \
MYSQL_LIBS="${MYSQL_LIBS}" \
ODBC_LIBS="${ODBC_LIBS}" \
SQLITE_LIBS="${SQLITE_LIBS}" \
CURL_LIBS="${CURL_LIBS}" \
XML_LIBS="${XML_LIBS}" \
FCGI_LIBS="${FCGI_LIBS}" \
GTK_LIBS="${GTK_LIBS}" \
envsubst < doc/pcc.conf.var > doc/pcc.conf
#runtime
runtime:
export UNSAFE
(cd runtime && $(MAKE) runtime-libs)
.PHONY: runtime
#extensions
extensions:
export UNSAFE
(cd runtime && $(MAKE) extensions)
#php-extensions
php-extensions:
export UNSAFE
(cd runtime && $(MAKE) php-extensions)
#compiler
compiler: webconnect
export UNSAFE
(cd compiler && $(MAKE) all-run)
.PHONY: compiler
#debugger
debugger: web-backends
export UNSAFE
(cd compiler && $(MAKE) debugger)
.PHONY: debugger
#webconnect
webconnect:
export UNSAFE
(cd webconnect && $(MAKE) all-run)
.PHONY: webconnect
#web backends
web-backends: webconnect compiler runtime
export UNSAFE
(cd webconnect && $(MAKE) web-backends)
#tools: profiler, readline
tools:
export UNSAFE
(cd tools && $(MAKE) all-run)
.PHONY: tools
libs:
-mkdir libs
clean:
-rm -rf testoutput
-rm -f *.c *.o *.so libs/*.so libs/*.dylib libs/*.heap libs/*.a libs/*.dll libs/*.init libs/*.sch libs/*.h
(cd runtime && $(MAKE) clean && UNSAFE=t $(MAKE) clean)
(cd tools && $(MAKE) clean && UNSAFE=t $(MAKE) clean)
(cd compiler && $(MAKE) clean && UNSAFE=t $(MAKE) clean)
(cd webconnect && $(MAKE) clean && UNSAFE=t $(MAKE) clean)
(cd bugs && $(MAKE) clean && UNSAFE=t $(MAKE) clean)
(cd sa-tests && $(MAKE) clean)
# (cd doc && $(MAKE) clean && UNSAFE=t $(MAKE) clean)
clean-all: Makefile.config clean
-rm config.log config.status Makefile.config
dotest: dotest.scm
sed "s:@PCC_HOME@:${PWD}:" dotest.scm > temp.dotest.scm
$(BIGLOO) -srfi $(PCC_OS) -copt -D$(PCC_OS) temp.dotest.scm -o dotest $(DOTEST_LIBS)
# rm temp.dotest.scm
test:
-(cd sa-tests && $(MAKE) clean)
(cd sa-tests && $(MAKE))
check: dotest #all
-rm -rf testoutput
-mkdir testoutput
./dotest tests/ testoutput/
check-all: all check
(cd runtime/ext && $(MAKE) check)
docs:
(cd doc && $(MAKE))
install:
#jfcouic 2008-11-05 : replace .so by $(SOEXT) and $(DESTDIR_dir) by $(DESTDIR)($dir)
#config
install -m 755 -d $(DESTDIR_sysconfdir)
install -m 644 -b ./doc/pcc.conf $(DESTDIR_sysconfdir)/pcc.conf
#binaries
install -m 755 -d $(DESTDIR_bindir)
install -m 755 ./compiler/pcc $(DESTDIR_bindir)/pcc
install -m 755 ./compiler/pdb $(DESTDIR_bindir)/pdb
install -m 755 ./compiler/pcctags $(DESTDIR_bindir)/pcctags
-install -m 755 ./webconnect/fastcgi/pcc.fcgi $(DESTDIR_bindir)/pcc.fcgi
#libraries
install -m 755 -d $(DESTDIR_libdir)
install -m 644 ./libs/libwebserver.$(SOEXT) $(DESTDIR_libdir)
install -m 644 ./libs/libwebserver.a $(DESTDIR_libdir)
install -m 644 ./libs/*_[su]*.$(SOEXT) $(DESTDIR_libdir)
install -m 644 ./libs/*_[su]*.a $(DESTDIR_libdir)
install -m 644 ./libs/*.sch $(DESTDIR_libdir)
install -m 644 ./libs/*.h $(DESTDIR_libdir)
install -m 644 ./libs/*.heap $(DESTDIR_libdir)
-install -m 644 ./libs/*.init $(DESTDIR_libdir)
uninstall:
#libraries
for file in ./libs/*.init; do if [ -e $(DESTDIR_libdir)/$${file##*/} ]; then rm $(DESTDIR_libdir)/$${file##*/}; fi; done
for file in ./libs/*.heap; do if [ -e $(DESTDIR_libdir)/$${file##*/} ]; then rm $(DESTDIR_libdir)/$${file##*/}; fi; done
for file in ./libs/*.h; do if [ -e $(DESTDIR_libdir)/$${file##*/} ]; then rm $(DESTDIR_libdir)/$${file##*/}; fi; done
for file in ./libs/*.sch; do if [ -e $(DESTDIR_libdir)/$${file##*/} ]; then rm $(DESTDIR_libdir)/$${file##*/}; fi; done
for file in ./libs/*_[su]*.a; do if [ -e $(DESTDIR_libdir)/$${file##*/} ]; then rm $(DESTDIR_libdir)/$${file##*/}; fi; done
for file in ./libs/*_[su]*.$(SOEXT); do if [ -e $(DESTDIR_libdir)/$${file##*/} ]; then rm $(DESTDIR_libdir)/$${file##*/}; fi; done
-rm $(DESTDIR_libdir)/libwebserver.a;
-rm $(DESTDIR_libdir)/libwebserver.$(SOEXT);
#binaries
-rm $(DESTDIR_bindir)/pcc.fcgi
-rm $(DESTDIR_bindir)/pcctags$(WEXE)
-rm $(DESTDIR_bindir)/pdb$(WEXE)
-rm $(DESTDIR_bindir)/pcc$(WEXE)
#config
-rm $(DESTDIR_sysconfdir)/pcc.conf
# used by the self installing package maker
package-install: unsafe
./install.sh $(INSTALL_ROOT) $(INSTALL_PREFIX)
package-install-runtime: unsafe
./install-runtime.sh $(INSTALL_ROOT) $(INSTALL_PREFIX)