upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / Makefile
1 top_srcdir   = /bottlenecks/rubbos/app/httpd-2.0.64
2 top_builddir = /bottlenecks/rubbos/app/httpd-2.0.64
3 srcdir       = /bottlenecks/rubbos/app/httpd-2.0.64
4 builddir     = /bottlenecks/rubbos/app/httpd-2.0.64
5 VPATH        = /bottlenecks/rubbos/app/httpd-2.0.64
6
7 SUBDIRS = srclib os server modules support
8 CLEAN_SUBDIRS = test
9
10 PROGRAM_NAME         = $(progname)
11 PROGRAM_SOURCES      = modules.c
12 PROGRAM_LDADD        = $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
13 PROGRAM_DEPENDENCIES = \
14   $(BUILTIN_LIBS) \
15   $(MPM_LIB) \
16   server/libmain.la \
17   os/$(OS_DIR)/libos.la
18
19 PROGRAMS        = $(PROGRAM_NAME)
20 TARGETS         = $(PROGRAMS) $(shared_build) $(other_targets)
21 PHONY_TARGETS   = $(srcdir)/buildmark.c
22 INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
23         install-other install-cgi install-include install-suexec install-man \
24         install-build
25
26 DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_layout.h \
27         modules.c config.cache config.log config.status build/config_vars.mk \
28         build/rules.mk docs/conf/httpd-std.conf
29 EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists
30
31 include $(top_builddir)/build/rules.mk
32 include $(top_srcdir)/build/program.mk
33
34 install-conf:
35         @echo Installing configuration files ; \
36         if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \
37             $(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir) ; \
38         fi ; \
39         cd $(top_srcdir)/docs/conf; \
40         for i in mime.types magic; do \
41             if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
42                 $(INSTALL_DATA) $$i $(DESTDIR)$(sysconfdir); \
43             fi; \
44         done; \
45         for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
46             cd $$j ; \
47             for i in *-std*.conf; do \
48                 ( \
49                         n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
50                         if test $$n_lm -eq 0 -o "x$(DSO_MODULES)" = "x"; then \
51                                 sed -e 's#@@ServerRoot@@#$(prefix)#g' \
52                                         -e 's#@@Port@@#$(PORT)#g' \
53                                         -e '/@@LoadModule@@/d' \
54                                         < $$i; \
55                         else \
56                                 sed -n -e '/@@LoadModule@@/q' \
57                                         -e 's#@@ServerRoot@@#$(prefix)#g' \
58                                         -e 's#@@Port@@#$(PORT)#g' \
59                                         -e 'p' \
60                                         < $$i; \
61                                 for j in $(DSO_MODULES) "^EOL^"; do \
62                                         if test "x$$j" = "xssl"; then \
63                                                 echo "<IfDefine SSL>"; \
64                                         fi; \
65                                         if test $$j != "^EOL^"; then \
66                                                 echo "LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
67                                         fi; \
68                                         if test "x$$j" = "xssl"; then \
69                                                 echo "</IfDefine>"; \
70                                         fi; \
71                                 done; \
72                                 sed -e '1,/@@LoadModule@@/d' \
73                                         -e '/@@LoadModule@@/d' \
74                                         -e 's#@@ServerRoot@@#$(prefix)#g' \
75                                         -e 's#@@Port@@#$(PORT)#g' \
76                                         < $$i; \
77                         fi \
78                 ) > $(DESTDIR)$(sysconfdir)/$$i; \
79                 chmod 0644 $(DESTDIR)$(sysconfdir)/$$i; \
80                 file=`echo $$i|sed s/-std//`; \
81                 if [ "$$file" = "httpd.conf" ]; then \
82                         file=`echo $$file|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
83                 fi; \
84                 if test "$$file" != "$$i" && test ! -f $(DESTDIR)$(sysconfdir)/$$file; then \
85                         $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/$$i $(DESTDIR)$(sysconfdir)/$$file; \
86                 fi; \
87             done ; \
88         done ; \
89         if test -f "$(builddir)/envvars-std"; then \
90             cp -p envvars-std $(DESTDIR)$(sbindir); \
91             if test ! -f $(DESTDIR)$(sbindir)/envvars; then \
92                 cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \
93             fi ; \
94         fi
95
96 install-build:
97         @echo Installing build system files 
98         @test -d $(DESTDIR)$(installbuilddir) || $(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir) 
99         @cp $(top_srcdir)/build/*.mk $(DESTDIR)$(installbuilddir); \
100         cp build/*.mk $(DESTDIR)$(installbuilddir); \
101         sed 's#LIBTOOL = \(.*\)#LIBTOOL = $(SHELL) $(installbuilddir)/libtool $(LTFLAGS)#' \
102             build/config_vars.mk > $(DESTDIR)$(installbuilddir)/config_vars.mk; \
103         cp $(top_srcdir)/build/instdso.sh $(DESTDIR)$(installbuilddir); \
104         cp $(top_builddir)/config.nice $(DESTDIR)$(installbuilddir);
105
106 htdocs-srcdir = $(top_srcdir)/docs/docroot
107
108 docs::
109         mkdir -p ./docs/api
110         srclib/apr/build/scandoc.pl -i./build/default.pl -p./docs/api/ ./include/*.h
111
112 dox::
113         doxygen $(top_srcdir)/docs/doxygen.conf
114
115 install-htdocs:
116         -@if [ -d $(DESTDIR)$(htdocsdir) ]; then \
117            echo "[PRESERVING EXISTING HTDOCS SUBDIR: $(DESTDIR)$(htdocsdir)]"; \
118         else \
119             echo Installing HTML documents ; \
120             $(MKINSTALLDIRS) $(DESTDIR)$(htdocsdir) ; \
121             test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(DESTDIR)$(htdocsdir)) ; \
122             cd $(DESTDIR)$(htdocsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
123         fi
124
125 install-error:
126         -@if [ -d $(DESTDIR)$(errordir) ]; then \
127            echo "[PRESERVING EXISTING ERROR SUBDIR: $(DESTDIR)$(errordir)]"; \
128         else \
129             echo Installing error documents ; \
130             $(MKINSTALLDIRS) $(DESTDIR)$(errordir) ; \
131             cd $(top_srcdir)/docs/error && cp -rp * $(DESTDIR)$(errordir) ; \
132             test "x$(errordir)" != "x" && cd $(DESTDIR)$(errordir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
133         fi
134
135 install-icons:
136         -@if [ -d $(DESTDIR)$(iconsdir) ]; then \
137            echo "[PRESERVING EXISTING ICONS SUBDIR: $(DESTDIR)$(iconsdir)]"; \
138         else \
139             echo Installing icons ; \
140             $(MKINSTALLDIRS) $(DESTDIR)$(iconsdir) ; \
141             cd $(top_srcdir)/docs/icons && cp -rp * $(DESTDIR)$(iconsdir) ; \
142             test "x$(iconsdir)" != "x" && cd $(DESTDIR)$(iconsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
143         fi
144
145 install-cgi:
146         -@if [ -d $(DESTDIR)$(cgidir) ];then \
147             echo "[PRESERVING EXISTING CGI SUBDIR: $(DESTDIR)$(cgidir)]"; \
148         else \
149            echo Installing CGIs ; \
150            $(MKINSTALLDIRS) $(DESTDIR)$(cgidir) ; \
151            cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(DESTDIR)$(cgidir) ; \
152            test "x$(cgidir)" != "x" && cd $(DESTDIR)$(cgidir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
153         fi
154
155 install-other:
156         @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
157         @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir)
158         @for ext in dll x; do \
159                 file=apachecore.$$ext; \
160                 if test -f $$file; then \
161                         cp -p $$file $(DESTDIR)$(libdir); \
162                 fi; \
163         done; \
164         file=httpd.dll; \
165         if test -f $$file; then \
166                 cp -p $$file $(DESTDIR)$(bindir); \
167         fi;
168
169 install-include:
170         @echo Installing header files
171         @test -d $(DESTDIR)$(includedir) || $(MKINSTALLDIRS) $(DESTDIR)$(includedir)
172         @cp -p include/*.h $(DESTDIR)$(includedir)
173         @cp -p $(srcdir)/include/*.h $(DESTDIR)$(includedir)
174         @cp -p $(srcdir)/os/$(OS_DIR)/os.h $(DESTDIR)$(includedir)
175         @if test -f $(srcdir)/os/$(OS_DIR)/os-inline.c; then \
176             cp -p $(srcdir)/os/$(OS_DIR)/os-inline.c $(DESTDIR)$(includedir); \
177         fi;
178         @cp -p $(srcdir)/server/mpm/$(MPM_SUBDIR_NAME)/*.h $(DESTDIR)$(includedir)
179         @cp -p $(srcdir)/modules/dav/main/mod_dav.h $(DESTDIR)$(includedir)
180         @cp -p $(srcdir)/modules/filters/mod_include.h $(DESTDIR)$(includedir)
181         @cp -p $(srcdir)/modules/generators/mod_cgi.h $(DESTDIR)$(includedir)
182         @cp -p $(srcdir)/modules/generators/mod_status.h $(DESTDIR)$(includedir)
183         @cp -p $(srcdir)/modules/loggers/mod_log_config.h $(DESTDIR)$(includedir)
184         @cp -p $(srcdir)/modules/http/mod_core.h $(DESTDIR)$(includedir)
185         @cp -p $(srcdir)/modules/proxy/mod_proxy.h $(DESTDIR)$(includedir)
186         @cp -p $(srcdir)/modules/ssl/*.h $(DESTDIR)$(includedir)
187         @cp -p $(srcdir)/srclib/pcre/pcre*.h $(DESTDIR)$(includedir)
188         @cp -p $(srcdir)/os/$(OS_DIR)/*.h $(DESTDIR)$(includedir)
189         @chmod 644 $(DESTDIR)$(includedir)/*.h
190
191 install-man:
192         @echo Installing man pages and online manual
193         @test -d $(DESTDIR)$(mandir)      || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)
194         @test -d $(DESTDIR)$(mandir)/man1 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1
195         @test -d $(DESTDIR)$(mandir)/man8 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man8
196         @test -d $(DESTDIR)$(manualdir)   || $(MKINSTALLDIRS) $(DESTDIR)$(manualdir)
197         @cp -p $(top_srcdir)/docs/man/*.1 $(DESTDIR)$(mandir)/man1
198         @cp -p $(top_srcdir)/docs/man/*.8 $(DESTDIR)$(mandir)/man8
199         @(cd $(top_srcdir)/docs/manual && cp -rp * $(DESTDIR)$(manualdir))
200         @(cd $(DESTDIR)$(manualdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null ) || true
201
202 install-suexec:
203         @if test -f $(builddir)/support/suexec; then \
204             test -d $(DESTDIR)$(sbindir) || $(MKINSTALLDIRS) $(DESTDIR)$(sbindir); \
205             $(INSTALL_PROGRAM) $(top_builddir)/support/suexec $(DESTDIR)$(sbindir); \
206             chmod 4755 $(DESTDIR)$(sbindir)/suexec; \
207         fi
208
209 suexec:
210         cd support && $(MAKE) suexec
211
212 x-local-distclean:
213         @rm -rf autom4te.cache
214
215 include $(top_srcdir)/os/os2/core.mk