Add myself to the copyrights of Makefile.in
[mediagoblin.git] / Makefile.in
CommitLineData
0a2eecf8
BI
1# Makefile.in
2#
3# Copyright © 2012, 2013 Brandon Invergo <brandon@invergo.net>
94eb44d6 4# Copyright © 2014, 2015 Christopher Allan Webber <cwebber@dustycloud.org>
0a2eecf8
BI
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
11# List whatever files you want to include in your source distribution here.
12# You can include whole directories but note that *everything* under that
13# directory will be included
14DISTFILES = PKG-INFO Makefile.in configure setup.py install-sh
15
16DESTDIR =
17VPATH = @srcdir@
18PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
19PACKAGE_NAME = @PACKAGE_NAME@
20PACKAGE_STRING = @PACKAGE_STRING@
21PACKAGE_TARNAME = @PACKAGE_TARNAME@
22PACKAGE_DISTNAME = ${PACKAGE_NAME}-${PACKAGE_VERSION}
23PACKAGE_URL = @PACKAGE_URL@
24PACKAGE_VERSION = @PACKAGE_VERSION@
25PATH_SEPARATOR = @PATH_SEPARATOR@
26PYTHON = @PYTHON@
27VIRTUALENV = @VIRTUALENV@
0a2eecf8
BI
28SHELL = @SHELL@
29MKDIR_P = @MKDIR_P@
30INSTALL = @INSTALL@
31INSTALL_PROGRAM = @INSTALL_PROGRAM@
32INSTALL_DATA = @INSTALL_DATA@
33INSTALL_SCRIPT = @INSTALL_SCRIPT@
34docdir = @docdir@
35dvidir = @dvidir@
36exec_prefix = @exec_prefix@
37htmldir = @htmldir@
38includedir = @includedir@
39infodir = @infodir@
40prefix = @prefix@
41srcdir = @srcdir@
e56b493a 42abs_srcdir = @abs_srcdir@
0a2eecf8
BI
43datadir = @datadir@
44datarootdir = @datarootdir@
0a2eecf8
BI
45pkgdatadir = $(datadir)/@PACKAGE_NAME@
46pkgincludedir = $(includedir)/@PACKAGE_NAME@
0a2eecf8 47PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
65686465 48USE_PYTHON3 = @USE_PYTHON3@
0a2eecf8 49
d466977d
CAW
50EXTLIB_INSTALLS = extlib/jquery extlib/video.js extlib/leaflet extlib/tinymce
51
96f9c530
CAW
52# pkgpythondir = @pkgpythondir@
53# pkgpyexecdir = @pkgpyexecdir@
54# pythondir = @pythondir@
55# pyexecdir = @pyexecdir@
56# SPHINXBUILD = @SPHINXBUILD@
57# POSTGRES = @POSTGRES@
58
59
07778a69
CAW
60# Maybe add a virtualenv prefix to a command
61ifneq ($(VIRTUALENV),no)
62# virtualenv specified to be included by config (default)
63# ... we only use virtualenv for local development, we don't
64# auto-deploy to it.
0a2eecf8 65
07778a69
CAW
66maybe_venved = ./bin/
67maybe_venved_python = ./bin/python
68# Yes, build the virtualenv as a dependency!
d466977d 69maybe_venv_dep = virtualenv
1da574c6
CAW
70# And to clean up!
71maybe_venv_clean = clean-virtualenv
0a2eecf8 72
0a2eecf8 73else
07778a69
CAW
74# --without-virtualenv must have been passed in... don't build
75# a local virtualenv or use such commands
76maybe_venved =
77maybe_venved_python = $(PYTHON)
78# No need for commands to build virtualenv as a dependency!
79maybe_venv_dep =
1da574c6
CAW
80# Nor to clean up!
81maybe_venv_clean =
0a2eecf8 82endif
07778a69 83
07778a69
CAW
84.PHONY: all install uninstall distclean info install-html html \
85install-pdf pdf install-dvi dvi install-ps ps clean dist check \
572106e2 86installdirs i18n virtualenv docs extlib
2f841a6c 87
07778a69
CAW
88# update postgresql
89
90all: develop
91
2f841a6c 92docs:
d466977d 93ifneq ($(VIRTUALENV),no)
2f841a6c
CAW
94 source bin/activate && cd docs && make html
95else
96 cd docs && make html
97endif
98
572106e2
CAW
99# In the future we may provide more options than just npm/bower here
100# eg, we may support guix updating.
101extlib:
102 ./devtools/update_extlib.sh
103
2b475821 104develop: $(maybe_venv_dep) i18n mediagoblin.ini
adecace3 105
86f89fd0 106# NEVER clobber a user's mediagoblin.ini once they've defined it
b2624eb0
CAW
107mediagoblin.ini:
108 cp --no-clobber mediagoblin.example.ini mediagoblin.ini
109
96f9c530
CAW
110# base-configs: paste.ini mediagoblin.example.ini
111
07778a69
CAW
112install: installdirs
113 $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
114
115
4aaa7fac 116# In the future, maybe we can compile the individual .po files here?
07778a69 117i18n: $(maybe_venv_dep)
4aaa7fac 118 ./devtools/compile_translations.sh
07778a69
CAW
119
120
0a2eecf8 121ifneq ($(VIRTUALENV),no)
07778a69
CAW
122./bin/python:
123 rm -f ./bin/python
1da574c6 124 virtualenv --system-site-packages --python=$(PYTHON) .
07778a69 125 ./bin/python setup.py develop --upgrade
0a2eecf8 126
572106e2 127virtualenv: bin/python extlib
96f9c530
CAW
128
129clean-virtualenv:
130 rm -rf ./bin/
131 rm -rf ./lib/
90c2989b 132 rm -rf ./include/
07778a69 133endif
0a2eecf8
BI
134
135# setup.py doesn't (yet) support an uninstall command, so until it does, you
136# must manually remove everything that was installed here. The following example
137# should remove a basic package installed via setup.py, but please double- and
138# triple-check it so that you don't remove something you shouldn't!
139# Be sure to remove any extra files you install, such as binaries or documentation!
a9dc855a 140#
297a262c 141# uninstall:
a9dc855a
CAW
142# rm -rvf $(pkgpythondir)
143# rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
144#
0a2eecf8 145
86f89fd0 146
0a2eecf8 147clean:
86f89fd0 148 @echo "No rule to clean house, yet."
9cc496f4 149 @echo "distclean works but might do more than you want. :)"
86f89fd0
CAW
150
151
152# We don't know what this does yet.
153# Originally:
154## Just use the usual setup.py clean command
155#clean:
156# $(maybe_venved_python) setup.py clean
157
0a2eecf8 158
d466977d
CAW
159# It's not obvious to me whether the virtualenv/bower/npm things should be
160# auto-cleaned as part of distclean. I'm leaning towards "yes" for now but
161# I'm not really happy about that.
0a2eecf8
BI
162
163# Clean up the output of configure
1da574c6
CAW
164distclean: $(maybe_venv_clean)
165 rm -vf $(srcdir)/config.log
166 rm -vf $(srcdir)/config.status
0a2eecf8 167 rm -rvf $(srcdir)/autom4te.cache
1da574c6 168 rm -vf $(srcdir)/aclocal.m4
d466977d
CAW
169 rm -rf $(EXTLIB_INSTALLS)
170 rm -rf node_modules
1da574c6 171 rm -vf $(srcdir)/Makefile
96f9c530 172
0a2eecf8 173
2b475821
CAW
174###########################################################################
175# These things aren't really tested / supported yet.
176###########################################################################
177
178
179
0a2eecf8 180# You can either use the setup.py sdist command or you can roll your own here
572106e2 181dist: extlib
07778a69 182# $(maybe_venved_python) setup.py sdist
0a2eecf8
BI
183 mkdir $(PACKAGE_DISTNAME)
184 cp -r $(DISTFILES) $(PACKAGE_DISTNAME)
185 tar -czf $(PACKAGE_DISTNAME).tar.gz $(PACKAGE_DISTNAME)
186 rm -rf $(PACKAGE_DISTNAME)
187
188# Use the setup.py check command
189check:
07778a69 190 $(maybe_venved_python) setup.py check
0a2eecf8
BI
191
192# setup.py might complain if a directory doesn't exist so just in case, make the directory
193# here
194installdirs:
d45673c0 195 $(MKDIR_P) $(DESTDIR)$(prefix)
0a2eecf8 196
07778a69
CAW
197# # Set up PostgreSQL
198# postgresql:
199# sudo -u $(POSTGRES) createuser mediagoblin
200# sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
0a2eecf8 201
07778a69
CAW
202# update:
203# ifneq ($(VIRTUALENV),no)
204# $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
205# else
206# $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
207# endif
208# $(prefix)/bin/gmg dbupdate
0a2eecf8 209
2b475821
CAW
210######################
211# Needs to be updated?
212######################
213
0a2eecf8
BI
214# The following show how to install documentation. In this example,
215# docs are built from a separate Makefile contained in the docs
216# directory which uses the SPHINXBUILD variable to store the location
217# of the sphinx-build (Python doc tool) binary to use.
218
219$(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info
220 $(POST_INSTALL)
221 $(INSTALL_DATA) @< $(DESTDIR)$@
222 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then
223 install-info --dir-file=$(DESTDIR)$(infodir)/dir \
224 $(DESTDIR)$(infodir)/foo.info;
225 else true; fi
226
227info: docs/build/texinfo/mediagoblin.info
228
229docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*)
230ifneq ($(SPHINXBUILD),no)
231 $(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD)
232endif
233
234
235install-html: html installdirs
236 $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir)
237
238html: docs/build/html/index.html
239
240docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*)
241ifneq ($(SPHINXBUILD),no)
242 $(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD)
243endif
244
245
246install-pdf: pdf installdirs
247 $(INSTALL_DATA) docs/build/latex/mediagoblin.pdf $(DESTDIR)$(pdfdir)
248
249pdf: docs/build/latex/mediagoblin.pdf
250
251docs/build/latex/mediagoblin.pdf: $(wildcard $(srcdir)/docs/source/*)
252ifneq ($(SPHINXBUILD),no)
253 $(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD)
254endif
255
256
07778a69
CAW
257# Targets that don't seem supported?
258
0a2eecf8
BI
259install-dvi:
260
261dvi:
262
263install-ps:
264
265ps:
266
267