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