]> granicus.if.org Git - apache/blob - build/rules.mk.in
Provide the IndexIgnore example that's in the httpd-autoindex config
[apache] / build / rules.mk.in
1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements.  See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License.  You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 #
17 # The build environment was originally provided by Sascha Schumann.
18
19 @ap_make_include@ @ap_make_delimiter@$(top_builddir)/build/config_vars.mk@ap_make_delimiter@
20
21 # Combine all of the flags together in the proper order so that
22 # the user-defined flags can always override the configure ones, if needed.
23 # Note that includes are listed after the flags because -I options have
24 # left-to-right precedence and CPPFLAGS may include user-defined overrides.
25 #
26 ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
27 ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
28 ALL_CXXFLAGS = $(EXTRA_CXXFLAGS) $(NOTEST_CXXFLAGS) $(CXXFLAGS)
29 ALL_LDFLAGS  = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
30 ALL_LIBS     = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS)
31 ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
32
33 # Compile commands
34
35 BASE_CC  = $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
36 BASE_CXX = $(CXX) $(ALL_CXXFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
37
38 COMPILE      = $(BASE_CC) @PICFLAGS@
39 CXX_COMPILE  = $(BASE_CXX) @PICFLAGS@
40
41 SH_COMPILE     = $(LIBTOOL) --mode=compile $(BASE_CC) @SHLTCFLAGS@ -c $< && touch $@
42 SH_CXX_COMPILE = $(LIBTOOL) --mode=compile $(BASE_CXX) @SHLTCFLAGS@ -c $< && touch $@
43
44 LT_COMPILE     = $(LIBTOOL) --mode=compile $(COMPILE) @LTCFLAGS@ -c $< && touch $@
45 LT_CXX_COMPILE = $(LIBTOOL) --mode=compile $(CXX_COMPILE) @LTCFLAGS@ -c $< && touch $@
46
47 # Link-related commands
48
49 LINK     = $(LIBTOOL) --mode=link $(CC) $(ALL_CFLAGS) @PILDFLAGS@ $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@
50 SH_LINK  = $(SH_LIBTOOL) --mode=link $(CC) $(ALL_CFLAGS) $(LT_LDFLAGS) $(ALL_LDFLAGS) $(SH_LDFLAGS) $(CORE_IMPLIB) $(SH_LIBS) -o $@
51 MOD_LINK = $(LIBTOOL) --mode=link $(CC) $(ALL_CFLAGS) -static $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@
52
53 # Cross compile commands
54
55 # Helper programs
56
57 INSTALL_DATA = $(INSTALL) -m 644
58 INSTALL_PROGRAM = $(INSTALL) -m 755 $(INSTALL_PROG_FLAGS)
59
60 #
61 # Standard build rules
62 #
63 all: all-recursive
64 depend: depend-recursive
65 clean: clean-recursive
66 distclean: distclean-recursive
67 extraclean: extraclean-recursive
68 install: install-recursive
69 shared-build: shared-build-recursive
70
71 all-recursive install-recursive depend-recursive:
72         @otarget=`echo $@|sed s/-recursive//`; \
73         list=' $(BUILD_SUBDIRS) $(SUBDIRS)'; \
74         for i in $$list; do \
75             if test -d "$$i"; then \
76                 target="$$otarget"; \
77                 echo "Making $$target in $$i"; \
78                 if test "$$i" = "."; then \
79                         made_local=yes; \
80                         target="local-$$target"; \
81                 fi; \
82                 (cd $$i && $(MAKE) $$target) || exit 1; \
83             fi; \
84         done; \
85         if test "$$otarget" = "all" && test -z '$(TARGETS)'; then \
86             made_local=yes; \
87         fi; \
88         if test "$$made_local" != "yes"; then \
89             $(MAKE) "local-$$otarget" || exit 1; \
90         fi
91
92 clean-recursive distclean-recursive extraclean-recursive:
93         @otarget=`echo $@|sed s/-recursive//`; \
94         list='$(CLEAN_SUBDIRS) $(SUBDIRS)'; \
95         for i in $$list; do \
96             if test -d "$$i"; then \
97                 target="$$otarget"; \
98                 echo "Making $$target in $$i"; \
99                 if test "$$i" = "."; then \
100                         made_local=yes; \
101                         target="local-$$target"; \
102                 fi; \
103                 (cd $$i && $(MAKE) $$target); \
104             fi; \
105         done; \
106         if test "$$otarget" = "all" && test -z '$(TARGETS)'; then \
107             made_local=yes; \
108         fi; \
109         if test "$$made_local" != "yes"; then \
110             $(MAKE) "local-$$otarget"; \
111         fi
112
113 shared-build-recursive:
114         @if test `pwd` = "$(top_builddir)"; then \
115             $(PRE_SHARED_CMDS) ; \
116         fi; \
117         list='$(SUBDIRS)'; for i in $$list; do \
118             target="shared-build"; \
119             if test "$$i" = "."; then \
120                 made_local=yes; \
121                 target="local-shared-build"; \
122             fi; \
123             if test "$$i" != "srclib"; then \
124                 (cd $$i && $(MAKE) $$target) || exit 1; \
125             fi; \
126         done; \
127         if test -f 'modules.mk'; then \
128             if test -n '$(SHARED_TARGETS)'; then \
129                 echo "Building shared: $(SHARED_TARGETS)"; \
130                 if test "$$made_local" != "yes"; then \
131                         $(MAKE) "local-shared-build" || exit 1; \
132                 fi; \
133             fi; \
134         fi; \
135         if test `pwd` = "$(top_builddir)"; then \
136                 $(POST_SHARED_CMDS) ; \
137         fi
138
139 local-all: $(TARGETS)
140
141 local-shared-build: $(SHARED_TARGETS)
142
143 local-depend: x-local-depend
144         @if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \
145                 rm -f .deps; \
146                 list='$(srcdir)/*.c'; \
147                 for i in $$list; do \
148                         $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) $$i | sed 's/\.o:/.lo:/' >> .deps; \
149                 done; \
150                 sed 's/\.lo:/.slo:/' < .deps > .deps.$$; \
151                 cat .deps.$$ >> .deps; \
152                 rm -f .deps.$$; \
153         fi
154
155 local-clean: x-local-clean
156         rm -f *.o *.lo *.slo *.obj *.a *.la $(CLEAN_TARGETS) $(TARGETS)
157         rm -rf .libs
158
159 local-distclean: local-clean x-local-distclean
160         rm -f .deps Makefile $(DISTCLEAN_TARGETS)
161
162 local-extraclean: local-distclean x-local-extraclean
163         @if test -n "$(EXTRACLEAN_TARGETS)"; then \
164             echo "rm -f $(EXTRACLEAN_TARGETS)"; \
165             rm -f $(EXTRACLEAN_TARGETS) ; \
166         fi
167
168 program-install: $(TARGETS) $(SHARED_TARGETS)
169         @if test -n '$(PROGRAMS)'; then \
170             test -d $(DESTDIR)$(sbindir) || $(MKINSTALLDIRS) $(DESTDIR)$(sbindir); \
171             list='$(PROGRAMS)'; for i in $$list; do \
172                 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(sbindir); \
173             done; \
174         fi
175
176 local-install: program-install $(INSTALL_TARGETS)
177
178 # to be filled in by the actual Makefile if extra commands are needed
179 x-local-depend x-local-clean x-local-distclean x-local-extraclean:
180
181 #
182 # Implicit rules for creating outputs from input files
183 #
184 CXX_SUFFIX = cpp
185 SHLIB_SUFFIX = so
186
187 .SUFFIXES:
188 .SUFFIXES: .S .c .$(CXX_SUFFIX) .lo .o .s .y .l .slo .def .la
189
190 .c.o:
191         $(COMPILE) -c $<
192
193 .s.o:
194         $(COMPILE) -c $<
195
196 .c.lo:
197         $(LT_COMPILE)
198
199 .s.lo:
200         $(LT_COMPILE)
201
202 .c.slo:
203         $(SH_COMPILE)
204
205 .$(CXX_SUFFIX).lo:
206         $(LT_CXX_COMPILE)
207
208 .$(CXX_SUFFIX).slo:
209         $(SH_CXX_COMPILE)
210
211 .y.c:
212         $(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
213         if test -f y.tab.h; then \
214         if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
215         else :; fi
216
217 .l.c:
218         $(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
219
220 # Makes an import library from a def file
221 .def.la:
222         $(LIBTOOL) --mode=compile $(MK_IMPLIB) -o $@ $<
223
224 #
225 # Dependencies
226 #
227 @ap_make_include@ @ap_make_delimiter@$(builddir)/.deps@ap_make_delimiter@
228
229 .PHONY: all all-recursive install-recursive local-all $(PHONY_TARGETS) \
230         shared-build shared-build-recursive local-shared-build \
231         depend depend-recursive local-depend x-local-depend \
232         clean clean-recursive local-clean x-local-clean \
233         distclean distclean-recursive local-distclean x-local-distclean \
234         extraclean extraclean-recursive local-extraclean x-local-extraclean \
235         install local-install docs $(INSTALL_TARGETS)
236