apr_rules.mk.in 5.9 KB

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