summaryrefslogtreecommitdiff
path: root/Makefile.in
blob: 9f9bde9f0851f1871912e87a8d7573abad026b7d (plain)
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
# +----------------------------------------------------------------------+
# | 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@

ZEND_DIR = $(srcdir)/libzend
SUBDIRS=libzend ext

CC = @CC@
AR = ar rc
BINNAME = @BINNAME@
INSTALL_IT = @INSTALL_IT@
INCLUDE = -I$(srcdir) -I. -I$(ZEND_DIR)
PROF_CFLAGS =
CFLAGS_SHLIB = @CFLAGS_SHLIB@
LDFLAGS_SHLIB = @LDFLAGS_SHLIB@
LDFLAGS_SHLIB_EXPORT = @LDFLAGS_SHLIB_EXPORT@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @CFLAGS@ $(CFLAGS_SHLIB) $(CPPFLAGS) $(INCLUDE) @DEBUG_CFLAGS@ @STRONGHOLD@ $(PROF_CFLAGS)
LDFLAGS = @LDFLAGS@ $(LDFLAGS_SHLIB) $(LDFLAGS_SHLIB_EXPORT) -L$(ZEND_DIR)
REGCFLAGS = $(CFLAGS)
RANLIB = @RANLIB@
YACC = @YACC@
MAINT = @MAINT@
APXS = @APXS@
APXS_LDFLAGS = @APXS_LDFLAGS@
WARNING_LEVEL = @WARNING_LEVEL@

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
OBJS = main.o internal_functions.o snprintf.o php3_sprintf.o \
       configuration-parser.o configuration-scanner.o request_info.o \
       safe_mode.o fopen-wrappers.o php3_realpath.o alloca.o output.o \
       php_ini.o

FUNCTIONS_SOURCE = functions/adabasd.c functions/apache.c functions/fhttpd.c \
       functions/crypt.c functions/db.c functions/dbase.c \
       functions/dl.c functions/filepro.c \
       functions/head.c functions/imap.c functions/mime.c \
       functions/msql.c functions/mysql.c \
       functions/oracle.c functions/oci8.c functions/pgsql.c \
       functions/post.c functions/solid.c functions/sybase.c \
       functions/sybase-ct.c @BCMATH_SRC@ functions/xml.c \
       functions/unified_odbc.c functions/ldap.c functions/velocis.c \
       functions/zlib.c functions/COM.c functions/ifx.c \
       functions/pdf.c functions/hw.c functions/hg_comm.c functions/dlist.c \
       functions/fdf.c functions/snmp.c functions/interbase.c \
       functions/sysvsem.c functions/sysvshm.c functions/dav.c

FUNCTIONS = $(FUNCTIONS_SOURCE:.c=.o)
PHPLIBS = -L@top_srcdir@/libzend -lzend -L@top_srcdir@/ext -lphpext
LIBS = $(PHPLIBS)  @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @FHTTPD_LIB@ @DBASE_LIB@ @REGEX_LIB@ @DBM_LIB@ @ORACLE_LFLAGS@ @ORACLE_LIBS@ @IODBC_LFLAGS@ @IODBC_LIBS@ @SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@ @MYSQL_LFLAGS@ @MYSQL_LIBS@ @MSQL_LFLAGS@ @MSQL_LIBS@ @ADA_LFLAGS@ @ADA_LIBS@ @SOLID_LIBS@ @EMPRESS_LIBS@ @OPENLINK_LFLAGS@ @OPENLINK_LIBS@ @PGSQL_LFLAGS@ @PGSQL_LIBS@ @LDAP_LFLAGS@ @LDAP_LIBS@ @VELOCIS_LIBS@ @CODBC_LFLAGS@ @CODBC_LIBS@ @IMAP_LIBS@ @ZLIB_LIBS@ @PDFLIB_LIBS@ @FDFLIB_LIBS@ @IFX_LFLAGS@ @IFX_LIBS@ @SNMP_LFLAGS@ @SNMP_LIBS@ @IBASE_LFLAGS@ @IBASE_LIBS@ @XML_LIBS@ @LIBS@

