python.am 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. ## automake - create Makefile.in from Makefile.am
  2. ## Copyright (C) 1999-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. ?FIRST?am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
  17. ## ------------ ##
  18. ## Installing. ##
  19. ## ------------ ##
  20. if %?INSTALL%
  21. am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
  22. ?EXEC?.PHONY install-exec-am: install-%DIR%PYTHON
  23. ?!EXEC?.PHONY install-data-am: install-%DIR%PYTHON
  24. install-%DIR%PYTHON: $(%DIR%_PYTHON)
  25. @$(NORMAL_INSTALL)
  26. if %?BASE%
  27. @list='$(%DIR%_PYTHON)'; dlist=; list2=; test -n "$(%NDIR%dir)" || list=; \
  28. if test -n "$$list"; then \
  29. echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
  30. $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
  31. fi; \
  32. for p in $$list; do \
  33. ## A file can be in the source directory or the build directory.
  34. if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
  35. if test -f $$b$$p; then \
  36. ## Compute basename of source file. Unless this is a nobase_ target, we
  37. ## want to install 'python/foo.py' as '$(DESTDIR)$(%NDIR%dir)/foo.py',
  38. ## not '$(DESTDIR)$(%NDIR%dir)/python/foo.py'.
  39. $(am__strip_dir) \
  40. dlist="$$dlist $$f"; \
  41. list2="$$list2 $$b$$p"; \
  42. else :; fi; \
  43. done; \
  44. for file in $$list2; do echo $$file; done | $(am__base_list) | \
  45. while read files; do \
  46. ## Don't perform translation, since script name is important.
  47. echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(%NDIR%dir)'"; \
  48. $(INSTALL_DATA) $$files "$(DESTDIR)$(%NDIR%dir)" || exit $$?; \
  49. done || exit $$?; \
  50. ## Byte-compile must be done at install time, since file times are
  51. ## encoded in the actual files.
  52. if test -n "$$dlist"; then \
  53. $(am__py_compile) --destdir "$(DESTDIR)" \
  54. --basedir "$(%NDIR%dir)" $$dlist; \
  55. else :; fi
  56. else !%?BASE%
  57. @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \
  58. if test -n "$$list"; then \
  59. echo " $(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)'"; \
  60. $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)" || exit 1; \
  61. fi; \
  62. $(am__nobase_list) | { while read dir files; do \
  63. xfiles=; for p in $$files; do \
  64. ## A file can be in the source directory or the build directory.
  65. if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
  66. if test -f "$$b$$p"; then xfiles="$$xfiles $$b$$p"; dlist="$$dlist $$p"; \
  67. else :; fi; done; \
  68. test -z "$$xfiles" || { \
  69. test "x$$dir" = x. || { \
  70. echo "$(MKDIR_P) '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
  71. $(MKDIR_P) "$(DESTDIR)$(%NDIR%dir)/$$dir"; }; \
  72. ## Don't perform translation, since script name is important.
  73. echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(%NDIR%dir)/$$dir'"; \
  74. $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(%NDIR%dir)/$$dir" || exit $$?; }; \
  75. done; \
  76. ## Byte-compile must be done at install time, since file times are
  77. ## encoded in the actual files.
  78. if test -n "$$dlist"; then \
  79. $(am__py_compile) --destdir "$(DESTDIR)" \
  80. --basedir "$(%NDIR%dir)" $$dlist; \
  81. else :; fi; }
  82. endif !%?BASE%
  83. endif %?INSTALL%
  84. ## -------------- ##
  85. ## Uninstalling. ##
  86. ## -------------- ##
  87. if %?INSTALL%
  88. ?FIRST?am__pep3147_tweak = \
  89. ?FIRST? sed -e 's|\.py$$||' -e 's|[^/]*$$|__pycache__/&.*.py|'
  90. .PHONY uninstall-am: uninstall-%DIR%PYTHON
  91. uninstall-%DIR%PYTHON:
  92. @$(NORMAL_UNINSTALL)
  93. @list='$(%DIR%_PYTHON)'; test -n "$(%NDIR%dir)" || list=; \
  94. ?BASE? py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
  95. ?!BASE? $(am__nobase_strip_setup); py_files=`$(am__nobase_strip)`; \
  96. test -n "$$py_files" || exit 0; \
  97. dir='$(DESTDIR)$(%NDIR%dir)'; \
  98. ## Also remove the .pyc and .pyo byte compiled versions.
  99. ## This is somewhat tricky, because for newer pythons we have to take
  100. ## PEP-3147 into account.
  101. pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \
  102. pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \
  103. py_files_pep3147=`echo "$$py_files" | $(am__pep3147_tweak)`; \
  104. echo "$$py_files_pep3147";\
  105. pyc_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|c|'`; \
  106. pyo_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|o|'`; \
  107. st=0; \
  108. for files in \
  109. "$$py_files" \
  110. "$$pyc_files" \
  111. "$$pyo_files" \
  112. ## Installation of '.py' files is not influenced by PEP-3147, so it
  113. ## is correct *not* to have $pyfiles_pep3147 here.
  114. "$$pyc_files_pep3147" \
  115. "$$pyo_files_pep3147" \
  116. ; do \
  117. $(am__uninstall_files_from_dir) || st=$$?; \
  118. done; \
  119. exit $$st
  120. endif %?INSTALL%
  121. ## ---------- ##
  122. ## Cleaning. ##
  123. ## ---------- ##
  124. ## There is nothing to clean here since files are
  125. ## byte-compiled when (and where) they are installed.
  126. ## -------------- ##
  127. ## Distributing. ##
  128. ## -------------- ##
  129. if %?DIST%
  130. DIST_COMMON += %DISTVAR%
  131. endif %?DIST%