Makefile.in 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. # Makefile.in
  2. #
  3. # Copyright © 2012, 2013 Brandon Invergo <brandon@invergo.net>
  4. # Copyright © 2014, 2015 Christopher Allan Webber <cwebber@dustycloud.org>
  5. #
  6. # Copying and distribution of this file, with or without modification,
  7. # are permitted in any medium without royalty provided the copyright
  8. # notice and this notice are preserved. This file is offered as-is,
  9. # without any warranty.
  10. # List whatever files you want to include in your source distribution here.
  11. # You can include whole directories but note that *everything* under that
  12. # directory will be included
  13. DISTFILES = PKG-INFO Makefile.in configure setup.py install-sh
  14. DESTDIR =
  15. VPATH = @srcdir@
  16. PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  17. PACKAGE_NAME = @PACKAGE_NAME@
  18. PACKAGE_STRING = @PACKAGE_STRING@
  19. PACKAGE_TARNAME = @PACKAGE_TARNAME@
  20. PACKAGE_DISTNAME = ${PACKAGE_NAME}-${PACKAGE_VERSION}
  21. PACKAGE_URL = @PACKAGE_URL@
  22. PACKAGE_VERSION = @PACKAGE_VERSION@
  23. PATH_SEPARATOR = @PATH_SEPARATOR@
  24. PYTHON = @PYTHON@
  25. VIRTUALENV = @VIRTUALENV@
  26. SHELL = @SHELL@
  27. MKDIR_P = @MKDIR_P@
  28. INSTALL = @INSTALL@
  29. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  30. INSTALL_DATA = @INSTALL_DATA@
  31. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  32. docdir = @docdir@
  33. dvidir = @dvidir@
  34. exec_prefix = @exec_prefix@
  35. htmldir = @htmldir@
  36. includedir = @includedir@
  37. infodir = @infodir@
  38. prefix = @prefix@
  39. srcdir = @srcdir@
  40. abs_srcdir = @abs_srcdir@
  41. datadir = @datadir@
  42. datarootdir = @datarootdir@
  43. pkgdatadir = $(datadir)/@PACKAGE_NAME@
  44. pkgincludedir = $(includedir)/@PACKAGE_NAME@
  45. PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
  46. USE_PYTHON3 = @USE_PYTHON3@
  47. EXTLIB_INSTALLS = extlib/jquery extlib/video.js extlib/leaflet extlib/tinymce
  48. # pkgpythondir = @pkgpythondir@
  49. # pkgpyexecdir = @pkgpyexecdir@
  50. # pythondir = @pythondir@
  51. # pyexecdir = @pyexecdir@
  52. # SPHINXBUILD = @SPHINXBUILD@
  53. # POSTGRES = @POSTGRES@
  54. # Maybe add a virtualenv prefix to a command
  55. ifneq ($(VIRTUALENV),no)
  56. # virtualenv specified to be included by config (default)
  57. # ... we only use virtualenv for local development, we don't
  58. # auto-deploy to it.
  59. maybe_venved = ./bin/
  60. maybe_venved_python = ./bin/python
  61. # Yes, build the virtualenv as a dependency!
  62. maybe_venv_dep = virtualenv
  63. # And to clean up!
  64. maybe_venv_clean = clean-virtualenv
  65. else
  66. # --without-virtualenv must have been passed in... don't build
  67. # a local virtualenv or use such commands
  68. maybe_venved =
  69. maybe_venved_python = $(PYTHON)
  70. # No need for commands to build virtualenv as a dependency!
  71. maybe_venv_dep =
  72. # Nor to clean up!
  73. maybe_venv_clean =
  74. endif
  75. .PHONY: all install uninstall distclean info install-html html \
  76. install-pdf pdf install-dvi dvi install-ps ps clean dist check \
  77. installdirs i18n virtualenv docs extlib
  78. # update postgresql
  79. all: develop
  80. docs:
  81. ifneq ($(VIRTUALENV),no)
  82. source bin/activate && cd docs && make html
  83. else
  84. cd docs && make html
  85. endif
  86. # In the future we may provide more options than just npm/bower here
  87. # eg, we may support guix updating.
  88. extlib:
  89. ./devtools/update_extlib.sh
  90. develop: $(maybe_venv_dep) i18n mediagoblin.ini
  91. # NEVER clobber a user's mediagoblin.ini once they've defined it
  92. mediagoblin.ini:
  93. cp -n mediagoblin.example.ini mediagoblin.ini
  94. # base-configs: paste.ini mediagoblin.example.ini
  95. install: installdirs
  96. $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
  97. # In the future, maybe we can compile the individual .po files here?
  98. i18n: $(maybe_venv_dep)
  99. ./devtools/compile_translations.sh
  100. ifneq ($(VIRTUALENV),no)
  101. ./bin/python:
  102. rm -f ./bin/python
  103. ${VIRTUALENV} --system-site-packages --python=$(PYTHON) .
  104. ./bin/python setup.py develop --upgrade
  105. virtualenv: bin/python extlib
  106. clean-virtualenv:
  107. rm -rf ./bin/
  108. rm -rf ./lib/
  109. rm -rf ./include/
  110. endif
  111. # setup.py doesn't (yet) support an uninstall command, so until it does, you
  112. # must manually remove everything that was installed here. The following example
  113. # should remove a basic package installed via setup.py, but please double- and
  114. # triple-check it so that you don't remove something you shouldn't!
  115. # Be sure to remove any extra files you install, such as binaries or documentation!
  116. #
  117. # uninstall:
  118. # rm -rvf $(pkgpythondir)
  119. # rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
  120. #
  121. # We don't know what this does yet.
  122. # Originally:
  123. ## Just use the usual setup.py clean command
  124. #clean:
  125. # $(maybe_venved_python) setup.py clean
  126. clean:
  127. @echo "No rule to clean house, yet."
  128. @echo "distclean works but might do more than you want. :)"
  129. # It's not obvious to me whether the virtualenv/bower/npm things should be
  130. # auto-cleaned as part of distclean. I'm leaning towards "yes" for now but
  131. # I'm not really happy about that.
  132. # Clean up the output of configure
  133. distclean: $(maybe_venv_clean)
  134. rm -vf $(srcdir)/config.log
  135. rm -vf $(srcdir)/config.status
  136. rm -rvf $(srcdir)/autom4te.cache
  137. rm -vf $(srcdir)/aclocal.m4
  138. rm -rf $(EXTLIB_INSTALLS)
  139. rm -rf node_modules
  140. rm -vf $(srcdir)/Makefile
  141. check:
  142. ./runtests.sh
  143. ###########################################################################
  144. # These things aren't really tested / supported yet.
  145. ###########################################################################
  146. ## NOTE: We don't use this yet, we use ./devtools/maketarball.sh
  147. ## We can't switch out ./devtools/maketarball.sh in here because
  148. ## it requires a git revision as a first argument, which
  149. ## doesn't always work here
  150. dist: $(maybe_venv_dep)
  151. $(maybe_venved_python) setup.py sdist
  152. # setup.py might complain if a directory doesn't exist so just in case, make the directory
  153. # here
  154. installdirs:
  155. $(MKDIR_P) $(DESTDIR)$(prefix)
  156. ######################
  157. # Needs to be updated?
  158. ######################
  159. # The following show how to install documentation. In this example,
  160. # docs are built from a separate Makefile contained in the docs
  161. # directory which uses the SPHINXBUILD variable to store the location
  162. # of the sphinx-build (Python doc tool) binary to use.
  163. $(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info
  164. $(POST_INSTALL)
  165. $(INSTALL_DATA) @< $(DESTDIR)$@
  166. if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then
  167. install-info --dir-file=$(DESTDIR)$(infodir)/dir \
  168. $(DESTDIR)$(infodir)/foo.info;
  169. else true; fi
  170. info: docs/build/texinfo/mediagoblin.info
  171. docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*)
  172. ifneq ($(VIRTUALENV),no)
  173. source bin/activate && cd docs && make info
  174. else
  175. cd docs && make info
  176. endif
  177. install-html: html installdirs
  178. $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir)
  179. html: docs