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