mirror of
https://github.com/php/php-src.git
synced 2026-04-28 18:53:33 +02:00
2a854ca8b9
implementation now has its own directory under sapi/, just like extensions have theirs under ext/. To make the final targets appear in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc from the selected sapi backend. This is a plan Makefile stub without any autoconf substitutions. Each SAPI backend also has its own config.m4 like extensions (read at the end of diversion 2) and config.h.stub files. Each SAPI backend has to contain: config.m4: just like for extensions, this file contains autoconf/automake directives that end up in the configure script. The only difference is that the sapi config.m4 files are read in diversion (output block) 2 instead of 3. The sapi config.m4 files should set two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET (the name of the resulting library or program, previously BINNAME). If they are not specified, they will default to "cgi" and "php", respectively. Makefile.inc: has to exist, has to define "INSTALL_IT" to the command used to install the final target (or ":" for no operation). It also has to define a plain Makefile rule (without autoconf substitutions) to build $(SAPI_TARGET) Makefile.am: just what you think. Make sure your target is called "libphpsapi_NNN.a", where NNN is the value of PHP_SAPI. Some testing and fixing probably remains. To make everything hang together, I've done some ugly tricks that I can imagine causing some problems. I've built and run the CGI version and built the Apache DSO.
221 lines
7.3 KiB
Makefile
221 lines
7.3 KiB
Makefile
# +----------------------------------------------------------------------+
|
|
# | PHP HTML Embedded Scripting Language Version 4.0 |
|
|
# +----------------------------------------------------------------------+
|
|
# | Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
|
|
# +----------------------------------------------------------------------+
|
|
# | This program is free software; you can redistribute it and/or modify |
|
|
# | it under the terms of one of the following licenses: |
|
|
# | |
|
|
# | A) the GNU General Public License as published by the Free Software |
|
|
# | Foundation; either version 2 of the License, or (at your option) |
|
|
# | any later version. |
|
|
# | |
|
|
# | B) the PHP License as published by the PHP Development Team and |
|
|
# | included in the distribution in the file: LICENSE |
|
|
# | |
|
|
# | This program is distributed in the hope that it will be useful, |
|
|
# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
# | GNU General Public License for more details. |
|
|
# | |
|
|
# | You should have received a copy of both licenses referred to here. |
|
|
# | If you did not, or have any questions about PHP licensing, please |
|
|
# | contact core@php.net. |
|
|
# +----------------------------------------------------------------------+
|
|
|
|
#
|
|
# $Id$
|
|
#
|
|
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
srcdir = @srcdir@
|
|
VPATH = @srcdir@
|
|
bindir = @bindir@
|
|
|
|
top_builddir = .
|
|
|
|
ZEND_DIR = $(srcdir)/libzend
|
|
TSRM_DIR = @TSRM_DIR@
|
|
SUBDIRS=libzend ext $(TSRM_DIR) sapi
|
|
|
|
PACKAGE = @PACKAGE@
|
|
VERSION = @VERSION@
|
|
LN_S = @LN_S@
|
|
CC = @CC@
|
|
AR = ar rc
|
|
PHP_SAPI = @PHP_SAPI@
|
|
SAPI_TARGET = @SAPI_TARGET@
|
|
INSTALL_IT = @INSTALL_IT@
|
|
EXTRA_LIBS = @EXTRA_LIBS@
|
|
EXT_LIBS = @EXT_LIBS@
|
|
INCLUDES = @INCLUDES@
|
|
INCLUDE = -I$(srcdir) -I. -I$(ZEND_DIR) -I$(srcdir)/TSRM $(INCLUDES)
|
|
PROF_CFLAGS =
|
|
CFLAGS_SHLIB = @CFLAGS_SHLIB@
|
|
LDFLAGS_SHLIB = @LDFLAGS_SHLIB@
|
|
LDFLAGS_SHLIB_EXPORT = @LDFLAGS_SHLIB_EXPORT@
|
|
CPPFLAGS = @CPPFLAGS@
|
|
DEFS = @DEFS@
|
|
VERSION_SCRIPT = @VERSION_SCRIPT@
|
|
RPATHS = @RPATHS@
|
|
CFLAGS = @CFLAGS@ @DEBUG_CFLAGS@ $(PROF_CFLAGS)
|
|
COMPILE = $(CC) $(CFLAGS) $(CFLAGS_SHLIB) $(CPPFLAGS) $(INCLUDE) $(DEFS) @STRONGHOLD@
|
|
LDFLAGS = $(VERSION_SCRIPT) $(RPATHS) @LDFLAGS@ $(LDFLAGS_SHLIB) $(LDFLAGS_SHLIB_EXPORT) -L$(ZEND_DIR)
|
|
REGCFLAGS = $(CFLAGS)
|
|
RANLIB = @RANLIB@
|
|
YACC = @YACC@
|
|
MAINT = @MAINT@
|
|
APXS = @APXS@
|
|
APXS_LDFLAGS = $(EXTRA_LIBS) $(LIBS)
|
|
APXS_EXP = @APXS_EXP@
|
|
WARNING_LEVEL = @WARNING_LEVEL@
|
|
LEX_CFLAGS = -w$(WARNING_LEVEL) @LEX_CFLAGS@
|
|
EXT_SHARED = @EXT_SHARED@
|
|
LIBOBJS=@LIBOBJS@
|
|
REGEX_LIB=@REGEX_LIB@
|
|
FHTTPD_LIB=@FHTTPD_LIB@
|
|
TSRM_LIB=@TSRM_LIB@
|
|
|
|
SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
|
|
configuration-parser.c configuration-scanner.c request_info.c \
|
|
safe_mode.c fopen-wrappers.c php3_realpath.c alloca.c output.c \
|
|
php_ini.c SAPI.c rfc1867.c dlist.c php_content_types.c
|
|
|
|
OBJS = $(SOURCE:.c=.o) $(LIBOBJS)
|
|
PHPLIBS = -Llibzend -lzend -Lext -lphpext
|
|
LIBS = $(PHPLIBS) $(EXTRA_LIBS) @LIBS@
|
|
|
|
all: $(SAPI_TARGET)
|
|
|
|
all-recursive clean-recursive distclean-recursive \
|
|
maintainer-clean-depend-recursive:
|
|
@set fnord $(MAKEFLAGS); amf=$$2; \
|
|
for subdir in $(SUBDIRS); do \
|
|
target=`echo $@ | sed s/-recursive//`; \
|
|
echo "Making $$target in $$subdir"; \
|
|
(cd $$subdir && $(MAKE) $$target) || fail=yes; \
|
|
done && test -z "$$fail"
|
|
|
|
include sapi/$(PHP_SAPI)/Makefile.inc
|
|
|
|
regex/libregex.a:
|
|
(cd regex; $(MAKE) lib)
|
|
|
|
configuration-parser.h configuration-parser.c: $(srcdir)/configuration-parser.y
|
|
bison -p cfg -v -d $(srcdir)/configuration-parser.y -o configuration-parser.c
|
|
|
|
configuration-scanner.o: configuration-scanner.c
|
|
$(COMPILE) $(LEX_CFLAGS) -c configuration-scanner.c
|
|
|
|
configuration-scanner.c: $(srcdir)/configuration-scanner.l
|
|
flex -Pcfg -oconfiguration-scanner.c -i $(srcdir)/configuration-scanner.l
|
|
|
|
clean: clean-recursive
|
|
-rm -f libphp4.a libmodphp4.a libphp4.so php *.o
|
|
-rm -f test/php.desc test/php.in test/php.out test/php.test
|
|
-rm -f test/a.tmp test/b.tmp test/test.dbm*
|
|
|
|
distclean: clean distclean-recursive
|
|
-rm -f *-parser.[ch] *-scanner.c *.output
|
|
-rm -f config.status config.cache config.log
|
|
-rm -f Makefile Makefile.depend php_config.h build-defs.h
|
|
-rm -f libphp4.module stamp-h buildconf.stamp
|
|
-rm -f regex/*.o regex/*.a regex/*.ih
|
|
-rm -f doc/checkdoc doc/funcparse doc/version.ent
|
|
-rm -f do-conf test/test.log
|
|
-rm -f doc/Makefile regex/Makefile
|
|
|
|
distdir = $(PACKAGE)-$(VERSION)
|
|
top_distdir = $(distdir)
|
|
|
|
dist: distdir
|
|
-chmod -R a+r $(distdir)
|
|
tar chozf $(distdir).tar.gz $(distdir)
|
|
-rm -rf $(distdir)
|
|
|
|
distdir:
|
|
-rm -rf $(distdir)
|
|
files=`echo *` ;\
|
|
mkdir $(distdir) ;\
|
|
for file in $$files ; do \
|
|
d=$(srcdir); \
|
|
if test -d $$d/$$file ; then \
|
|
cp -pr $$d/$$file $(distdir)/$$file; \
|
|
else \
|
|
test -f $(distdir)/$$file \
|
|
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
|
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
|
fi; \
|
|
done
|
|
(cd $(distdir) ; $(MAKE) distclean)
|
|
cd $(distdir)/libzend ;\
|
|
flex -Pzend -ozend-scanner.c -i zend-scanner.l ;\
|
|
bison -p zend -v -d zend-parser.y -o zend-parser.c
|
|
cd $(distdir) ;\
|
|
flex -Pcfg -oconfiguration-scanner.c -i configuration-scanner.l ;\
|
|
bison -p cfg -v -d configuration-parser.y -o configuration-parser.c
|
|
find $(distdir) -name CVS -o -name .cvsignore | xargs rm -rf
|
|
|
|
maintainer-clean-depend: maintainer-clean-depend-recursive
|
|
|
|
bench: php
|
|
./php -c. tests/bench.phtml
|
|
|
|
# can't use a single rule for this because 'test' is a directory
|
|
test: regression
|
|
regression check: php
|
|
cd test && ./testall
|
|
|
|
config.status: configure
|
|
./config.status --recheck
|
|
|
|
build-defs.h php_config.h: stamp-h
|
|
stamp-h: php_config.h.in config.status
|
|
CONFIG_FILES='build-defs.h stamp-h' ./config.status
|
|
|
|
Makefile: Makefile.in config.status
|
|
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
|
|
|
|
#
|
|
# You must use '--enable-maintainer-mode' with configure to enable
|
|
# these rules, which requires autoconf be installed.
|
|
#
|
|
configure: @MAINT@ configure.in aclocal.m4
|
|
cd $(srcdir) && autoconf
|
|
|
|
php_config.h.in: @MAINT@ stamp-h.in
|
|
stamp-h.in: configure.in aclocal.m4 acconfig.h
|
|
cd ${srcdir} && autoheader && touch ${srcdir}/stamp-h.in
|
|
|
|
install: install-recursive $(SAPI_TARGET)
|
|
$(INSTALL_IT)
|
|
|
|
install-recursive:
|
|
if test "$(EXT_SHARED)" != ""; then \
|
|
for dir in X $(EXT_SHARED); do \
|
|
test -d ext/$$dir && (cd ext/$$dir; $(MAKE) install); \
|
|
done; \
|
|
fi
|
|
|
|
indent: clean
|
|
indent -v -kr -cli4 -ts4 \
|
|
-T pval -T HashTable -T Bucket -T Token -T TokenCache -T TokenCacheManager \
|
|
-T switch_expr -T internal_function -T control_structure_data \
|
|
-T MemoryHashTable -T MemoryBucket \
|
|
-T pvalue_value -T Stack *.c *.h
|
|
rm -f *~
|
|
|
|
.c.o:
|
|
$(COMPILE) -c $<
|
|
|
|
parser-scanner: configuration-parser.c configuration-scanner.c
|
|
|
|
depend: parser-scanner
|
|
$(CC) $(CFLAGS) -MM $(SOURCE) | perl -pe 's|regex/regex.h||;' > Makefile.depend
|
|
$(CC) $(CFLAGS) -MM $(FUNCTIONS_SOURCE) | perl -pe 's|^(.+\.o)|functions/$$1|; s|regex/regex.h||;' >> Makefile.depend
|
|
|
|
# Local Variables:
|
|
# tab-width: 4
|
|
# End:
|