Commit | Line | Data |
---|---|---|
0a2eecf8 BI |
1 | # Makefile.in |
2 | # | |
3 | # Copyright © 2012, 2013 Brandon Invergo <brandon@invergo.net> | |
94eb44d6 | 4 | # Copyright © 2014, 2015 Christopher Allan Webber <cwebber@dustycloud.org> |
0a2eecf8 BI |
5 | # |
6 | # Copying and distribution of this file, with or without modification, | |
7 | # are permitted in any medium without royalty provided the copyright | |
8 | # notice and this notice are preserved. This file is offered as-is, | |
9 | # without any warranty. | |
10 | ||
11 | # List whatever files you want to include in your source distribution here. | |
12 | # You can include whole directories but note that *everything* under that | |
13 | # directory will be included | |
14 | DISTFILES = PKG-INFO Makefile.in configure setup.py install-sh | |
15 | ||
16 | DESTDIR = | |
17 | VPATH = @srcdir@ | |
18 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | |
19 | PACKAGE_NAME = @PACKAGE_NAME@ | |
20 | PACKAGE_STRING = @PACKAGE_STRING@ | |
21 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | |
22 | PACKAGE_DISTNAME = ${PACKAGE_NAME}-${PACKAGE_VERSION} | |
23 | PACKAGE_URL = @PACKAGE_URL@ | |
24 | PACKAGE_VERSION = @PACKAGE_VERSION@ | |
25 | PATH_SEPARATOR = @PATH_SEPARATOR@ | |
26 | PYTHON = @PYTHON@ | |
27 | VIRTUALENV = @VIRTUALENV@ | |
0a2eecf8 BI |
28 | SHELL = @SHELL@ |
29 | MKDIR_P = @MKDIR_P@ | |
30 | INSTALL = @INSTALL@ | |
31 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
32 | INSTALL_DATA = @INSTALL_DATA@ | |
33 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
34 | docdir = @docdir@ | |
35 | dvidir = @dvidir@ | |
36 | exec_prefix = @exec_prefix@ | |
37 | htmldir = @htmldir@ | |
38 | includedir = @includedir@ | |
39 | infodir = @infodir@ | |
40 | prefix = @prefix@ | |
41 | srcdir = @srcdir@ | |
e56b493a | 42 | abs_srcdir = @abs_srcdir@ |
0a2eecf8 BI |
43 | datadir = @datadir@ |
44 | datarootdir = @datarootdir@ | |
0a2eecf8 BI |
45 | pkgdatadir = $(datadir)/@PACKAGE_NAME@ |
46 | pkgincludedir = $(includedir)/@PACKAGE_NAME@ | |
0a2eecf8 | 47 | PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir) |
65686465 | 48 | USE_PYTHON3 = @USE_PYTHON3@ |
0a2eecf8 | 49 | |
d466977d CAW |
50 | EXTLIB_INSTALLS = extlib/jquery extlib/video.js extlib/leaflet extlib/tinymce |
51 | ||
96f9c530 CAW |
52 | # pkgpythondir = @pkgpythondir@ |
53 | # pkgpyexecdir = @pkgpyexecdir@ | |
54 | # pythondir = @pythondir@ | |
55 | # pyexecdir = @pyexecdir@ | |
56 | # SPHINXBUILD = @SPHINXBUILD@ | |
57 | # POSTGRES = @POSTGRES@ | |
58 | ||
59 | ||
07778a69 CAW |
60 | # Maybe add a virtualenv prefix to a command |
61 | ifneq ($(VIRTUALENV),no) | |
62 | # virtualenv specified to be included by config (default) | |
63 | # ... we only use virtualenv for local development, we don't | |
64 | # auto-deploy to it. | |
0a2eecf8 | 65 | |
07778a69 CAW |
66 | maybe_venved = ./bin/ |
67 | maybe_venved_python = ./bin/python | |
68 | # Yes, build the virtualenv as a dependency! | |
d466977d | 69 | maybe_venv_dep = virtualenv |
1da574c6 CAW |
70 | # And to clean up! |
71 | maybe_venv_clean = clean-virtualenv | |
0a2eecf8 | 72 | |
0a2eecf8 | 73 | else |
07778a69 CAW |
74 | # --without-virtualenv must have been passed in... don't build |
75 | # a local virtualenv or use such commands | |
76 | maybe_venved = | |
77 | maybe_venved_python = $(PYTHON) | |
78 | # No need for commands to build virtualenv as a dependency! | |
79 | maybe_venv_dep = | |
1da574c6 CAW |
80 | # Nor to clean up! |
81 | maybe_venv_clean = | |
0a2eecf8 | 82 | endif |
07778a69 | 83 | |
07778a69 CAW |
84 | .PHONY: all install uninstall distclean info install-html html \ |
85 | install-pdf pdf install-dvi dvi install-ps ps clean dist check \ | |
572106e2 | 86 | installdirs i18n virtualenv docs extlib |
2f841a6c | 87 | |
07778a69 CAW |
88 | # update postgresql |
89 | ||
90 | all: develop | |
91 | ||
2f841a6c | 92 | docs: |
d466977d | 93 | ifneq ($(VIRTUALENV),no) |
2f841a6c CAW |
94 | source bin/activate && cd docs && make html |
95 | else | |
96 | cd docs && make html | |
97 | endif | |
98 | ||
572106e2 CAW |
99 | # In the future we may provide more options than just npm/bower here |
100 | # eg, we may support guix updating. | |
101 | extlib: | |
102 | ./devtools/update_extlib.sh | |
103 | ||
2b475821 | 104 | develop: $(maybe_venv_dep) i18n mediagoblin.ini |
adecace3 | 105 | |
86f89fd0 | 106 | # NEVER clobber a user's mediagoblin.ini once they've defined it |
b2624eb0 | 107 | mediagoblin.ini: |
ae69f816 | 108 | cp -n mediagoblin.example.ini mediagoblin.ini |
b2624eb0 | 109 | |
96f9c530 CAW |
110 | # base-configs: paste.ini mediagoblin.example.ini |
111 | ||
07778a69 CAW |
112 | install: installdirs |
113 | $(maybe_venved_python) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix) | |
114 | ||
115 | ||
4aaa7fac | 116 | # In the future, maybe we can compile the individual .po files here? |
07778a69 | 117 | i18n: $(maybe_venv_dep) |
4aaa7fac | 118 | ./devtools/compile_translations.sh |
07778a69 CAW |
119 | |
120 | ||
0a2eecf8 | 121 | ifneq ($(VIRTUALENV),no) |
07778a69 CAW |
122 | ./bin/python: |
123 | rm -f ./bin/python | |
b0e3ba4c | 124 | ${VIRTUALENV} --system-site-packages --python=$(PYTHON) . |
07778a69 | 125 | ./bin/python setup.py develop --upgrade |
0a2eecf8 | 126 | |
572106e2 | 127 | virtualenv: bin/python extlib |
96f9c530 CAW |
128 | |
129 | clean-virtualenv: | |
130 | rm -rf ./bin/ | |
131 | rm -rf ./lib/ | |
90c2989b | 132 | rm -rf ./include/ |
07778a69 | 133 | endif |
0a2eecf8 BI |
134 | |
135 | # setup.py doesn't (yet) support an uninstall command, so until it does, you | |
136 | # must manually remove everything that was installed here. The following example | |
137 | # should remove a basic package installed via setup.py, but please double- and | |
138 | # triple-check it so that you don't remove something you shouldn't! | |
139 | # Be sure to remove any extra files you install, such as binaries or documentation! | |
a9dc855a | 140 | # |
297a262c | 141 | # uninstall: |
a9dc855a CAW |
142 | # rm -rvf $(pkgpythondir) |
143 | # rm -v $(pythondir)/$(PACKAGE_DISTNAME)-*.egg-info | |
144 | # | |
0a2eecf8 | 145 | |
86f89fd0 CAW |
146 | # We don't know what this does yet. |
147 | # Originally: | |
148 | ## Just use the usual setup.py clean command | |
149 | #clean: | |
150 | # $(maybe_venved_python) setup.py clean | |
09e2db30 CAW |
151 | clean: |
152 | @echo "No rule to clean house, yet." | |
153 | @echo "distclean works but might do more than you want. :)" | |
86f89fd0 | 154 | |
0a2eecf8 | 155 | |
d466977d CAW |
156 | # It's not obvious to me whether the virtualenv/bower/npm things should be |
157 | # auto-cleaned as part of distclean. I'm leaning towards "yes" for now but | |
158 | # I'm not really happy about that. | |
0a2eecf8 BI |
159 | |
160 | # Clean up the output of configure | |
1da574c6 CAW |
161 | distclean: $(maybe_venv_clean) |
162 | rm -vf $(srcdir)/config.log | |
163 | rm -vf $(srcdir)/config.status | |
0a2eecf8 | 164 | rm -rvf $(srcdir)/autom4te.cache |
1da574c6 | 165 | rm -vf $(srcdir)/aclocal.m4 |
d466977d CAW |
166 | rm -rf $(EXTLIB_INSTALLS) |
167 | rm -rf node_modules | |
1da574c6 | 168 | rm -vf $(srcdir)/Makefile |
96f9c530 | 169 | |
90dbaefb CAW |
170 | check: |
171 | ./runtests.sh | |
0a2eecf8 | 172 | |
2b475821 CAW |
173 | ########################################################################### |
174 | # These things aren't really tested / supported yet. | |
175 | ########################################################################### | |
176 | ||
177 | ||
e82c7ede CAW |
178 | ## NOTE: We don't use this yet, we use ./devtools/maketarball.sh |
179 | ## We can't switch out ./devtools/maketarball.sh in here because | |
180 | ## it requires a git revision as a first argument, which | |
181 | ## doesn't always work here | |
2b475821 | 182 | |
193c509b | 183 | dist: $(maybe_venv_dep) |
90dbaefb | 184 | $(maybe_venved_python) setup.py sdist |
0a2eecf8 BI |
185 | |
186 | # setup.py might complain if a directory doesn't exist so just in case, make the directory | |
187 | # here | |
188 | installdirs: | |
d45673c0 | 189 | $(MKDIR_P) $(DESTDIR)$(prefix) |
0a2eecf8 | 190 | |
2b475821 CAW |
191 | ###################### |
192 | # Needs to be updated? | |
193 | ###################### | |
194 | ||
0a2eecf8 BI |
195 | # The following show how to install documentation. In this example, |
196 | # docs are built from a separate Makefile contained in the docs | |
197 | # directory which uses the SPHINXBUILD variable to store the location | |
198 | # of the sphinx-build (Python doc tool) binary to use. | |
199 | ||
200 | $(DESTDIR)$(infodir)/mediagoblin.info: docs/build/texinfo/mediagoblin.info | |
201 | $(POST_INSTALL) | |
202 | $(INSTALL_DATA) @< $(DESTDIR)$@ | |
203 | if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then | |
204 | install-info --dir-file=$(DESTDIR)$(infodir)/dir \ | |
205 | $(DESTDIR)$(infodir)/foo.info; | |
206 | else true; fi | |
207 | ||
208 | info: docs/build/texinfo/mediagoblin.info | |
209 | ||
210 | docs/build/texinfo/mediagoblin.info: $(wildcard docs/source/*) | |
09e2db30 CAW |
211 | ifneq ($(VIRTUALENV),no) |
212 | source bin/activate && cd docs && make info | |
213 | else | |
214 | cd docs && make info | |
0a2eecf8 BI |
215 | endif |
216 | ||
217 | ||
218 | install-html: html installdirs | |
219 | $(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir) | |
220 | ||
0f797320 | 221 | html: docs |