Migration for #5415 - I forgot it, Doh!
[mediagoblin.git] / Makefile.in
index 2ca4101a77596832699ecf7078548c674db1ae99..56e8a6838d5cda7565ef0532d0f8ad3569c1f98c 100644 (file)
@@ -1,6 +1,7 @@
 # Makefile.in
 #
 # Copyright © 2012, 2013 Brandon Invergo <brandon@invergo.net>
+# Copyright © 2014, 2015 Christopher Allan Webber <cwebber@dustycloud.org>
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
@@ -46,6 +47,8 @@ pkgincludedir = $(includedir)/@PACKAGE_NAME@
 PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
 USE_PYTHON3 = @USE_PYTHON3@
 
+EXTLIB_INSTALLS = extlib/jquery extlib/video.js extlib/leaflet extlib/tinymce
+
 # pkgpythondir = @pkgpythondir@
 # pkgpyexecdir = @pkgpyexecdir@
 # pythondir = @pythondir@
@@ -63,7 +66,9 @@ ifneq ($(VIRTUALENV),no)
 maybe_venved = ./bin/
 maybe_venved_python = ./bin/python
 # Yes, build the virtualenv as a dependency!
-maybe_venv_dep = ./bin/python
+maybe_venv_dep = virtualenv
+# And to clean up!
+maybe_venv_clean = clean-virtualenv
 
 else
 # --without-virtualenv must have been passed in... don't build
@@ -72,19 +77,35 @@ maybe_venved =
 maybe_venved_python = $(PYTHON)
 # No need for commands to build virtualenv as a dependency!
 maybe_venv_dep = 
+# Nor to clean up!
+maybe_venv_clean = 
 endif
 
-
-
 .PHONY: all install uninstall distclean info install-html html \
 install-pdf pdf install-dvi dvi install-ps ps clean dist check \
-installdirs i18n virtualenv
+installdirs i18n virtualenv docs extlib
+
 # update postgresql
 
 all: develop
 
-develop: $(maybe_venv_dep) i18n
-       echo "nothin yet"
+docs:
+ifneq ($(VIRTUALENV),no)
+       source bin/activate && cd docs && make html
+else
+       cd docs && make html
+endif
+
+# In the future we may provide more options than just npm/bower here
+# eg, we may support guix updating.
+extlib:
+       ./devtools/update_extlib.sh
+
+develop: $(maybe_venv_dep) i18n mediagoblin.ini
+
+# NEVER clobber a user's mediagoblin.ini once they've defined it
+mediagoblin.ini:
+       cp -n mediagoblin.example.ini mediagoblin.ini
 
 # base-configs: paste.ini mediagoblin.example.ini
 
@@ -92,21 +113,23 @@ install: installdirs
        $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
 
 
+# In the future, maybe we can compile the individual .po files here?
 i18n: $(maybe_venv_dep)
-       $(maybe_venved)pybabel compile -D mediagoblin -d mediagoblin/i18n/
+       ./devtools/compile_translations.sh
 
 
 ifneq ($(VIRTUALENV),no)
 ./bin/python:
        rm -f ./bin/python
-       virtualenv --system-site-packages .
+       ${VIRTUALENV} --system-site-packages --python=$(PYTHON) .
        ./bin/python setup.py develop --upgrade
 
-virtualenv: bin/python
+virtualenv: bin/python extlib
 
 clean-virtualenv:
        rm -rf ./bin/
        rm -rf ./lib/
+       rm -rf ./include/
 endif
 
 # setup.py doesn't (yet) support an uninstall command, so until it does, you 
@@ -120,50 +143,54 @@ endif
 #      rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
 # 
 
-# Just use the usual setup.py clean command
+# We don't know what this does yet.
+# Originally:
+## Just use the usual setup.py clean command
+#clean:
+#      $(maybe_venved_python) setup.py clean
 clean:
-       $(maybe_venved_python) setup.py clean
+       @echo "No rule to clean house, yet."
+       @echo "distclean works but might do more than you want. :)"
+
 
+# It's not obvious to me whether the virtualenv/bower/npm things should be
+# auto-cleaned as part of distclean.  I'm leaning towards "yes" for now but
+# I'm not really happy about that.
 
 # Clean up the output of configure
-distclean: 
-       rm -v $(srcdir)/config.log
-       rm -v $(srcdir)/config.status
+distclean: $(maybe_venv_clean)
+       rm -vf $(srcdir)/config.log
+       rm -vf $(srcdir)/config.status
        rm -rvf $(srcdir)/autom4te.cache
-       rm -v $(srcdir)/aclocal.m4
-       rm -v $(srcdir)/Makefile
-       rm -v $(srcdir)/env
+       rm -vf $(srcdir)/aclocal.m4
+       rm -rf $(EXTLIB_INSTALLS)
+       rm -rf node_modules
+       rm -vf $(srcdir)/Makefile
 
+check:
+       ./runtests.sh
 
-# You can either use the setup.py sdist command or you can roll your own here
-dist:
-#      $(maybe_venved_python) setup.py sdist
-       mkdir $(PACKAGE_DISTNAME)
-       cp -r $(DISTFILES) $(PACKAGE_DISTNAME)
-       tar -czf $(PACKAGE_DISTNAME).tar.gz $(PACKAGE_DISTNAME)
-       rm -rf $(PACKAGE_DISTNAME)
+###########################################################################
+# These things aren't really tested / supported yet.
+###########################################################################
 
-# Use the setup.py check command
-check:
-       $(maybe_venved_python) setup.py check
+
+## NOTE: We don't use this yet, we use ./devtools/maketarball.sh
+##   We can't switch out ./devtools/maketarball.sh in here because
+##   it requires a git revision as a first argument, which
+##   doesn't always work here
+
+dist: $(maybe_venv_dep)
+       $(maybe_venved_python) setup.py sdist
 
 # setup.py might complain if a directory doesn't exist so just in case, make the directory
 # here
 installdirs:
        $(MKDIR_P) $(DESTDIR)$(prefix)
 
-# # Set up PostgreSQL
-# postgresql:
-#      sudo -u $(POSTGRES) createuser mediagoblin
-#      sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
-
-# update:
-# ifneq ($(VIRTUALENV),no)
-#      $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
-# else
-#      $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
-# endif        
-#      $(prefix)/bin/gmg dbupdate
+######################
+# Needs to be updated?
+######################
 
 # The following show how to install documentation. In this example,
 # docs are built from a separate Makefile contained in the docs
@@ -181,41 +208,14 @@ $(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info
 info: docs/build/texinfo/mediagoblin.info
 
 docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*)
-ifneq ($(SPHINXBUILD),no)
-       $(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD)
+ifneq ($(VIRTUALENV),no)
+       source bin/activate && cd docs && make info
+else
+       cd docs && make info
 endif
 
 
 install-html: html installdirs
        $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir)
 
-html: docs/build/html/index.html
-
-docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*)
-ifneq ($(SPHINXBUILD),no)
-       $(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD)
-endif
-
-
-install-pdf: pdf installdirs
-       $(INSTALL_DATA) docs/build/latex/mediagoblin.pdf $(DESTDIR)$(pdfdir)
-
-pdf: docs/build/latex/mediagoblin.pdf
-
-docs/build/latex/mediagoblin.pdf: $(wildcard $(srcdir)/docs/source/*)
-ifneq ($(SPHINXBUILD),no)
-       $(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD)
-endif
-
-
-# Targets that don't seem supported?
-
-install-dvi:
-
-dvi:
-
-install-ps:
-
-ps:
-
-
+html: docs