Commit | Line | Data |
---|---|---|
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 | |
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@ | |
0a2eecf8 BI |
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@ | |
e56b493a | 41 | abs_srcdir = @abs_srcdir@ |
0a2eecf8 BI |
42 | datadir = @datadir@ |
43 | datarootdir = @datarootdir@ | |
0a2eecf8 BI |
44 | pkgdatadir = $(datadir)/@PACKAGE_NAME@ |
45 | pkgincludedir = $(includedir)/@PACKAGE_NAME@ | |
0a2eecf8 | 46 | PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir) |
65686465 | 47 | USE_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 |
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. | |
0a2eecf8 | 62 | |
07778a69 CAW |
63 | maybe_venved = ./bin/ |
64 | maybe_venved_python = ./bin/python | |
65 | # Yes, build the virtualenv as a dependency! | |
66 | maybe_venv_dep = ./bin/python | |
1da574c6 CAW |
67 | # And to clean up! |
68 | maybe_venv_clean = clean-virtualenv | |
0a2eecf8 | 69 | |
0a2eecf8 | 70 | else |
07778a69 CAW |
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 = | |
1da574c6 CAW |
77 | # Nor to clean up! |
78 | maybe_venv_clean = | |
0a2eecf8 | 79 | endif |
07778a69 | 80 | |
07778a69 CAW |
81 | .PHONY: all install uninstall distclean info install-html html \ |
82 | install-pdf pdf install-dvi dvi install-ps ps clean dist check \ | |
572106e2 | 83 | installdirs i18n virtualenv docs extlib |
2f841a6c | 84 | |
07778a69 CAW |
85 | # update postgresql |
86 | ||
87 | all: develop | |
88 | ||
2f841a6c CAW |
89 | ifneq ($(VIRTUALENV),no) |
90 | docs: | |
91 | source bin/activate && cd docs && make html | |
92 | else | |
93 | cd docs && make html | |
94 | endif | |
95 | ||
572106e2 CAW |
96 | # In the future we may provide more options than just npm/bower here |
97 | # eg, we may support guix updating. | |
98 | extlib: | |
99 | ./devtools/update_extlib.sh | |
100 | ||
2b475821 | 101 | develop: $(maybe_venv_dep) i18n mediagoblin.ini |
adecace3 | 102 | |
86f89fd0 | 103 | # NEVER clobber a user's mediagoblin.ini once they've defined it |
b2624eb0 CAW |
104 | mediagoblin.ini: |
105 | cp --no-clobber mediagoblin.example.ini mediagoblin.ini | |
106 | ||
96f9c530 CAW |
107 | # base-configs: paste.ini mediagoblin.example.ini |
108 | ||
07778a69 CAW |
109 | install: installdirs |
110 | $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix) | |
111 | ||
112 | ||
4aaa7fac | 113 | # In the future, maybe we can compile the individual .po files here? |
07778a69 | 114 | i18n: $(maybe_venv_dep) |
4aaa7fac | 115 | ./devtools/compile_translations.sh |
07778a69 CAW |
116 | |
117 | ||
0a2eecf8 | 118 | ifneq ($(VIRTUALENV),no) |
07778a69 CAW |
119 | ./bin/python: |
120 | rm -f ./bin/python | |
1da574c6 | 121 | virtualenv --system-site-packages --python=$(PYTHON) . |
07778a69 | 122 | ./bin/python setup.py develop --upgrade |
0a2eecf8 | 123 | |
572106e2 | 124 | virtualenv: bin/python extlib |
96f9c530 CAW |
125 | |
126 | clean-virtualenv: | |
127 | rm -rf ./bin/ | |
128 | rm -rf ./lib/ | |
90c2989b | 129 | rm -rf ./include/ |
07778a69 | 130 | endif |
0a2eecf8 BI |
131 | |
132 | # setup.py doesn't (yet) support an uninstall command, so until it does, you | |
133 | # must manually remove everything that was installed here. The following example | |
134 | # should remove a basic package installed via setup.py, but please double- and | |
135 | # triple-check it so that you don't remove something you shouldn't! | |
136 | # Be sure to remove any extra files you install, such as binaries or documentation! | |
a9dc855a | 137 | # |
297a262c | 138 | # uninstall: |
a9dc855a CAW |
139 | # rm -rvf $(pkgpythondir) |
140 | # rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info | |
141 | # | |
0a2eecf8 | 142 | |
86f89fd0 | 143 | |
0a2eecf8 | 144 | clean: |
86f89fd0 CAW |
145 | @echo "No rule to clean house, yet." |
146 | ||
147 | ||
148 | # We don't know what this does yet. | |
149 | # Originally: | |
150 | ## Just use the usual setup.py clean command | |
151 | #clean: | |
152 | # $(maybe_venved_python) setup.py clean | |
153 | ||
0a2eecf8 BI |
154 | |
155 | ||
156 | # Clean up the output of configure | |
1da574c6 CAW |
157 | distclean: $(maybe_venv_clean) |
158 | rm -vf $(srcdir)/config.log | |
159 | rm -vf $(srcdir)/config.status | |
0a2eecf8 | 160 | rm -rvf $(srcdir)/autom4te.cache |
1da574c6 CAW |
161 | rm -vf $(srcdir)/aclocal.m4 |
162 | rm -vf $(srcdir)/Makefile | |
96f9c530 | 163 | |
0a2eecf8 | 164 | |
2b475821 CAW |
165 | ########################################################################### |
166 | # These things aren't really tested / supported yet. | |
167 | ########################################################################### | |
168 | ||
169 | ||
170 | ||
0a2eecf8 | 171 | # You can either use the setup.py sdist command or you can roll your own here |
572106e2 | 172 | dist: extlib |
07778a69 | 173 | # $(maybe_venved_python) setup.py sdist |
0a2eecf8 BI |
174 | mkdir $(PACKAGE_DISTNAME) |
175 | cp -r $(DISTFILES) $(PACKAGE_DISTNAME) | |
176 | tar -czf $(PACKAGE_DISTNAME).tar.gz $(PACKAGE_DISTNAME) | |
177 | rm -rf $(PACKAGE_DISTNAME) | |
178 | ||
179 | # Use the setup.py check command | |
180 | check: | |
07778a69 | 181 | $(maybe_venved_python) setup.py check |
0a2eecf8 BI |
182 | |
183 | # setup.py might complain if a directory doesn't exist so just in case, make the directory | |
184 | # here | |
185 | installdirs: | |
d45673c0 | 186 | $(MKDIR_P) $(DESTDIR)$(prefix) |
0a2eecf8 | 187 | |
07778a69 CAW |
188 | # # Set up PostgreSQL |
189 | # postgresql: | |
190 | # sudo -u $(POSTGRES) createuser mediagoblin | |
191 | # sudo -u $(POSTGRES) createdb -E UNICODE -O mediagoblin mediagoblin | |
0a2eecf8 | 192 | |
07778a69 CAW |
193 | # update: |
194 | # ifneq ($(VIRTUALENV),no) | |
195 | # $(prefix)/bin/python $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade | |
196 | # else | |
197 | # $(PYTHON) $(srcdir)/setup.py develop --prefix=$(prefix) --upgrade | |
198 | # endif | |
199 | # $(prefix)/bin/gmg dbupdate | |
0a2eecf8 | 200 | |
2b475821 CAW |
201 | ###################### |
202 | # Needs to be updated? | |
203 | ###################### | |
204 | ||
0a2eecf8 BI |
205 | # The following show how to install documentation. In this example, |
206 | # docs are built from a separate Makefile contained in the docs | |
207 | # directory which uses the SPHINXBUILD variable to store the location | |
208 | # of the sphinx-build (Python doc tool) binary to use. | |
209 | ||
210 | $(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info | |
211 | $(POST_INSTALL) | |
212 | $(INSTALL_DATA) @< $(DESTDIR)$@ | |
213 | if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then | |
214 | install-info --dir-file=$(DESTDIR)$(infodir)/dir \ | |
215 | $(DESTDIR)$(infodir)/foo.info; | |
216 | else true; fi | |
217 | ||
218 | info: docs/build/texinfo/mediagoblin.info | |
219 | ||
220 | docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*) | |
221 | ifneq ($(SPHINXBUILD),no) | |
222 | $(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD) | |
223 | endif | |
224 | ||
225 | ||
226 | install-html: html installdirs | |
227 | $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir) | |
228 | ||
229 | html: docs/build/html/index.html | |
230 | ||
231 | docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*) | |
232 | ifneq ($(SPHINXBUILD),no) | |
233 | $(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD) | |
234 | endif | |
235 | ||
236 | ||
237 | install-pdf: pdf installdirs | |
238 | $(INSTALL_DATA) docs/build/latex/mediagoblin.pdf $(DESTDIR)$(pdfdir) | |
239 | ||
240 | pdf: docs/build/latex/mediagoblin.pdf | |
241 | ||
242 | docs/build/latex/mediagoblin.pdf: $(wildcard $(srcdir)/docs/source/*) | |
243 | ifneq ($(SPHINXBUILD),no) | |
244 | $(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD) | |
245 | endif | |
246 | ||
247 | ||
07778a69 CAW |
248 | # Targets that don't seem supported? |
249 | ||
0a2eecf8 BI |
250 | install-dvi: |
251 | ||
252 | dvi: | |
253 | ||
254 | install-ps: | |
255 | ||
256 | ps: | |
257 | ||
258 |