configure.am 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. ## automake - create Makefile.in from Makefile.am
  2. ## Copyright (C) 2001-2017 Free Software Foundation, Inc.
  3. ## This program is free software; you can redistribute it and/or modify
  4. ## it under the terms of the GNU General Public License as published by
  5. ## the Free Software Foundation; either version 2, or (at your option)
  6. ## any later version.
  7. ## This program is distributed in the hope that it will be useful,
  8. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ## GNU General Public License for more details.
  11. ## You should have received a copy of the GNU General Public License
  12. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ## This dummy rule is called from subdirectories whenever one of the
  14. ## top-level Makefile's dependencies must be updated. It does depend
  15. ## on %MAKEFILE% for the benefit of non-GNU make implementations (GNU
  16. ## make will always make sure %MAKEFILE% is updated before considering
  17. ## the am--refresh target anyway).
  18. if %?TOPDIR_P%
  19. .PHONY: am--refresh
  20. am--refresh: %MAKEFILE%
  21. @:
  22. endif %?TOPDIR_P%
  23. ## --------------------- ##
  24. ## Building Makefile.*. ##
  25. ## --------------------- ##
  26. ## This rule remakes the Makefile.in.
  27. %MAKEFILE-IN%: %MAINTAINER-MODE% %MAKEFILE-AM% %MAKEFILE-IN-DEPS% $(am__configure_deps)
  28. ## If configure.ac or one of configure's dependencies has changed, all
  29. ## Makefile.in are to be updated; it is then more efficient to run
  30. ## automake on all the Makefiles at once. It also allow Automake to be
  31. ## run for newly added directories.
  32. @for dep in $?; do \
  33. case '$(am__configure_deps)' in \
  34. *$$dep*) \
  35. ?TOPDIR_P? echo ' cd $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS%'; \
  36. ?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% \
  37. ?TOPDIR_P? && exit 0; \
  38. ?!TOPDIR_P? ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
  39. ## If on the other hand, subdir/Makefile.in has been removed, then toplevel
  40. ## am--refresh will not be aware of any need to run. We still invoke it
  41. ## due to $? listing all prerequisites. Fix up for it by running the rebuild
  42. ## rule for this file only, below.
  43. ?!TOPDIR_P? && { if test -f $@; then exit 0; else break; fi; }; \
  44. exit 1;; \
  45. esac; \
  46. done; \
  47. ## Otherwise, rebuild only this file.
  48. echo ' cd $(top_srcdir) && $(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%'; \
  49. $(am__cd) $(top_srcdir) && \
  50. $(AUTOMAKE) %AUTOMAKE-OPTIONS% %MAKEFILE-AM-SOURCES%
  51. ## Ensure that GNU make doesn't remove Makefile if ./config.status (below)
  52. ## is interrupted. Otherwise, the user would need to know to rerun
  53. ## ./config.status to recreate the lost Makefile.
  54. .PRECIOUS: %MAKEFILE%
  55. ## This rule remakes the Makefile.
  56. %MAKEFILE%: %MAKEFILE-DEPS% $(top_builddir)/config.status
  57. ## If Makefile is to be updated because of config.status, then run
  58. ## config.status without argument in order to (i) rerun all the
  59. ## AC_CONFIG_COMMANDS including those that are not visible to
  60. ## Automake, and (ii) to save time by running config.status all with
  61. ## all the files, instead of once per file (iii) generate Makefiles
  62. ## in newly added directories.
  63. @case '$?' in \
  64. ## Don't prefix $(top_builddir), because GNU make will strip it out
  65. ## when it's '.'.
  66. *config.status*) \
  67. ?TOPDIR_P? echo ' $(SHELL) ./config.status'; \
  68. ?TOPDIR_P? $(SHELL) ./config.status;; \
  69. ?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
  70. *) \
  71. ## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
  72. ## .P files. Ideally we wouldn't have to do this by hand.
  73. echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
  74. cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \
  75. esac;
  76. ## Avoid the "deleted header file" problem for the dependencies.
  77. ## Add the trailing "$(am__empty)" to trick Automake into not spuriously
  78. ## complaining about "duplicated targets" in case the %MAKEFILE-IN-DEPS%
  79. ## list expands to a single target that is also declared in some
  80. ## user-defined rule.
  81. ?HAVE-MAKEFILE-IN-DEPS?%MAKEFILE-IN-DEPS% $(am__empty):
  82. DIST_COMMON += %MAKEFILE-AM%
  83. ## --------------------------- ##
  84. ## config.status & configure. ##
  85. ## --------------------------- ##
  86. if %?TOPDIR_P%
  87. ## Always require configure.ac and configure at top level, even if they
  88. ## don't exist. This is especially important for configure, since it
  89. ## won't be created until autoconf is run -- which might be after
  90. ## automake is run.
  91. DIST_COMMON += $(top_srcdir)/configure $(am__configure_deps)
  92. endif %?TOPDIR_P%
  93. $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
  94. ?TOPDIR_P? $(SHELL) ./config.status --recheck
  95. ?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  96. $(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps)
  97. ?TOPDIR_P? $(am__cd) $(srcdir) && $(AUTOCONF)
  98. ?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  99. ## ------------ ##
  100. ## aclocal.m4. ##
  101. ## ------------ ##
  102. ## Whenever a configure dependency changes we need to rebuild
  103. ## aclocal.m4 too. Changing configure.ac, or any file included by
  104. ## aclocal.m4 might require adding more files to aclocal.m4. Hence
  105. ## the $(am__configure_deps) dependency.
  106. ## We still need $(ACLOCAL_AMFLAGS) for sake of backward-compatibility;
  107. ## we should hopefully be able to get rid of it in a not-so-distant
  108. ## future.
  109. if %?REGEN-ACLOCAL-M4%
  110. $(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
  111. ?TOPDIR_P? $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
  112. ?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  113. ## Avoid the "deleted header file" problem for the dependencies.
  114. $(am__aclocal_m4_deps):
  115. endif %?REGEN-ACLOCAL-M4%
  116. ## --------- ##
  117. ## cleanup. ##
  118. ## --------- ##
  119. ## We special-case config.status here. If we do it as part of the
  120. ## normal clean processing for this directory, then it might be
  121. ## removed before some subdir is cleaned. However, that subdir's
  122. ## Makefile depends on config.status.
  123. if %?TOPDIR_P%
  124. am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  125. configure.lineno config.status.lineno
  126. distclean:
  127. -rm -f $(am__CONFIG_DISTCLEAN_FILES)
  128. ## Note: you might think we should remove Makefile.in, configure, or
  129. ## aclocal.m4 here in a maintainer-clean rule. However, the GNU
  130. ## Coding Standards explicitly prohibit this.
  131. maintainer-clean:
  132. -rm -f $(am__CONFIG_DISTCLEAN_FILES)
  133. ## autom4te.cache is created by Autoconf; the only valid target to
  134. ## remove it is maintainer-clean, not distclean.
  135. ## If you have an autom4te.cache that cause distcheck to fail, then
  136. ## it is good news: you finally discovered that autoconf and/or
  137. ## autoheader is needed to use your tarball, which is wrong.
  138. -rm -rf $(top_srcdir)/autom4te.cache
  139. endif %?TOPDIR_P%