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