ltlib.am 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
  21. ?EXEC?.PHONY install-exec-am: install-%DIR%LTLIBRARIES
  22. ?!EXEC?.PHONY install-data-am: install-%DIR%LTLIBRARIES
  23. install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
  24. @$(NORMAL_INSTALL)
  25. if %?BASE%
  26. ## Funny invocation because Makefile variable can be empty, leading to
  27. ## a syntax error in sh.
  28. @list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
  29. list2=; for p in $$list; do \
  30. if test -f $$p; then \
  31. list2="$$list2 $$p"; \
  32. else :; fi; \
  33. done; \
  34. test -z "$$list2" || { \
  35. echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
  36. $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
  37. ## Note that we explicitly set the libtool mode. This avoids any lossage
  38. ## if the program doesn't have a name that libtool expects.
  39. ## Use INSTALL and not INSTALL_DATA because libtool knows the right
  40. ## permissions to use.
  41. ?LIBTOOL? echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(%NDIR%dir)'"; \
  42. ?LIBTOOL? $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(%NDIR%dir)"; \
  43. ?!LIBTOOL? echo " $(INSTALL) $(INSTALL_STRIP_FLAG) $$list '$(DESTDIR)$(%NDIR%dir)'"; \
  44. ?!LIBTOOL? $(INSTALL) $(INSTALL_STRIP_FLAG) $$list "$(DESTDIR)$(%NDIR%dir)"; \
  45. }
  46. else !%?BASE%
  47. @list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
  48. if test -n "$$list"; then \
  49. echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
  50. $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
  51. fi; \
  52. for p in $$list; do if test -f "$$p"; then echo "$$p $$p"; else :; fi; done | \
  53. sed '/ .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
  54. $(AWK) 'BEGIN { cur = "." } \
  55. { if ($$2 == cur) { files = files " " $$1 } \
  56. else { print cur, files; files = $$1; cur = $$2 } } \
  57. END { print cur, files }' | \
  58. while read dir files; do \
  59. test -z "$$files" || { \
  60. test "x$$dir" = x. || { \
  61. echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
  62. $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
  63. ## Note that we explicitly set the libtool mode. This avoids any lossage
  64. ## if the program doesn't have a name that libtool expects.
  65. ## Use INSTALL and not INSTALL_DATA because libtool knows the right
  66. ## permissions to use.
  67. ?LIBTOOL? echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$files '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
  68. ?LIBTOOL? $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$files "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; \
  69. ?!LIBTOOL? echo " $(INSTALL) $(INSTALL_STRIP_FLAG) $$files '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
  70. ?!LIBTOOL? $(INSTALL) $(INSTALL_STRIP_FLAG) $$files "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; \
  71. }; \
  72. done
  73. endif !%?BASE%
  74. endif %?INSTALL%
  75. ## -------------- ##
  76. ## Uninstalling. ##
  77. ## -------------- ##
  78. if %?INSTALL%
  79. .PHONY uninstall-am: uninstall-%DIR%LTLIBRARIES
  80. uninstall-%DIR%LTLIBRARIES:
  81. @$(NORMAL_UNINSTALL)
  82. @list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
  83. for p in $$list; do \
  84. ?BASE? $(am__strip_dir) \
  85. ?!BASE? f=$$p; \
  86. ?LIBTOOL? echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
  87. ?LIBTOOL? $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
  88. ?!LIBTOOL? echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
  89. ?!LIBTOOL? rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
  90. done
  91. endif %?INSTALL%
  92. ## ---------- ##
  93. ## Cleaning. ##
  94. ## ---------- ##
  95. .PHONY clean-am: clean-%DIR%LTLIBRARIES
  96. clean-%DIR%LTLIBRARIES:
  97. -test -z "$(%DIR%_LTLIBRARIES)" || rm -f $(%DIR%_LTLIBRARIES)
  98. ## 'so_locations' files are created by some linkers (IRIX, OSF) when
  99. ## building a shared object. Libtool places these files in the
  100. ## directory where the shared object is created.
  101. @list='$(%DIR%_LTLIBRARIES)'; \
  102. locs=`for p in $$list; do echo $$p; done | \
  103. sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
  104. sort -u`; \
  105. test -z "$$locs" || { \
  106. echo rm -f $${locs}; \
  107. rm -f $${locs}; \
  108. }