Set USE_PYTHON3 to yes/no depending on whether --with-python3 enabled
[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
0a2eecf8 67
0a2eecf8 68else
07778a69
CAW
69# --without-virtualenv must have been passed in... don't build
70# a local virtualenv or use such commands
71maybe_venved =
72maybe_venved_python = $(PYTHON)
73# No need for commands to build virtualenv as a dependency!
74maybe_venv_dep =
0a2eecf8 75endif
07778a69
CAW
76
77
78
79.PHONY: all install uninstall distclean info install-html html \
80install-pdf pdf install-dvi dvi install-ps ps clean dist check \
81installdirs i18n virtualenv
82# update postgresql
83
84all: develop
85
96f9c530 86develop: $(maybe_venv_dep) i18n
07778a69
CAW
87 echo "nothin yet"
88
96f9c530
CAW
89# base-configs: paste.ini mediagoblin.example.ini
90
07778a69
CAW
91install: installdirs
92 $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
93
94
95i18n: $(maybe_venv_dep)
96 $(maybe_venved)pybabel compile -D mediagoblin -d mediagoblin/i18n/
97
98
0a2eecf8 99ifneq ($(VIRTUALENV),no)
07778a69
CAW
100./bin/python:
101 rm -f ./bin/python
102 virtualenv --system-site-packages .
103 ./bin/python setup.py develop --upgrade
0a2eecf8 104
07778a69 105virtualenv: bin/python
96f9c530
CAW
106
107clean-virtualenv:
108 rm -rf ./bin/
109 rm -rf ./lib/
07778a69 110endif
0a2eecf8
BI
111
112# setup.py doesn't (yet) support an uninstall command, so until it does, you
113# must manually remove everything that was installed here. The following example
114# should remove a basic package installed via setup.py, but please double- and
115# triple-check it so that you don't remove something you shouldn't!
116# Be sure to remove any extra files you install, such as binaries or documentation!
a9dc855a 117#
297a262c 118# uninstall:
a9dc855a
CAW
119# rm -rvf $(pkgpythondir)
120# rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info
121#
0a2eecf8
BI
122
123# Just use the usual setup.py clean command
124clean:
07778a69 125 $(maybe_venved_python) setup.py clean
0a2eecf8
BI
126
127
128# Clean up the output of configure
129distclean:
130 rm -v $(srcdir)/config.log
131 rm -v $(srcdir)/config.status
132 rm -rvf $(srcdir)/autom4te.cache
e4801f4d 133 rm -v $(srcdir)/aclocal.m4
0a2eecf8 134 rm -v $(srcdir)/Makefile
96f9c530
CAW
135 rm -v $(srcdir)/env
136
0a2eecf8
BI
137
138# You can either use the setup.py sdist command or you can roll your own here
139dist:
07778a69 140# $(maybe_venved_python) setup.py sdist
0a2eecf8
BI
141 mkdir $(PACKAGE_DISTNAME)
142 cp -r $(DISTFILES) $(PACKAGE_DISTNAME)
143 tar -czf $(PACKAGE_DISTNAME).tar.gz $(PACKAGE_DISTNAME)
144 rm -rf $(PACKAGE_DISTNAME)
145
146# Use the setup.py check command
147check:
07778a69 148 $(maybe_venved_python) setup.py check
0a2eecf8
BI
149
150# setup.py might complain if a directory doesn't exist so just in case, make the directory
151# here
152installdirs:
d45673c0 153 $(MKDIR_P) $(DESTDIR)$(prefix)
0a2eecf8 154
07778a69
CAW
155# # Set up PostgreSQL
156# postgresql:
157# sudo -u $(POSTGRES) createuser mediagoblin
158# sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin
0a2eecf8 159
07778a69
CAW
160# update:
161# ifneq ($(VIRTUALENV),no)
162# $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
163# else
164# $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade
165# endif
166# $(prefix)/bin/gmg dbupdate
0a2eecf8
BI
167
168# The following show how to install documentation. In this example,
169# docs are built from a separate Makefile contained in the docs
170# directory which uses the SPHINXBUILD variable to store the location
171# of the sphinx-build (Python doc tool) binary to use.
172
173$(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info
174 $(POST_INSTALL)
175 $(INSTALL_DATA) @< $(DESTDIR)$@
176 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then
177 install-info --dir-file=$(DESTDIR)$(infodir)/dir \
178 $(DESTDIR)$(infodir)/foo.info;
179 else true; fi
180
181info: docs/build/texinfo/mediagoblin.info
182
183docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*)
184ifneq ($(SPHINXBUILD),no)
185 $(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD)
186endif
187
188
189install-html: html installdirs
190 $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir)
191
192html: docs/build/html/index.html
193
194docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*)
195ifneq ($(SPHINXBUILD),no)
196 $(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD)
197endif
198
199
200install-pdf: pdf installdirs
201 $(INSTALL_DATA) docs/build/latex/mediagoblin.pdf $(DESTDIR)$(pdfdir)
202
203pdf: docs/build/latex/mediagoblin.pdf
204
205docs/build/latex/mediagoblin.pdf: $(wildcard $(srcdir)/docs/source/*)
206ifneq ($(SPHINXBUILD),no)
207 $(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD)
208endif
209
210
07778a69
CAW
211# Targets that don't seem supported?
212
0a2eecf8
BI
213install-dvi:
214
215dvi:
216
217install-ps:
218
219ps:
220
221