|
1 | 1 | MKPATH=mk/
|
2 | 2 | include $(MKPATH)buildsys.mk
|
3 | 3 |
|
4 |
| -SUBDIRS = src lib docs |
5 |
| -CLEAN = config.status config.log *.dll *.exe |
| 4 | +SUBDIRS = src lib |
| 5 | +CLEAN = *.dll *.exe |
| 6 | +DISTCLEAN = config.status config.log docs/.deps \ |
| 7 | + mk/buildsys.mk mk/extra.mk |
| 8 | +REPOCLEAN = aclocal.m4 autom4te.cache configure src/autoconf.h.in version |
6 | 9 |
|
7 |
| -.PHONY: tests manual clean-manual dist |
| 10 | +.PHONY: check tests manual manual-optional dist |
| 11 | +check: tests |
8 | 12 | tests:
|
9 | 13 | $(MAKE) -C src tests
|
10 | 14 |
|
11 |
| -manual: |
12 |
| - $(MAKE) -C doc manual.html manual.pdf |
| 15 | +TAG = pwmangband-`cd scripts && ./version.sh` |
| 16 | +OUT = $(TAG).tar.gz |
13 | 17 |
|
14 |
| -clean-manual: |
15 |
| - $(MAKE) -C doc clean |
| 18 | +all: manual-optional |
16 | 19 |
|
17 |
| -TAG = pwmangband-`git describe` |
18 |
| -OUT = $(TAG).tar.gz |
| 20 | +manual: manual-optional |
| 21 | + @if test x"$(SPHINXBUILD)" = x || test x"$(SPHINXBUILD)" = xNOTFOUND ; then \ |
| 22 | + echo "sphinx-build was not found during configuration. If it is not installed, you will have to install it. You can either rerun the configuration or set SPHINXBUILD on the command line when running make to inform make how to run sphinx-build. You may also want to set DOC_HTML_THEME to a builtin Sphinx theme to use instead of what is configured in docs/conf.py. For instance, 'DOC_HTML_THEME=classic'." ; \ |
| 23 | + exit 1 ; \ |
| 24 | + fi |
19 | 25 |
|
20 |
| -dist: manual |
| 26 | +manual-optional: |
| 27 | + @if test ! x"$(SPHINXBUILD)" = x && test ! x"$(SPHINXBUILD)" = xNOTFOUND ; then \ |
| 28 | + env DOC_HTML_THEME="$(DOC_HTML_THEME)" $(MAKE) -C docs SPHINXBUILD="$(SPHINXBUILD)" html ; \ |
| 29 | + fi |
| 30 | + |
| 31 | +dist: |
21 | 32 | git checkout-index --prefix=$(TAG)/ -a
|
22 |
| - git describe > $(TAG)/version |
| 33 | + scripts/version.sh > $(TAG)/version |
23 | 34 | $(TAG)/autogen.sh
|
24 | 35 | rm -rf $(TAG)/autogen.sh $(TAG)/autom4te.cache
|
25 |
| - cp doc/manual.html doc/manual.pdf $(TAG)/doc/ |
26 |
| - tar --exclude .gitignore --exclude *.dll -czvf $(OUT) $(TAG) |
| 36 | + tar --exclude .gitignore --exclude *.dll --exclude .github \ |
| 37 | + --exclude .travis.yml -czvf $(OUT) $(TAG) |
27 | 38 | rm -rf $(TAG)
|
| 39 | + |
| 40 | +# If this isn't a --with-no-install build, build and install the documentation |
| 41 | +# if sphinx-build is available. |
| 42 | +install-extra: |
| 43 | + @if test x"$(NOINSTALL)" != xyes && test ! x"$(SPHINXBUILD)" = x && test ! x"$(SPHINXBUILD)" = xNOTFOUND ; then \ |
| 44 | + for x in `find docs/_build/html -mindepth 1 \! -type d \! -name .buildinfo -print`; do \ |
| 45 | + i=`echo $$x | sed -e s%^docs/_build/html/%%`; \ |
| 46 | + ${INSTALL_STATUS}; \ |
| 47 | + if ${MKDIR_P} $$(dirname ${DESTDIR}${docdatadir}/$$i) && ${INSTALL} -m 644 $$x ${DESTDIR}${docdatadir}/$$i; then \ |
| 48 | + ${INSTALL_OK}; \ |
| 49 | + else \ |
| 50 | + ${INSTALL_FAILED}; \ |
| 51 | + fi \ |
| 52 | + done \ |
| 53 | + fi |
| 54 | + |
| 55 | +# Hack to clean up in docs since it isn't included in SUBDIRS. |
| 56 | +pre-clean: |
| 57 | + @if test ! x"$(SPHINXBUILD)" = x && test ! x"$(SPHINXBUILD)" = xNOTFOUND ; then \ |
| 58 | + $(MAKE) -C docs SPHINXBUILD="$(SPHINXBUILD)" clean ; \ |
| 59 | + fi |
| 60 | + |
| 61 | +# Hack to clean up test results in tests. |
| 62 | +pre-distclean: |
| 63 | + @find tests -name run.out -exec rm {} \; |
| 64 | + |
| 65 | +# Remove the files generated by autogen.sh and the version stamp file. |
| 66 | +# In general, this should not be used when working with a distributed |
| 67 | +# source archive (.tar.gz) since those archives do not include autogen.sh for |
| 68 | +# rebuilding the configure script. |
| 69 | +repoclean: distclean |
| 70 | + for i in "" $(REPOCLEAN) ; do \ |
| 71 | + test x"$$i" = x"" && continue; \ |
| 72 | + if test -d "$$i" || test -f "$$i" ; then rm -rf "$$i" ; fi \ |
| 73 | + done |
0 commit comments