perl patches: fix spaces errors in patch 0001
[msysgit.git] / build / apr_rules.mk
blob2865be7e4865da2273d30c1f8d6f11d41e4f202a
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 # rules.mk: standard rules for APR
25 # Configuration variables
27 apr_builddir=/build
28 apr_builders=/build
30 # Some layouts require knowing what version we are at.
31 APR_MAJOR_VERSION=0
32 APR_DOTTED_VERSION=0.9.17
34 CC=gcc
35 RM=rm
36 AWK=gawk
37 SHELL=/bin/sh
38 LIBTOOL=$(SHELL) $(apr_builddir)/libtool
40 # compilation and linking flags that are supposed to be set only by the user.
41 # configure adds to them for tests, but we restore them at the end.
43 CFLAGS=
44 CPPFLAGS=
45 LDFLAGS=
46 LIBS=
47 DEFS=-DHAVE_CONFIG_H
49 # anything added to the standard flags by configure is moved to EXTRA_*
50 # at the end of the process.
52 EXTRA_CFLAGS=-g -O2
53 EXTRA_CPPFLAGS=
54 EXTRA_LDFLAGS=
55 EXTRA_LIBS=
56 EXTRA_INCLUDES=
58 # NOTEST_* are flags and libraries that can be added by the user without
59 # causing them to be used in configure tests (necessary for things like
60 # -Werror and other strict warnings that maintainers like to use).
62 NOTEST_CFLAGS=
63 NOTEST_CPPFLAGS=
64 NOTEST_LDFLAGS=
65 NOTEST_LIBS=
67 # Finally, combine all of the flags together in the proper order so that
68 # the user-defined flags can always override the configure ones, if needed.
69 # Note that includes are listed after the flags because -I options have
70 # left-to-right precedence and CPPFLAGS may include user-defined overrides.
72 ALL_CFLAGS = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
73 ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
74 ALL_LDFLAGS = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
75 ALL_LIBS = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS)
76 ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
78 LTFLAGS = --silent
79 LT_LDFLAGS =
82 # Basic macro setup
84 COMPILE = $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(ALL_INCLUDES)
85 LT_COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@
87 LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) -version-info 9:17:9 $(ALL_LDFLAGS) -o $@
89 APR_MKDIR = $(apr_builders)/mkdir.sh
90 APR_MKEXPORT = $(AWK) -f $(apr_builders)/make_exports.awk
91 APR_MKVAREXPORT = $(AWK) -f $(apr_builders)/make_var_export.awk
92 MKDEP = $(CC) -MM
95 # Standard build rules
97 all: all-recursive
98 depend: depend-recursive
99 clean: clean-recursive
100 distclean: distclean-recursive
101 extraclean: extraclean-recursive
103 install: all-recursive
106 all-recursive depend-recursive:
107 @otarget=`echo $@ | sed s/-recursive//`; \
108 list='$(SUBDIRS)'; \
109 for i in $$list; do \
110 if test -d "$$i"; then \
111 target="$$otarget"; \
112 echo "Making $$target in $$i"; \
113 if test "$$i" = "."; then \
114 made_local=yes; \
115 target="local-$$target"; \
116 fi; \
117 (cd $$i && $(MAKE) $$target) || exit 1; \
118 fi; \
119 done; \
120 if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \
121 made_local=yes; \
122 fi; \
123 if test "$$made_local" != "yes"; then \
124 $(MAKE) "local-$$otarget" || exit 1; \
127 clean-recursive distclean-recursive extraclean-recursive:
128 @otarget=`echo $@ | sed s/-recursive//`; \
129 list='$(SUBDIRS) $(CLEAN_SUBDIRS)'; \
130 for i in $$list; do \
131 if test -d "$$i"; then \
132 target="$$otarget"; \
133 echo "Making $$target in $$i"; \
134 if test "$$i" = "."; then \
135 made_local=yes; \
136 target="local-$$target"; \
137 fi; \
138 (cd $$i && $(MAKE) $$target); \
139 fi; \
140 done; \
141 if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \
142 made_local=yes; \
143 fi; \
144 if test "$$made_local" != "yes"; then \
145 $(MAKE) "local-$$otarget"; \
148 # autoconf 2.5x is creating a 'autom4te.cache' directory
149 # In case someone ran autoconf by hand, get rid of that directory
150 # aswell.
151 local-clean: x-local-clean
152 $(RM) -f *.o *.lo *.a *.la *.so *.obj $(CLEAN_TARGETS) $(PROGRAMS)
153 $(RM) -rf .libs autom4te.cache
155 local-distclean: local-clean x-local-distclean
156 $(RM) -f Makefile $(DISTCLEAN_TARGETS)
158 local-extraclean: local-distclean x-local-extraclean
159 @if test -n "$(EXTRACLEAN_TARGETS)"; then \
160 echo $(RM) -f $(EXTRACLEAN_TARGETS) ; \
161 $(RM) -f $(EXTRACLEAN_TARGETS) ; \
164 local-all: $(TARGETS)
166 local-depend: x-local-depend
167 @if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \
168 $(RM) -f .deps; \
169 list='$(srcdir)/*.c'; \
170 for i in $$list; do \
171 $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) $$i | sed 's/\.o:/.lo:/' >> .deps; \
172 done; \
175 # to be filled in by the actual Makefile
176 x-local-depend x-local-clean x-local-distclean x-local-extraclean:
179 # Implicit rules for creating outputs from input files
181 .SUFFIXES:
182 .SUFFIXES: .c .lo .o
184 .c.o:
185 $(COMPILE) -c $<
187 .c.lo:
188 $(LT_COMPILE)
190 .PHONY: all all-recursive local-all install \
191 depend depend-recursive local-depend x-local-depend \
192 clean clean-recursive local-clean x-local-clean \
193 distclean distclean-recursive local-distclean x-local-distclean \
194 extraclean extraclean-recursive local-extraclean x-local-extraclean