2013-06-03 16:13:56 +00:00
|
|
|
#
|
|
|
|
# 2013 Nico Schottelius (nico-cdist at schottelius.org)
|
|
|
|
#
|
|
|
|
# This file is part of cdist.
|
|
|
|
#
|
|
|
|
# cdist is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# cdist is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
#
|
2013-06-03 15:34:03 +00:00
|
|
|
|
2019-05-07 16:16:54 +00:00
|
|
|
.PHONY: help
|
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
|
|
|
@echo "man build only man user documentation"
|
|
|
|
@echo "html build only html user documentation"
|
|
|
|
@echo "docs build both man and html user documentation"
|
|
|
|
@echo "dotman build man pages for types in your ~/.cdist directory"
|
|
|
|
@echo "speeches build speeches pdf files"
|
|
|
|
@echo "install install in the system site-packages directory"
|
|
|
|
@echo "install-user install in the user site-packages directory"
|
|
|
|
@echo "docs-clean clean documentation"
|
|
|
|
@echo "clean clean"
|
2013-06-07 19:14:51 +00:00
|
|
|
|
2019-06-23 17:55:37 +00:00
|
|
|
DOCS_SRC_DIR=./docs/src
|
|
|
|
SPEECHDIR=./docs/speeches
|
|
|
|
TYPEDIR=./cdist/conf/type
|
2013-07-09 12:00:42 +00:00
|
|
|
|
2016-06-30 13:05:26 +00:00
|
|
|
SPHINXM=make -C $(DOCS_SRC_DIR) man
|
|
|
|
SPHINXH=make -C $(DOCS_SRC_DIR) html
|
2016-07-15 22:50:01 +00:00
|
|
|
SPHINXC=make -C $(DOCS_SRC_DIR) clean
|
2018-10-06 12:57:55 +00:00
|
|
|
|
2013-07-09 12:00:42 +00:00
|
|
|
################################################################################
|
2013-07-09 12:53:00 +00:00
|
|
|
# Manpages
|
2013-07-09 12:00:42 +00:00
|
|
|
#
|
2016-06-30 13:05:26 +00:00
|
|
|
MAN7DSTDIR=$(DOCS_SRC_DIR)/man7
|
2013-07-09 12:53:00 +00:00
|
|
|
|
|
|
|
# Manpages #1: Types
|
2016-05-20 06:50:56 +00:00
|
|
|
# Use shell / ls to get complete list - $(TYPEDIR)/*/man.rst does not work
|
2016-06-25 17:30:22 +00:00
|
|
|
# Using ls does not work if no file with given pattern exist, so use wildcard
|
|
|
|
MANTYPESRC=$(wildcard $(TYPEDIR)/*/man.rst)
|
2013-07-09 16:40:27 +00:00
|
|
|
MANTYPEPREFIX=$(subst $(TYPEDIR)/,$(MAN7DSTDIR)/cdist-type,$(MANTYPESRC))
|
2016-05-20 06:50:56 +00:00
|
|
|
MANTYPES=$(subst /man.rst,.rst,$(MANTYPEPREFIX))
|
2013-07-09 12:00:42 +00:00
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Link manpage: do not create man.html but correct named file
|
|
|
|
$(MAN7DSTDIR)/cdist-type%.rst: $(TYPEDIR)/%/man.rst
|
2018-09-29 09:15:48 +00:00
|
|
|
mkdir -p $(MAN7DSTDIR)
|
2013-07-09 12:00:42 +00:00
|
|
|
ln -sf "../../../$^" $@
|
|
|
|
|
2013-07-09 12:53:00 +00:00
|
|
|
# Manpages #2: reference
|
2016-06-30 13:05:26 +00:00
|
|
|
DOCSREF=$(MAN7DSTDIR)/cdist-reference.rst
|
|
|
|
DOCSREFSH=$(DOCS_SRC_DIR)/cdist-reference.rst.sh
|
2013-07-09 12:53:00 +00:00
|
|
|
|
2016-06-30 13:05:26 +00:00
|
|
|
$(DOCSREF): $(DOCSREFSH)
|
|
|
|
$(DOCSREFSH)
|
2013-07-09 12:53:00 +00:00
|
|
|
|
2019-12-06 08:37:21 +00:00
|
|
|
DOCSCFGSKEL=./configuration/cdist.cfg.skeleton
|
|
|
|
|
|
|
|
configskel: $(DOCSCFGSKEL)
|
|
|
|
cp -f "$(DOCSCFGSKEL)" "$(DOCS_SRC_DIR)/"
|
|
|
|
|
2019-05-07 16:16:54 +00:00
|
|
|
version:
|
|
|
|
@[ -f "cdist/version.py" ] || { \
|
|
|
|
printf "Missing 'cdist/version.py', please generate it first.\n" && exit 1; \
|
|
|
|
}
|
|
|
|
|
2016-05-20 06:50:56 +00:00
|
|
|
# Manpages #3: generic part
|
2019-05-07 16:16:54 +00:00
|
|
|
man: version $(MANTYPES) $(DOCSREF)
|
2016-05-20 06:50:56 +00:00
|
|
|
$(SPHINXM)
|
2013-07-09 12:53:00 +00:00
|
|
|
|
2019-12-06 08:37:21 +00:00
|
|
|
html: version configskel $(MANTYPES) $(DOCSREF)
|
2016-05-20 06:50:56 +00:00
|
|
|
$(SPHINXH)
|
2013-07-09 12:00:42 +00:00
|
|
|
|
2016-07-04 10:21:01 +00:00
|
|
|
docs: man html
|
2013-07-09 12:53:00 +00:00
|
|
|
|
2016-07-15 22:50:01 +00:00
|
|
|
docs-clean:
|
|
|
|
$(SPHINXC)
|
|
|
|
|
2016-06-23 14:08:59 +00:00
|
|
|
# Manpages: .cdist Types
|
|
|
|
DOT_CDIST_PATH=${HOME}/.cdist
|
|
|
|
DOTMAN7DSTDIR=$(MAN7DSTDIR)
|
|
|
|
DOTTYPEDIR=$(DOT_CDIST_PATH)/type
|
2016-06-25 17:30:22 +00:00
|
|
|
DOTMANTYPESRC=$(wildcard $(DOTTYPEDIR)/*/man.rst)
|
2016-06-23 14:08:59 +00:00
|
|
|
DOTMANTYPEPREFIX=$(subst $(DOTTYPEDIR)/,$(DOTMAN7DSTDIR)/cdist-type,$(DOTMANTYPESRC))
|
|
|
|
DOTMANTYPES=$(subst /man.rst,.rst,$(DOTMANTYPEPREFIX))
|
|
|
|
|
|
|
|
# Link manpage: do not create man.html but correct named file
|
|
|
|
$(DOTMAN7DSTDIR)/cdist-type%.rst: $(DOTTYPEDIR)/%/man.rst
|
|
|
|
ln -sf "$^" $@
|
|
|
|
|
2019-05-07 16:16:54 +00:00
|
|
|
dotman: version $(DOTMANTYPES)
|
2016-06-23 14:08:59 +00:00
|
|
|
$(SPHINXM)
|
|
|
|
|
2013-07-09 12:00:42 +00:00
|
|
|
################################################################################
|
|
|
|
# Speeches
|
|
|
|
#
|
|
|
|
SPEECHESOURCES=$(SPEECHDIR)/*.tex
|
|
|
|
SPEECHES=$(SPEECHESOURCES:.tex=.pdf)
|
|
|
|
|
|
|
|
# Create speeches and ensure Toc is up-to-date
|
|
|
|
$(SPEECHDIR)/%.pdf: $(SPEECHDIR)/%.tex
|
|
|
|
pdflatex -output-directory $(SPEECHDIR) $^
|
|
|
|
pdflatex -output-directory $(SPEECHDIR) $^
|
|
|
|
pdflatex -output-directory $(SPEECHDIR) $^
|
|
|
|
|
|
|
|
speeches: $(SPEECHES)
|
|
|
|
|
2013-07-09 13:46:57 +00:00
|
|
|
################################################################################
|
2019-05-07 16:16:54 +00:00
|
|
|
# Misc
|
2013-07-09 15:22:56 +00:00
|
|
|
#
|
2019-05-07 16:16:54 +00:00
|
|
|
clean: docs-clean
|
2016-06-30 13:05:26 +00:00
|
|
|
rm -f $(DOCS_SRC_DIR)/cdist-reference.rst
|
2019-12-06 08:37:21 +00:00
|
|
|
rm -f $(DOCS_SRC_DIR)/cdist.cfg.skeleton
|
2013-07-09 12:00:42 +00:00
|
|
|
|
2016-06-30 13:05:26 +00:00
|
|
|
find "$(DOCS_SRC_DIR)" -mindepth 2 -type l \
|
2013-07-09 12:00:42 +00:00
|
|
|
| xargs rm -f
|
|
|
|
|
2013-07-10 15:02:11 +00:00
|
|
|
find * -name __pycache__ | xargs rm -rf
|
2013-07-09 12:00:42 +00:00
|
|
|
|
2019-05-07 16:16:54 +00:00
|
|
|
# distutils
|
|
|
|
rm -rf ./build
|
2013-09-05 10:57:52 +00:00
|
|
|
|
2013-07-10 15:02:11 +00:00
|
|
|
################################################################################
|
2019-05-07 16:16:54 +00:00
|
|
|
# install
|
2013-07-10 15:02:11 +00:00
|
|
|
#
|
|
|
|
|
2019-05-07 16:16:54 +00:00
|
|
|
install:
|
|
|
|
python3 setup.py install
|
2018-10-07 17:09:14 +00:00
|
|
|
|
2019-05-07 16:16:54 +00:00
|
|
|
install-user:
|
|
|
|
python3 setup.py install --user
|