2
0

scripts.am 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ## automake - create Makefile.in from Makefile.am
  2. ## Copyright (C) 1994-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. if %?INSTALL%
  14. include inst-vars.am
  15. endif %?INSTALL%
  16. ## ------------ ##
  17. ## Installing. ##
  18. ## ------------ ##
  19. if %?INSTALL%
  20. ## if doesn't work properly for Automake variables yet.
  21. am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
  22. ?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
  23. ?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
  24. install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
  25. @$(NORMAL_INSTALL)
  26. ## Funny invocation because Makefile variable can be empty, leading to
  27. ## a syntax error in sh.
  28. @list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || list=; \
  29. if test -n "$$list"; then \
  30. echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
  31. $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
  32. fi; \
  33. ?!BASE? $(am__nobase_strip_setup); \
  34. for p in $$list; do \
  35. ## A file can be in the source directory or the build directory.
  36. if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
  37. ## A script may or may not exist.
  38. if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
  39. done | \
  40. ## We now have a list of "sourcefile newline (nobase-)target" pairs.
  41. ## Turn that into "sourcefile source_base target_dir xformed_target_base",
  42. ## with newlines being turned into spaces in a second step.
  43. sed -e 'p;s,.*/,,;n' \
  44. ?BASE? -e 'h;s|.*|.|' \
  45. ?!BASE? -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \
  46. -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
  47. $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
  48. { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
  49. if ($$2 == $$4) { files[d] = files[d] " " $$1; \
  50. if (++n[d] == $(am__install_max)) { \
  51. print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
  52. else { print "f", d "/" $$4, $$1 } } \
  53. END { for (d in files) print "f", d, files[d] }' | \
  54. while read type dir files; do \
  55. ?!BASE? case $$type in \
  56. ?!BASE? d) echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
  57. ?!BASE? $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?;; \
  58. ?!BASE? f) \
  59. if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
  60. test -z "$$files" || { \
  61. echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(%NDIR%dir)$$dir'"; \
  62. $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(%NDIR%dir)$$dir" || exit $$?; \
  63. } \
  64. ?!BASE? ;; esac \
  65. ; done
  66. endif %?INSTALL%
  67. ## -------------- ##
  68. ## Uninstalling. ##
  69. ## -------------- ##
  70. if %?INSTALL%
  71. .PHONY uninstall-am: uninstall-%DIR%SCRIPTS
  72. uninstall-%DIR%SCRIPTS:
  73. @$(NORMAL_UNINSTALL)
  74. @list='$(%DIR%_SCRIPTS)'; test -n "$(%NDIR%dir)" || exit 0; \
  75. ?BASE? files=`for p in $$list; do echo "$$p"; done | \
  76. ?BASE? sed -e 's,.*/,,;$(transform)'`; \
  77. ?!BASE? $(am__nobase_strip_setup); \
  78. ?!BASE? files=`$(am__nobase_strip) \
  79. ?!BASE? -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \
  80. dir='$(DESTDIR)$(%NDIR%dir)'; $(am__uninstall_files_from_dir)
  81. endif %?INSTALL%
  82. ## -------------- ##
  83. ## Distributing. ##
  84. ## -------------- ##
  85. if %?DIST%
  86. DIST_COMMON += %DISTVAR%
  87. endif %?DIST%
  88. ## ---------- ##
  89. ## Checking. ##
  90. ## ---------- ##
  91. if %?CK-OPTS%
  92. .PHONY installcheck-am: installcheck-%DIR%SCRIPTS
  93. installcheck-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
  94. bad=0; pid=$$$$; list="$(%DIR%_SCRIPTS)"; for p in $$list; do \
  95. case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
  96. ## Match $(srcdir)/$$p in addition to $$p because Sun make might rewrite
  97. ## filenames in AM_INSTALLCHECK_STD_OPTIONS_EXEMPT during VPATH builds.
  98. *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
  99. esac; \
  100. ## Strip any leading directory before applying $(transform).
  101. f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \
  102. ## Insert the directory back if nobase_ is used.
  103. ?!BASE? f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
  104. for opt in --help --version; do \
  105. if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \
  106. 2>c$${pid}_.err </dev/null \
  107. && test -n "`cat c$${pid}_.out`" \
  108. && test -z "`cat c$${pid}_.err`"; then :; \
  109. else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
  110. done; \
  111. done; rm -f c$${pid}_.???; exit $$bad
  112. endif %?CK-OPTS%