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 if echo " $(DSO_MODULES) "|$(EGREP) " cgi " > /dev/null ; then \
66 if echo " $(DSO_MODULES) "|$(EGREP) " cgid " > /dev/null ; then \
71 for j in $(DSO_MODULES) "^EOL^"; do \
72 if test $$j != "^EOL^"; then \
73 if echo ",$(ENABLED_DSO_MODULES),"|$(EGREP) ",$$j," > /dev/null ; then \
74 loading_disabled=""; \
76 loading_disabled="#"; \
78 if test "$(LOAD_ALL_MODULES)" = "yes"; then \
79 loading_disabled=""; \
81 if test $$j = "cgid" -a "$$have_cgi" = "1"; then \
82 echo "<IfModule !mpm_prefork_module>"; \
83 echo " $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
85 elif test $$j = "cgi" -a "$$have_cgid" = "1"; then \
86 echo "<IfModule mpm_prefork_module>"; \
87 echo " $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
90 echo "$${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
94 sed -e '1,/@@LoadModule@@/d' \
95 -e '/@@LoadModule@@/d' \
96 -e 's#@@ServerRoot@@#$(prefix)#g' \
97 -e 's#@@Port@@#$(PORT)#g' \
98 -e 's#@@SSLPort@@#$(SSLPORT)#g' \
101 ) > $(DESTDIR)$(sysconfdir)/original/$$i; \
102 chmod 0644 $(DESTDIR)$(sysconfdir)/original/$$i; \
104 if [ "$$i" = "httpd.conf" ]; then \
105 file=`echo $$i|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
107 if test ! -f $(DESTDIR)$(sysconfdir)/$$file; then \
108 $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/original/$$i $(DESTDIR)$(sysconfdir)/$$file; \
113 if test -f "$(builddir)/envvars-std"; then \
114 cp -p envvars-std $(DESTDIR)$(sbindir); \
115 if test ! -f $(DESTDIR)$(sbindir)/envvars; then \
116 cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \
120 # Create a sanitized config_vars.mk
121 build/config_vars.out: build/config_vars.mk
122 @$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out
124 install-build: build/config_vars.out
125 @echo Installing build system files
126 @$(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir)
127 @for f in $(top_srcdir)/build/*.mk build/*.mk; do \
128 $(INSTALL_DATA) $$f $(DESTDIR)$(installbuilddir); \
130 @for f in $(top_builddir)/config.nice \
131 $(top_srcdir)/build/mkdir.sh \
132 $(top_srcdir)/build/instdso.sh; do \
133 $(INSTALL_PROGRAM) $$f $(DESTDIR)$(installbuilddir); \
135 @$(INSTALL_DATA) build/config_vars.out $(DESTDIR)$(installbuilddir)/config_vars.mk
136 @rm build/config_vars.out
138 htdocs-srcdir = $(top_srcdir)/docs/docroot
141 @if test -d $(top_srcdir)/docs/manual/build; then \
142 cd $(top_srcdir)/docs/manual/build && ./build.sh all; \
144 echo 'For details on generating the docs, please read:'; \
145 echo ' http://httpd.apache.org/docs-project/docsformat.html'; \
149 @if test -d $(top_srcdir)/docs/manual/build; then \
150 cd $(top_srcdir)/docs/manual/build && ./build.sh validate-xml; \
152 echo 'For details on generating the docs, please read:'; \
153 echo ' http://httpd.apache.org/docs-project/docsformat.html'; \
157 doxygen $(top_srcdir)/docs/doxygen.conf
160 -@if [ -d $(DESTDIR)$(htdocsdir) ]; then \
161 echo "[PRESERVING EXISTING HTDOCS SUBDIR: $(DESTDIR)$(htdocsdir)]"; \
163 echo Installing HTML documents ; \
164 $(MKINSTALLDIRS) $(DESTDIR)$(htdocsdir) ; \
165 if test -d $(htdocs-srcdir) && test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
166 $(RSYNC) --exclude .svn -rlpt --numeric-ids $(htdocs-srcdir)/ $(DESTDIR)$(htdocsdir)/; \
168 test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(DESTDIR)$(htdocsdir)) ; \
169 cd $(DESTDIR)$(htdocsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
174 -@if [ -d $(DESTDIR)$(errordir) ]; then \
175 echo "[PRESERVING EXISTING ERROR SUBDIR: $(DESTDIR)$(errordir)]"; \
177 echo Installing error documents ; \
178 $(MKINSTALLDIRS) $(DESTDIR)$(errordir) ; \
179 cd $(top_srcdir)/docs/error && cp -rp * $(DESTDIR)$(errordir) ; \
180 test "x$(errordir)" != "x" && cd $(DESTDIR)$(errordir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
184 -@if [ -d $(DESTDIR)$(iconsdir) ]; then \
185 echo "[PRESERVING EXISTING ICONS SUBDIR: $(DESTDIR)$(iconsdir)]"; \
187 echo Installing icons ; \
188 $(MKINSTALLDIRS) $(DESTDIR)$(iconsdir) ; \
189 cd $(top_srcdir)/docs/icons && cp -rp * $(DESTDIR)$(iconsdir) ; \
190 test "x$(iconsdir)" != "x" && cd $(DESTDIR)$(iconsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
194 -@if [ -d $(DESTDIR)$(cgidir) ];then \
195 echo "[PRESERVING EXISTING CGI SUBDIR: $(DESTDIR)$(cgidir)]"; \
197 echo Installing CGIs ; \
198 $(MKINSTALLDIRS) $(DESTDIR)$(cgidir) ; \
199 cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(DESTDIR)$(cgidir) ; \
200 test "x$(cgidir)" != "x" && cd $(DESTDIR)$(cgidir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
204 @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
205 @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir)
206 @for ext in dll x; do \
207 file=apachecore.$$ext; \
208 if test -f $$file; then \
209 cp -p $$file $(DESTDIR)$(libdir); \
213 if test -f $$file; then \
214 cp -p $$file $(DESTDIR)$(bindir); \
219 $(srcdir)/include/*.h \
220 $(srcdir)/os/$(OS_DIR)/os.h \
221 $(srcdir)/modules/arch/unix/mod_unixd.h \
222 $(srcdir)/modules/core/mod_so.h \
223 $(srcdir)/modules/core/mod_watchdog.h \
224 $(srcdir)/modules/cache/mod_cache.h \
225 $(srcdir)/modules/cache/cache_common.h \
226 $(srcdir)/modules/database/mod_dbd.h \
227 $(srcdir)/modules/dav/main/mod_dav.h \
228 $(srcdir)/modules/filters/mod_include.h \
229 $(srcdir)/modules/filters/mod_xml2enc.h \
230 $(srcdir)/modules/generators/mod_cgi.h \
231 $(srcdir)/modules/generators/mod_status.h \
232 $(srcdir)/modules/loggers/mod_log_config.h \
233 $(srcdir)/modules/mappers/mod_rewrite.h \
234 $(srcdir)/modules/proxy/mod_proxy.h \
235 $(srcdir)/modules/session/mod_session.h \
236 $(srcdir)/modules/ssl/mod_ssl.h \
237 $(srcdir)/modules/ssl/mod_ssl_openssl.h \
238 $(srcdir)/os/$(OS_DIR)/*.h
241 @echo Installing header files
242 @$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
243 @for hdr in $(INSTALL_HEADERS); do \
244 $(INSTALL_DATA) $$hdr $(DESTDIR)$(includedir); \
248 @echo Installing man pages and online manual
249 @test -d $(DESTDIR)$(mandir) || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)
250 @test -d $(DESTDIR)$(mandir)/man1 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1
251 @test -d $(DESTDIR)$(mandir)/man8 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man8
252 @test -d $(DESTDIR)$(manualdir) || $(MKINSTALLDIRS) $(DESTDIR)$(manualdir)
253 @cp -p $(top_srcdir)/docs/man/*.1 $(DESTDIR)$(mandir)/man1
254 @cp -p $(top_srcdir)/docs/man/*.8 $(DESTDIR)$(mandir)/man8
255 @if test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
256 $(RSYNC) --exclude .svn -rlpt --numeric-ids $(top_srcdir)/docs/manual/ $(DESTDIR)$(manualdir)/; \
258 cd $(top_srcdir)/docs/manual && cp -rp * $(DESTDIR)$(manualdir); \
259 cd $(DESTDIR)$(manualdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
263 @if test -f $(builddir)/support/suexec; then \
264 test -d $(DESTDIR)$(sbindir) || $(MKINSTALLDIRS) $(DESTDIR)$(sbindir); \
265 $(INSTALL_PROGRAM) $(top_builddir)/support/suexec $(DESTDIR)$(sbindir); \
266 chmod 4755 $(DESTDIR)$(sbindir)/suexec; \
270 cd support && $(MAKE) suexec
273 @rm -rf autom4te.cache
275 # XXX: This looks awfully platform-specific [read: bad form and style]
276 include $(top_srcdir)/os/os2/core.mk