all: $(BINNAME)

all-recursive clean-recursive distclean-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"

# CGI binary or fhttpd module
php: all-recursive $(OBJS) $(FUNCTIONS) @REGEX_LIB@ @FHTTPD_LIB@ @DBASE_LIB@
	$(CC) $(CFLAGS) -o $(BINNAME) $(LDFLAGS) $(OBJS) $(FUNCTIONS) $(LIBS)

# Apache 1.2 module
libphp3.a: all-recursive $(OBJS) $(FUNCTIONS) @DBASE_LIB@
	$(AR) $(BINNAME) $(OBJS) $(FUNCTIONS) @DBASE_LIB@
	$(RANLIB) $(BINNAME)

# Apache 1.3 static module
libmodphp3.a: all-recursive $(OBJS) $(FUNCTIONS) @DBASE_LIB@
	$(AR) $(BINNAME) $(OBJS) $(FUNCTIONS) @DBASE_LIB@
	$(RANLIB) $(BINNAME)

# Apache 1.3 shared module
libmodphp3-so.a: all-recursive $(OBJS) $(FUNCTIONS) @DBASE_LIB@
	$(AR) libmodphp3-so.a $(OBJS) $(FUNCTIONS) @DBASE_LIB@
	$(RANLIB) libmodphp3-so.a

libphp3.so: mod_php3.c libmodphp3-so.a
	$(APXS) -c -o libphp3.so $(APXS_LDFLAGS) mod_php3.c libmodphp3-so.a

regex/libregex.a:
	(cd regex; $(MAKE) lib)

dbase/libdbf.a:
	(cd dbase; $(MAKE))

functions/ifx.c: functions/ifx.ec
	(if test @INFORMIXDIR@; then esql -e @IFX_ESQL_FLAGS@ functions/ifx.ec; mv ifx.c functions; else touch functions/ifx.c; fi)

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:
	$(CC) $(CFLAGS) -w$(WARNING_LEVEL) -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 libphp3.a libmodphp3.a php *.o
	-rm -f $(FUNCTIONS) functions/ifx.c
	-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*
	(cd dbase; $(MAKE) clean)

distclean: clean distclean-recursive
	-rm -f *-parser.[ch] *-scanner.c *.output
	-rm -f config.status config.cache config.log
	-rm -f Makefile Makefile.depend config.h build-defs.h
	-rm -f libphp3.module stamp-h
	-rm -f regex/*.o regex/*.a regex/*.ih
	-rm -f dbase/*.o dbase/*.a
	-rm -f doc/checkdoc doc/funcparse doc/version.ent
	-rm -f do-conf test/test.log extra/gd/bdf2gdfont
	-rm -f doc/Makefile regex/Makefile dbase/Makefile

bench: $(BINNAME)
	./$(BINNAME) -c. tests/bench.phtml

# can't use a single rule for this because 'test' is a directory
test: regression
regression check: $(BINNAME)
	cd test && ./testall

config.status: configure
	./config.status --recheck

build-defs.h config.h: stamp-h
stamp-h: 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

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: $(BINNAME)
	$(INSTALL_IT)

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 functions/*.c functions/*.h
	rm -f *~ functions/*~

.c.o:
	$(CC) $(CFLAGS) -c $< -o $@
	@bn=`echo $@ | sed -e 's#functions/##'`; test -f $@ || \
	  (test "$@" != "$$bn" && test -f "$$bn" && mv $$bn $@)

functions/number.o: functions/number.c
	$(CC) $(CFLAGS) -w$(WARNING_LEVEL) -c $< -o $@
	@bn=`echo $@ | sed -e 's#functions/##'`; test -f $@ || \
	  (test "$@" != "$$bn" && test -f "$$bn" && mv $$bn $@)

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: