• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
18#
19# rules.mk: standard rules for APR
20#
21
22@SET_MAKE@
23
24#
25# Configuration variables
26#
27apr_builddir=@apr_builddir@
28apr_builders=@apr_builders@
29top_builddir=@apr_builddir@
30
31# Some layouts require knowing what version we are at.
32APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
33APR_DOTTED_VERSION=@APR_DOTTED_VERSION@
34
35CC=@CC@
36RM=@RM@
37AWK=@AWK@
38SHELL=@SHELL@
39LIBTOOL=@LIBTOOL@
40
41# compilation and linking flags that are supposed to be set only by the user.
42# configure adds to them for tests, but we restore them at the end.
43#
44CFLAGS=@CFLAGS@
45CPPFLAGS=@CPPFLAGS@
46LDFLAGS=@LDFLAGS@
47LIBS=@LIBS@
48DEFS=@DEFS@
49
50# anything added to the standard flags by configure is moved to EXTRA_*
51# at the end of the process.
52#
53EXTRA_CFLAGS=@EXTRA_CFLAGS@
54EXTRA_CPPFLAGS=@EXTRA_CPPFLAGS@
55EXTRA_LDFLAGS=@EXTRA_LDFLAGS@
56EXTRA_LIBS=@EXTRA_LIBS@
57EXTRA_INCLUDES=@EXTRA_INCLUDES@
58
59# CPPFLAGS which are used only while building APR itself
60#
61INTERNAL_CPPFLAGS=@INTERNAL_CPPFLAGS@
62
63# NOTEST_* are flags and libraries that can be added by the user without
64# causing them to be used in configure tests (necessary for things like
65# -Werror and other strict warnings that maintainers like to use).
66#
67NOTEST_CFLAGS=@NOTEST_CFLAGS@
68NOTEST_CPPFLAGS=@NOTEST_CPPFLAGS@
69NOTEST_LDFLAGS=@NOTEST_LDFLAGS@
70NOTEST_LIBS=@NOTEST_LIBS@
71
72# Finally, combine all of the flags together in the proper order so that
73# the user-defined flags can always override the configure ones, if needed.
74# Note that includes are listed after the flags because -I options have
75# left-to-right precedence and CPPFLAGS may include user-defined overrides.
76#
77ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
78ALL_CPPFLAGS = $(DEFS) $(INTERNAL_CPPFLAGS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
79ALL_LDFLAGS  = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
80ALL_LIBS     = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS)
81ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
82
83LTFLAGS      = @LTFLAGS@
84LT_LDFLAGS   = @LT_LDFLAGS@
85
86# The set of object files that will be linked into the target library.
87# The build-outputs.mk specifies a different set for each platform. The
88# configure script will select the appropriate set.
89#
90OBJECTS      = @OBJECTS_PLATFORM@
91
92#
93# Basic macro setup
94#
95COMPILE      = $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
96LT_COMPILE   = @lt_compile@
97
98LINK         = @link@
99
100APR_MKDIR        = $(apr_builders)/mkdir.sh
101APR_MKEXPORT     = $(AWK) -f $(apr_builders)/make_exports.awk
102APR_MKVAREXPORT  = $(AWK) -f $(apr_builders)/make_var_export.awk
103MKDEP            = @MKDEP@
104
105#
106# Standard build rules
107#
108all: all-recursive
109depend: depend-recursive
110clean: clean-recursive
111distclean: distclean-recursive
112extraclean: extraclean-recursive
113
114install: all-recursive
115
116
117all-recursive depend-recursive:
118	@otarget=`echo $@ | sed s/-recursive//`; \
119	list='$(SOURCE_DIRS)'; \
120	for i in $$list; do \
121	    if test -f "$$i/Makefile"; then \
122		target="$$otarget"; \
123		echo "Making $$target in $$i"; \
124		if test "$$i" = "."; then \
125		    made_local=yes; \
126		    target="local-$$target"; \
127		fi; \
128		(cd $$i && $(MAKE) $$target) || exit 1; \
129	    fi; \
130	done; \
131        if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \
132	    made_local=yes; \
133	fi; \
134	if test "$$made_local" != "yes"; then \
135	    $(MAKE) "local-$$otarget" || exit 1; \
136	fi
137
138clean-recursive distclean-recursive extraclean-recursive:
139	@otarget=`echo $@ | sed s/-recursive//`; \
140	list='$(CLEAN_SUBDIRS)'; \
141	for i in $$list; do \
142	    if test -f "$$i/Makefile"; then \
143		target="$$otarget"; \
144		echo "Making $$target in $$i"; \
145		if test "$$i" = "."; then \
146		    made_local=yes; \
147		    target="local-$$target"; \
148		fi; \
149		(cd $$i && $(MAKE) $$target); \
150	    fi; \
151	done; \
152        if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \
153	    made_local=yes; \
154	fi; \
155	if test "$$made_local" != "yes"; then \
156	    $(MAKE) "local-$$otarget"; \
157	fi
158
159# autoconf 2.5x is creating a 'autom4te.cache' directory
160# In case someone ran autoconf by hand, get rid of that directory
161# as well.
162local-clean: x-local-clean
163	@list='. $(SOURCE_DIRS)'; \
164	for i in $$list; do \
165	    echo $(RM) -f $$i/*.o $$i/*.lo $$i/*.a $$i/*.la $$i/*.so $$i/*.obj; \
166	    $(RM) -f $$i/*.o $$i/*.lo $$i/*.a $$i/*.la $$i/*.so $$i/*.obj; \
167	    echo $(RM) -rf $$i/.libs; \
168	    $(RM) -rf $$i/.libs; \
169        done
170	$(RM) -f $(CLEAN_TARGETS) $(PROGRAMS)
171	$(RM) -rf autom4te.cache
172
173local-distclean: local-clean x-local-distclean
174	$(RM) -f Makefile $(DISTCLEAN_TARGETS)
175
176local-extraclean: local-distclean x-local-extraclean
177	@if test -n "$(EXTRACLEAN_TARGETS)"; then \
178	    echo $(RM) -f $(EXTRACLEAN_TARGETS) ; \
179	    $(RM) -f $(EXTRACLEAN_TARGETS) ; \
180	fi
181
182local-all: $(TARGETS)
183
184local-depend: x-local-depend
185	@if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \
186		$(RM) -f .deps; \
187		list='$(srcdir)/*.c'; \
188		for i in $$list; do \
189			$(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) $$i | sed 's/\.o:/.lo:/' >> .deps; \
190		done; \
191	fi
192
193# to be filled in by the actual Makefile
194x-local-depend x-local-clean x-local-distclean x-local-extraclean:
195
196#
197# Implicit rules for creating outputs from input files
198#
199.SUFFIXES:
200.SUFFIXES: .c .lo .o
201
202.c.o:
203	$(COMPILE) -c $<
204
205.c.lo:
206	$(LT_COMPILE)
207
208.PHONY: all all-recursive local-all install \
209	depend depend-recursive local-depend x-local-depend \
210	clean clean-recursive local-clean x-local-clean \
211	distclean distclean-recursive local-distclean x-local-distclean \
212	extraclean extraclean-recursive local-extraclean x-local-extraclean
213