summaryrefslogtreecommitdiffstats
path: root/Makefile.in
blob: 01fabd6be7a3421eea22f235d96b5acb82ff6972 (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
SUBDIRS = srclib os server modules support
CLEAN_SUBDIRS = test

PROGRAM_NAME         = $(progname)
PROGRAM_SOURCES      = modules.c
PROGRAM_LDADD        = $(EXTRA_LDFLAGS) $(HTTPD_LDFLAGS) \
                       $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS)
PROGRAM_DEPENDENCIES = \
  $(BUILTIN_LIBS) \
  $(MPM_LIB) \
  server/libmain.la \
  os/$(OS_DIR)/libos.la \
  $(AP_LIBS)

PROGRAMS        = $(PROGRAM_NAME)
TARGETS         = $(PROGRAMS) $(shared_build) $(other_targets)
PHONY_TARGETS   = $(srcdir)/buildmark.c
INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
	install-other install-cgi install-include install-suexec install-man \
	install-build

DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_layout.h \
	modules.c config.cache config.log config.status build/config_vars.mk \
        build/rules.mk docs/conf/httpd-std.conf
EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists

include $(top_builddir)/build/rules.mk
include $(top_srcdir)/build/program.mk

install-conf:
	@echo Installing configuration files
	@test -d $(sysconfdir) || $(MKINSTALLDIRS) $(sysconfdir)
	@cd $(top_srcdir)/docs/conf; \
	for i in mime.types magic; do \
		$(INSTALL_DATA) $$i $(sysconfdir); \
	done; \
	for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
		cd $$j ; \
	for i in *-std*.conf ssl.conf; do \
		[ -f $$i ] || continue; \
		( \
			n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
			if test $$n_lm -eq 0 -o "x$(DSO_MODULES)" = "x"; then \
				sed -e 's#@@ServerRoot@@#$(prefix)#g' \
					-e 's#@@Port@@#$(PORT)#g' \
					-e '/@@LoadModule@@/d' \
					< $$i; \
			else \
				sed -n -e '/@@LoadModule@@/q' \
					-e 's#@@ServerRoot@@#$(prefix)#g' \
					-e 's#@@Port@@#$(PORT)#g' \
					-e 'p' \
					< $$i; \
				for j in $(DSO_MODULES) "^EOL^"; do \
					if test "x$$j" = "xssl"; then \
						echo "<IfDefine SSL>"; \
					fi; \
					if test $$j != "^EOL^"; then \
						echo "LoadModule $${j}_module modules/mod_$${j}.so"; \
					fi; \
					if test "x$$j" = "xssl"; then \
						echo "</IfDefine>"; \
					fi; \
				done; \
				sed -e '1,/@@LoadModule@@/d' \
					-e '/@@LoadModule@@/d' \
					-e 's#@@ServerRoot@@#$(prefix)#g' \
					-e 's#@@Port@@#$(PORT)#g' \
					< $$i; \
			fi \
		) > $(sysconfdir)/$$i; \
		chmod 0644 $(sysconfdir)/$$i; \
		file=`echo $$i|sed s/-std//`; \
		if [ "$$file" = "httpd.conf" ]; then \
			file=`echo $$file|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
		fi; \
		if test "$$file" != "$$i" && test ! -f $(sysconfdir)/$$file; then \
			$(INSTALL_DATA) $(sysconfdir)/$$i $(sysconfdir)/$$file; \
		fi; \
	done ; \
	done
	@if test -f "$(builddir)/envvars-std"; then \
	    cp -p envvars-std $(sbindir); \
	    if test ! -f $(sbindir)/envvars; then \
	        cp -p envvars-std $(sbindir)/envvars ; \
	    fi ; \
	fi

install-build:
	@echo Installing build system files 
	@test -d $(installbuilddir) || $(MKINSTALLDIRS) $(installbuilddir) 
	@cp build/*.mk $(installbuilddir); \
	sed 's#LIBTOOL = \(.*\)#LIBTOOL = $(SHELL) $(installbuilddir)/libtool $(LTFLAGS)#' \
	    build/config_vars.mk > $(installbuilddir)/config_vars.mk; \
	cp $(top_srcdir)/build/instdso.sh $(installbuilddir);

htdocs-srcdir = $(top_srcdir)/docs/docroot

docs::
	mkdir -p ./docs/api
	srclib/apr/build/scandoc.pl -i./build/default.pl -p./docs/api/ ./include/*.h

dox::
	doxygen $(top_srcdir)/docs/doxygen.conf

install-htdocs:
	@echo Installing HTML documents
	@test -d $(htdocsdir) || $(MKINSTALLDIRS) $(htdocsdir)
	@test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(htdocsdir))
	@test -d $(manualdir) || $(MKINSTALLDIRS) $(manualdir)
	@test -d $(top_srcdir)/docs/manual && (cd $(top_srcdir)/docs/manual && cp -rp * $(manualdir))
	@test "x$(htdocsdir)" != "x" && cd $(htdocsdir) && find . -name "CVS" -print | xargs rm -rf {} \;

install-error:
	@echo Installing error documents
	@test -d $(errordir) || $(MKINSTALLDIRS) $(errordir)
	@cd $(top_srcdir)/docs/error && cp -rp * $(errordir)
	@test "x$(errordir)" != "x" && cd $(errordir) && find . -name "CVS" -print | xargs rm -rf {} \;

install-icons:
	@echo Installing icons
	@test -d $(iconsdir) || $(MKINSTALLDIRS) $(iconsdir)
	@cd $(top_srcdir)/docs/icons && cp -rp * $(iconsdir)
	@test "x$(iconsdir)" != "x" && cd $(iconsdir) && find . -name "CVS" -print | xargs rm -rf {} \;

install-cgi:
	@echo Installing CGIs
	@test -d $(cgidir) || $(MKINSTALLDIRS) $(cgidir)
	@cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(cgidir)
	@test "x$(cgidir)" != "x" && cd $(cgidir) && find . -name "CVS" -print | xargs rm -rf {} \;

install-other:
	@test -d $(logfiledir) || $(MKINSTALLDIRS) $(logfiledir)
	@for ext in dll x; do \
		file=apachecore.$$ext; \
		if test -f $$file; then \
			cp -p $$file $(libdir); \
		fi; \
	done; \
	file=httpd.dll; \
	if test -f $$file; then \
		cp -p $$file $(bindir); \
	fi;

install-include:
	@echo Installing header files
	@test -d $(includedir)     || $(MKINSTALLDIRS) $(includedir)
	@cp -p include/*.h $(srcdir)/include/*.h $(includedir)
	@cp -p $(srcdir)/os/$(OS_DIR)/os.h $(includedir)
	@if test -f $(srcdir)/os/$(OS_DIR)/os-inline.c; then \
            cp -p $(srcdir)/os/$(OS_DIR)/os-inline.c $(includedir); \
        fi;
	@cp -p $(srcdir)/server/mpm/$(MPM_SUBDIR_NAME)/*.h $(includedir)
	@cp -p $(srcdir)/modules/dav/main/mod_dav.h $(includedir)
	@cp -p $(srcdir)/modules/filters/mod_include.h $(includedir)
	@cp -p $(srcdir)/modules/generators/mod_cgi.h $(includedir)
	@cp -p $(srcdir)/modules/loggers/mod_log_config.h $(includedir)
	@cp -p $(srcdir)/modules/http/mod_core.h $(includedir)
	@cp -p $(srcdir)/modules/proxy/mod_proxy.h $(includedir)
	@cp -p $(srcdir)/modules/ssl/*.h $(includedir)
	@cp -p $(srcdir)/srclib/pcre/pcre*.h $(includedir)
	@cp -p $(srcdir)/srclib/apr/include/*.h $(includedir)
	@cp -p $(srcdir)/srclib/apr-util/include/*.h $(includedir)
	@cp -p $(srcdir)/os/$(OS_DIR)/*.h $(includedir)
	@chmod 644 $(includedir)/*.h

install-man:
	@echo Installing man pages
	@test -d $(mandir)      || $(MKINSTALLDIRS) $(mandir)
	@test -d $(mandir)/man1 || $(MKINSTALLDIRS) $(mandir)/man1
	@test -d $(mandir)/man8 || $(MKINSTALLDIRS) $(mandir)/man8
	@cp -p $(top_srcdir)/docs/man/*.1 $(mandir)/man1
	@cp -p $(top_srcdir)/docs/man/*.8 $(mandir)/man8

install-suexec:
	@if test -f $(builddir)/support/suexec; then \
            test -d $(sbindir) || $(MKINSTALLDIRS) $(sbindir); \
            $(INSTALL_PROGRAM) $(top_builddir)/support/suexec $(sbindir); \
            chmod 4755 $(sbindir)/suexec; \
	fi

suexec:
	cd support && $(MAKE) suexec

include $(top_srcdir)/os/os2/core.mk