2 SUBDIRS = srclib os server modules support
5 PROGRAM_NAME = $(progname)
6 PROGRAM_SOURCES = modules.c
7 PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
8 PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
9 PROGRAM_DEPENDENCIES = \
15 sbin_PROGRAMS = $(PROGRAM_NAME)
16 TARGETS = $(sbin_PROGRAMS) $(shared_build) $(other_targets)
17 INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
18 install-other install-cgi install-include install-suexec install-build \
21 DISTCLEAN_TARGETS = include/ap_config_auto.h include/ap_config_layout.h \
22 include/apache_probes.h \
23 modules.c config.cache config.log config.status build/config_vars.mk \
24 build/rules.mk docs/conf/httpd.conf docs/conf/extra/*.conf shlibtool \
25 build/pkg/pkginfo build/config_vars.sh
26 EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists \
29 include $(top_builddir)/build/rules.mk
30 include $(top_srcdir)/build/program.mk
33 @echo Installing configuration files
34 @$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(sysconfdir)/extra
35 @$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir)/original/extra
36 @cd $(top_srcdir)/docs/conf; \
37 for i in mime.types magic; do \
38 if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
39 $(INSTALL_DATA) $$i $(DESTDIR)$(sysconfdir); \
42 for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
44 for i in httpd.conf extra/*.conf; do \
45 if [ -f $$i ] ; then \
47 n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
48 if test $$n_lm -eq 0 -o "x$(DSO_MODULES)" = "x"; then \
49 sed -e 's#@@ServerRoot@@#$(prefix)#g' \
50 -e 's#@@Port@@#$(PORT)#g' \
51 -e 's#@@SSLPort@@#$(SSLPORT)#g' \
52 -e '/@@LoadModule@@/d' \
55 sed -n -e '/@@LoadModule@@/q' \
56 -e 's#@@ServerRoot@@#$(prefix)#g' \
57 -e 's#@@Port@@#$(PORT)#g' \
58 -e 's#@@SSLPort@@#$(SSLPORT)#g' \
61 for j in $(DSO_MODULES) "^EOL^"; do \
62 if test $$j != "^EOL^"; then \
63 if echo ",$(ENABLED_DSO_MODULES),"|$(EGREP) ",$$j," > /dev/null ; then \
64 loading_disabled=""; \
66 loading_disabled="#"; \
68 if test "$(LOAD_ALL_MODULES)" = "yes"; then \
69 loading_disabled=""; \
71 echo "$${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
74 sed -e '1,/@@LoadModule@@/d' \
75 -e '/@@LoadModule@@/d' \
76 -e 's#@@ServerRoot@@#$(prefix)#g' \
77 -e 's#@@Port@@#$(PORT)#g' \
78 -e 's#@@SSLPort@@#$(SSLPORT)#g' \
81 ) > $(DESTDIR)$(sysconfdir)/original/$$i; \
82 chmod 0644 $(DESTDIR)$(sysconfdir)/original/$$i; \
84 if [ "$$i" = "httpd.conf" ]; then \
85 file=`echo $$i|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
87 if test ! -f $(DESTDIR)$(sysconfdir)/$$file; then \
88 $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/original/$$i $(DESTDIR)$(sysconfdir)/$$file; \
93 if test -f "$(builddir)/envvars-std"; then \
94 cp -p envvars-std $(DESTDIR)$(sbindir); \
95 if test ! -f $(DESTDIR)$(sbindir)/envvars; then \
96 cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \
100 # Create a sanitized config_vars.mk
101 build/config_vars.out: build/config_vars.mk
102 @$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out
104 install-build: build/config_vars.out
105 @echo Installing build system files
106 @$(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir)
107 @$(INSTALL_DATA) $(top_srcdir)/build/*.mk build/*.mk \
108 $(DESTDIR)$(installbuilddir)
109 @$(INSTALL_PROGRAM) $(top_builddir)/config.nice \
110 $(top_srcdir)/build/mkdir.sh \
111 $(top_srcdir)/build/instdso.sh \
112 $(DESTDIR)$(installbuilddir)
113 @$(INSTALL_DATA) build/config_vars.out $(DESTDIR)$(installbuilddir)/config_vars.mk
114 @rm build/config_vars.out
116 htdocs-srcdir = $(top_srcdir)/docs/docroot
119 @if test -d $(top_srcdir)/docs/manual/build; then \
120 cd $(top_srcdir)/docs/manual/build && ./build.sh all; \
122 echo 'For details on generating the docs, please read:'; \
123 echo ' http://httpd.apache.org/docs-project/docsformat.html'; \
127 @if test -d $(top_srcdir)/docs/manual/build; then \
128 cd $(top_srcdir)/docs/manual/build && ./build.sh validate-xml; \
130 echo 'For details on generating the docs, please read:'; \
131 echo ' http://httpd.apache.org/docs-project/docsformat.html'; \
135 doxygen $(top_srcdir)/docs/doxygen.conf
138 -@if [ -d $(DESTDIR)$(htdocsdir) ]; then \
139 echo "[PRESERVING EXISTING HTDOCS SUBDIR: $(DESTDIR)$(htdocsdir)]"; \
141 echo Installing HTML documents ; \
142 $(MKINSTALLDIRS) $(DESTDIR)$(htdocsdir) ; \
143 if test -d $(htdocs-srcdir) && test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
144 $(RSYNC) --exclude .svn -rlpt --numeric-ids $(htdocs-srcdir)/ $(DESTDIR)$(htdocsdir)/; \
146 test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(DESTDIR)$(htdocsdir)) ; \
147 cd $(DESTDIR)$(htdocsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
152 -@if [ -d $(DESTDIR)$(errordir) ]; then \
153 echo "[PRESERVING EXISTING ERROR SUBDIR: $(DESTDIR)$(errordir)]"; \
155 echo Installing error documents ; \
156 $(MKINSTALLDIRS) $(DESTDIR)$(errordir) ; \
157 cd $(top_srcdir)/docs/error && cp -rp * $(DESTDIR)$(errordir) ; \
158 test "x$(errordir)" != "x" && cd $(DESTDIR)$(errordir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
162 -@if [ -d $(DESTDIR)$(iconsdir) ]; then \
163 echo "[PRESERVING EXISTING ICONS SUBDIR: $(DESTDIR)$(iconsdir)]"; \
165 echo Installing icons ; \
166 $(MKINSTALLDIRS) $(DESTDIR)$(iconsdir) ; \
167 cd $(top_srcdir)/docs/icons && cp -rp * $(DESTDIR)$(iconsdir) ; \
168 test "x$(iconsdir)" != "x" && cd $(DESTDIR)$(iconsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
172 -@if [ -d $(DESTDIR)$(cgidir) ];then \
173 echo "[PRESERVING EXISTING CGI SUBDIR: $(DESTDIR)$(cgidir)]"; \
175 echo Installing CGIs ; \
176 $(MKINSTALLDIRS) $(DESTDIR)$(cgidir) ; \
177 cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(DESTDIR)$(cgidir) ; \
178 test "x$(cgidir)" != "x" && cd $(DESTDIR)$(cgidir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
182 @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
183 @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir)
184 @for ext in dll x; do \
185 file=apachecore.$$ext; \
186 if test -f $$file; then \
187 cp -p $$file $(DESTDIR)$(libdir); \
191 if test -f $$file; then \
192 cp -p $$file $(DESTDIR)$(bindir); \
197 $(srcdir)/include/*.h \
198 $(srcdir)/os/$(OS_DIR)/os.h \
199 $(srcdir)/modules/arch/unix/mod_unixd.h \
200 $(srcdir)/modules/core/mod_so.h \
201 $(srcdir)/modules/core/mod_watchdog.h \
202 $(srcdir)/modules/cache/mod_cache.h \
203 $(srcdir)/modules/cache/cache_common.h \
204 $(srcdir)/modules/database/mod_dbd.h \
205 $(srcdir)/modules/dav/main/mod_dav.h \
206 $(srcdir)/modules/filters/mod_include.h \
207 $(srcdir)/modules/filters/mod_xml2enc.h \
208 $(srcdir)/modules/generators/mod_cgi.h \
209 $(srcdir)/modules/generators/mod_status.h \
210 $(srcdir)/modules/loggers/mod_log_config.h \
211 $(srcdir)/modules/mappers/mod_rewrite.h \
212 $(srcdir)/modules/proxy/mod_proxy.h \
213 $(srcdir)/modules/proxy/mod_serf.h \
214 $(srcdir)/modules/session/mod_session.h \
215 $(srcdir)/modules/ssl/mod_ssl.h \
216 $(srcdir)/os/$(OS_DIR)/*.h
219 @echo Installing header files
220 @$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
221 @$(INSTALL_DATA) $(INSTALL_HEADERS) $(DESTDIR)$(includedir)
224 @echo Installing man pages and online manual
225 @test -d $(DESTDIR)$(mandir) || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)
226 @test -d $(DESTDIR)$(mandir)/man1 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1
227 @test -d $(DESTDIR)$(mandir)/man8 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man8
228 @test -d $(DESTDIR)$(manualdir) || $(MKINSTALLDIRS) $(DESTDIR)$(manualdir)
229 @cp -p $(top_srcdir)/docs/man/*.1 $(DESTDIR)$(mandir)/man1
230 @cp -p $(top_srcdir)/docs/man/*.8 $(DESTDIR)$(mandir)/man8
231 @if test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
232 $(RSYNC) --exclude .svn -rlpt --numeric-ids $(top_srcdir)/docs/manual/ $(DESTDIR)$(manualdir)/; \
234 cd $(top_srcdir)/docs/manual && cp -rp * $(DESTDIR)$(manualdir); \
235 cd $(DESTDIR)$(manualdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
238 install-suexec: install-suexec-binary install-suexec-$(INSTALL_SUEXEC)
240 install-suexec-binary:
241 @if test -f $(builddir)/support/suexec; then \
242 test -d $(DESTDIR)$(sbindir) || $(MKINSTALLDIRS) $(DESTDIR)$(sbindir); \
243 $(INSTALL_PROGRAM) $(top_builddir)/support/suexec $(DESTDIR)$(sbindir); \
246 install-suexec-setuid:
247 @if test -f $(builddir)/support/suexec; then \
248 chmod 4755 $(DESTDIR)$(sbindir)/suexec; \
252 @if test -f $(builddir)/support/suexec; then \
253 setcap 'cap_setuid,cap_setgid+pe' $(DESTDIR)$(sbindir)/suexec; \
257 cd support && $(MAKE) suexec
260 @rm -rf autom4te.cache
262 update-log-tags update-log-msg-tags:
263 find server modules os -name \*.c|xargs perl \
264 docs/log-message-tags/update-log-msg-tags
266 # XXX: This looks awfully platform-specific [read: bad form and style]
267 include $(top_srcdir)/os/os2/core.mk