Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

221 lines (184 sloc) 6.453 kB
#
# 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)
Jump to Line
Something went wrong with that request. Please try again.