-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.apxs
154 lines (138 loc) · 5.25 KB
/
Makefile.apxs
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
##
## Makefile.apxs -- Build procedure for mod_bmx Apache modules
##
## Do not use the Makefile.apxs file, from this source root dir, run
##
## $ ./configure.apxs
## $ make
## $ make install
##
## APXS variable is accepted, so to use a particular specific apxs, try
##
## $ APXS=/opt/httpd/bin/apxs2 ./configure.apxs
##
# See the NOTICE file distributed with this work for information
# regarding copyright ownership. This file is licensed to You under
# the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# top_builddir and top_srcdir are misnomers, because build/*.mk
# top_builddir and top_srcdir are misnomers, because build/*.mk scripts
# expect each of them to be the parent of the build directory, and fail
# to trust the installbuilddir.
exp_installbuilddir=$(shell $(APXS) -q exp_installbuilddir)
top_srcdir=$(installbuilddir)/..
top_builddir=$(installbuilddir)/..
bmx_builddir=.
bmx_srcdir=.
builddir=.
srcdir=.
awk=.
SUBDIRS = modules/bmx
CLEAN_SUBDIRS =
TARGETS =
INSTALL_TARGETS = install-conf install-manual
## no such targets yet; install-include
DISTCLEAN_TARGETS = config.apxs.log
# modules/bmx/bmx_config.h
EXTRACLEAN_TARGETS =
include $(exp_installbuilddir)/rules.mk
x-local-distclean:
rm -rf docs/manual/build docs/manual/style
# Dang nabbit, these are stripped! Reconstitute them;
rel_libexecdir=`echo $(exp_libexecdir) | sed -e "s#^$(prefix)/##;"`
rel_sysconfdir=`echo $(exp_sysconfdir) | sed -e "s#^$(prefix)/##;"`
rel_logfiledir=`echo $(exp_logfiledir) | sed -e "s#^$(prefix)/##;"`
httpd_conffile=$(exp_sysconfdir)/$(progname).conf
httpd_origconffile=$(exp_sysconfdir)/original/$(progname).conf
install-conf:
@echo Installing configuration files
@$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir) \
$(DESTDIR)$(exp_sysconfdir)/original
for i in $(DESTDIR)$(httpd_conffile) $(DESTDIR)$(httpd_origconffile); do \
if test -f $$i; then \
($(awk) -f $(bmx_srcdir)/build/addloadexample.awk -v DSO=.so \
-v MODULE=bmx -v LIBPATH=$(rel_libexecdir) \
< $$i | \
$(awk) -f $(bmx_srcdir)/build/addloadexample.awk -v DSO=.so \
-v MODULE=bmx_status -v LIBPATH=$(rel_libexecdir) | \
$(awk) -f $(bmx_srcdir)/build/addloadexample.awk -v DSO=.so \
-v MODULE=bmx_vhost -v LIBPATH=$(rel_libexecdir) \
> $$i.new && \
mv $$i $$i.bak && mv $$i.new $$i \
) || true; \
fi; \
done
# Todo - add this flag to awk above, if/when this Include is distributed
# -v EXAMPLECONF=$(rel_sysconfdir)/extra/httpd-bmx.conf
install-conf-unused:
@$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir)/extra \
$(DESTDIR)$(exp_sysconfdir)/original/extra
@cd $(bmx_srcdir)/docs/conf; \
for j in $(bmx_srcdir)/docs/conf; do \
cd $$j ; \
for i in extra/httpd-bmx.conf; do \
if test -f $$i; then \
sed -e '/^\#@@LoadBmxModules@@/d;' \
-e 's#@exp_runtimedir@#$(exp_runtimedir)#;' \
-e 's#@exp_sysconfdir@#$(exp_sysconfdir)#;' \
-e 's#@rel_sysconfdir@#$(rel_sysconfdir)#;' \
-e 's#@rel_logfiledir@#$(rel_logfiledir)#;' \
< $$i > $(DESTDIR)$(exp_sysconfdir)/original/$$i; \
chmod 0644 $(DESTDIR)$(exp_sysconfdir)/original/$$i; \
if test ! -f $(DESTDIR)$(exp_sysconfdir)/$$i; then \
cp $(DESTDIR)$(exp_sysconfdir)/original/$$i \
$(DESTDIR)$(exp_sysconfdir)/$$i; \
chmod 0644 $(DESTDIR)$(exp_sysconfdir)/$$i; \
fi; \
fi; \
done ; \
done
svnroot=http://svn.apache.org/repos/asf/httpd
manualdir=$(bmx_srcdir)/docs/manual
# Note; by default, make generate-docs rebuilds the local pages
# To regenerate the installed pages (after using make install to
# drop in the bmx content), simply
#
# make manualdir=/path/to/manual generate-docs
#
generate-docs:
@if test ! -d $(manualdir)/build; then \
cd $(manualdir); \
svn export $(svnroot)/docs-build/trunk build; \
fi
@if test ! -d $(manualdir)/style; then \
cd $(manualdir); \
svn export $(svnroot)/httpd/trunk/docs/manual/style; \
fi
cd $(manualdir)/build; \
./build.sh all
generate-dox:
cd $(bmx_srcdir); \
doxygen $(bmx_srcdir)/docs/doxygen-bmx.conf
install-manual:
@echo Installing online manual
@test -d $(DESTDIR)$(exp_manualdir) \
|| $(MKINSTALLDIRS) $(DESTDIR)$(exp_manualdir)
@if test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
$(RSYNC) --exclude .svn -rlpt --numeric-ids \
$(bmx_srcdir)/docs/manual/ $(DESTDIR)$(exp_manualdir)/; \
else \
cp -rp $(bmx_srcdir)/docs/manual/* $(DESTDIR)$(exp_manualdir)/ && \
find $(DESTDIR)$(exp_manualdir) -name ".svn" -type d -print \
| xargs rm -rf 2>/dev/null || true; \
fi
install-include-unused:
@echo Installing header files
@$(MKINSTALLDIRS) $(DESTDIR)$(exp_includedir) && \
cp $(bmx_srcdir)/include/mod_bmx.h $(DESTDIR)$(exp_includedir)/ && \
chmod 0644 $(DESTDIR)$(exp_includedir)/mod_bmx.h
.PHONY: generate-dox generate-docs