2011-02-26 10:46:52 +00:00
|
|
|
# General
|
2010-10-28 19:13:57 +00:00
|
|
|
PREFIX=/usr
|
2011-02-26 18:37:15 +00:00
|
|
|
BINDIR=$(PREFIX)/bin
|
|
|
|
MANDIR=$(PREFIX)/share/man
|
2011-03-20 02:23:13 +00:00
|
|
|
|
|
|
|
# Manpage and HTML
|
|
|
|
A2XM=a2x -f manpage --no-xmllint
|
|
|
|
# A2XH=a2x -f xhtml --no-xmllint
|
|
|
|
A2XH=asciidoc -b xhtml11
|
2011-02-26 10:46:52 +00:00
|
|
|
|
|
|
|
# Developer only
|
2011-03-21 13:00:00 +00:00
|
|
|
WEBDIR=$$HOME/niconetz
|
|
|
|
WEBBASE=software/cdist
|
|
|
|
WEBPAGE=$(WEBBASE).mdwn
|
|
|
|
|
2010-10-28 19:13:57 +00:00
|
|
|
|
2011-03-16 09:21:10 +00:00
|
|
|
# Documentation
|
2011-03-05 10:36:02 +00:00
|
|
|
MANDIR=doc/man
|
2011-03-25 10:17:52 +00:00
|
|
|
|
|
|
|
MAN1DSTDIR=$(MANDIR)/man1
|
|
|
|
MAN7DSTDIR=$(MANDIR)/man7
|
|
|
|
MANHTMLDIR=$(MANDIR)/html
|
2011-03-09 07:53:19 +00:00
|
|
|
|
2011-03-24 16:41:20 +00:00
|
|
|
MAN1SRC= \
|
2011-03-20 00:08:11 +00:00
|
|
|
$(MANDIR)/cdist-code-run.text \
|
2011-03-21 13:19:07 +00:00
|
|
|
$(MANDIR)/cdist-code-run-all.text \
|
2011-03-17 22:49:36 +00:00
|
|
|
$(MANDIR)/cdist-config.text \
|
|
|
|
$(MANDIR)/cdist-dir.text \
|
|
|
|
$(MANDIR)/cdist-env.text \
|
|
|
|
$(MANDIR)/cdist-explorer-run-global.text \
|
|
|
|
$(MANDIR)/cdist-deploy-to.text \
|
|
|
|
$(MANDIR)/cdist-explorer.text \
|
|
|
|
$(MANDIR)/cdist-manifest.text \
|
2011-03-17 23:48:17 +00:00
|
|
|
$(MANDIR)/cdist-manifest-run.text \
|
2011-03-21 13:19:07 +00:00
|
|
|
$(MANDIR)/cdist-manifest-run-init.text \
|
2011-03-24 16:41:20 +00:00
|
|
|
$(MANDIR)/cdist-manifest-run-all.text \
|
2011-03-17 23:18:00 +00:00
|
|
|
$(MANDIR)/cdist-object-explorer-all.text \
|
2011-03-17 23:32:04 +00:00
|
|
|
$(MANDIR)/cdist-object-gencode.text \
|
2011-03-17 23:24:58 +00:00
|
|
|
$(MANDIR)/cdist-object-gencode-all.text \
|
2011-03-19 23:51:45 +00:00
|
|
|
$(MANDIR)/cdist-remote-explorer-run.text \
|
2011-03-17 23:41:18 +00:00
|
|
|
$(MANDIR)/cdist-run-remote.text \
|
2011-03-19 23:30:19 +00:00
|
|
|
$(MANDIR)/cdist-type-build-emulation.text \
|
2011-03-19 23:43:08 +00:00
|
|
|
$(MANDIR)/cdist-type-emulator.text \
|
2011-03-17 22:49:36 +00:00
|
|
|
$(MANDIR)/cdist-type-template.text \
|
2011-02-26 19:41:33 +00:00
|
|
|
|
2011-03-24 16:41:20 +00:00
|
|
|
MAN7SRC=$(MANDIR)/cdist.text \
|
|
|
|
$(MANDIR)/cdist-best-practise.text \
|
|
|
|
$(MANDIR)/cdist-hacker.text \
|
|
|
|
$(MANDIR)/cdist-quickstart.text \
|
|
|
|
$(MANDIR)/cdist-reference.text \
|
|
|
|
$(MANDIR)/cdist-stages.text \
|
|
|
|
$(MANDIR)/cdist-type.text \
|
2011-03-25 10:17:52 +00:00
|
|
|
|
|
|
|
MAN7TYPESRC=$(shell ls conf/type/*/man.text)
|
2011-03-25 10:46:56 +00:00
|
|
|
MAN7TYPEDST=$(shell for mansrc in $(MAN7TYPESRC:.text=.7); do dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; echo $$dst; done)
|
2011-03-25 10:34:29 +00:00
|
|
|
MAN1DST=$(addprefix $(MAN1DSTDIR)/,$(notdir $(MAN1SRC:.text=.1)))
|
|
|
|
MAN7DST=$(addprefix $(MAN7DSTDIR)/,$(notdir $(MAN7SRC:.text=.7)))
|
2011-03-25 10:52:51 +00:00
|
|
|
MANHTML=$(MAN1DST:.1=.html) $(MAN7DST:.7=.html) $(MAN7TYPEDST:.7=.html)
|
2011-02-26 19:41:33 +00:00
|
|
|
|
2011-03-25 10:17:52 +00:00
|
|
|
|
2011-02-26 18:37:15 +00:00
|
|
|
################################################################################
|
|
|
|
# User targets
|
|
|
|
#
|
2011-02-19 00:47:10 +00:00
|
|
|
|
2011-03-05 10:36:02 +00:00
|
|
|
all:
|
|
|
|
@echo ''
|
|
|
|
@echo 'Welcome to cdist!'
|
|
|
|
@echo ''
|
|
|
|
@echo 'Here are the possible targets:'
|
|
|
|
@echo ''
|
2011-03-21 12:48:40 +00:00
|
|
|
@echo ' man: Build manpages (requires Asciidoc)'
|
2011-03-05 10:36:02 +00:00
|
|
|
@echo ' clean: Remove build stuff'
|
|
|
|
@echo ''
|
|
|
|
@echo ''
|
2010-10-28 19:13:57 +00:00
|
|
|
|
2011-02-26 10:51:59 +00:00
|
|
|
|
2011-03-25 10:34:29 +00:00
|
|
|
################################################################################
|
|
|
|
# Documentation
|
|
|
|
#
|
|
|
|
|
|
|
|
# Create output dirs
|
2011-03-25 10:17:52 +00:00
|
|
|
$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR):
|
2011-03-25 10:34:29 +00:00
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
# Link source files
|
2011-03-25 10:52:51 +00:00
|
|
|
manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR)
|
2011-03-25 10:46:56 +00:00
|
|
|
for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MAN1DSTDIR); done
|
|
|
|
for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MAN7DSTDIR); done
|
2011-03-25 10:34:29 +00:00
|
|
|
for mansrc in $(MAN7TYPESRC); do \
|
|
|
|
dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \
|
2011-03-25 10:46:56 +00:00
|
|
|
ln -sf ../../../$$mansrc $$dst; done
|
2011-03-25 10:17:52 +00:00
|
|
|
|
2011-03-25 10:34:29 +00:00
|
|
|
%.1 %.7: %.text manlink
|
2011-03-24 17:43:08 +00:00
|
|
|
$(A2XM) $*.text
|
2011-02-26 10:51:59 +00:00
|
|
|
|
2011-03-24 17:43:08 +00:00
|
|
|
%.html: %.text
|
2011-03-25 10:17:52 +00:00
|
|
|
$(A2XH) -o $(MANHTMLDIR)/$(@F) $<
|
2011-03-09 12:06:23 +00:00
|
|
|
|
2011-03-25 10:46:56 +00:00
|
|
|
man: $(MAN1DST) $(MAN7DST) $(MAN7TYPEDST)
|
2011-03-24 17:43:08 +00:00
|
|
|
|
|
|
|
html: $(MANHTML)
|
|
|
|
|
2011-03-09 12:08:56 +00:00
|
|
|
# Reference depends on conf/type/*/man.text - HOWTO with posix make?
|
2011-03-24 14:37:16 +00:00
|
|
|
$(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh
|
2011-03-09 08:52:43 +00:00
|
|
|
$(MANDIR)/cdist-reference.text.sh
|
2011-03-20 02:23:13 +00:00
|
|
|
$(A2XM) $(MANDIR)/cdist-reference.text
|
|
|
|
$(A2XH) $(MANDIR)/cdist-reference.text
|
2011-03-09 07:53:19 +00:00
|
|
|
|
2011-02-26 10:51:59 +00:00
|
|
|
clean:
|
2011-03-24 17:43:08 +00:00
|
|
|
rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9]
|
|
|
|
rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text
|
2011-03-25 10:17:52 +00:00
|
|
|
rm -rf $(MANHTMLDIR)
|
2011-02-26 10:51:59 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Developer targets
|
|
|
|
#
|
|
|
|
|
|
|
|
test:
|
2011-02-03 12:32:29 +00:00
|
|
|
# ubuntu
|
2010-09-25 10:36:30 +00:00
|
|
|
.rsync lyni@tablett:cdist
|
2011-02-03 12:32:29 +00:00
|
|
|
# redhat
|
2010-09-25 10:36:30 +00:00
|
|
|
.rsync nicosc@free.ethz.ch:cdist
|
2011-02-03 12:32:29 +00:00
|
|
|
# gentoo
|
|
|
|
.rsync nicosc@ru3.inf.ethz.ch:cdist
|
2011-02-02 13:01:50 +00:00
|
|
|
|
2011-03-24 22:30:42 +00:00
|
|
|
web: manmove
|
2011-03-21 13:00:00 +00:00
|
|
|
cp README $(WEBDIR)/$(WEBPAGE)
|
2011-03-24 14:45:31 +00:00
|
|
|
rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man
|
2011-03-25 10:17:52 +00:00
|
|
|
cp -r $(MANHTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man
|
2011-03-24 14:42:06 +00:00
|
|
|
cd $(WEBDIR) && git add $(WEBBASE)/man
|
2011-03-21 13:00:00 +00:00
|
|
|
cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE)
|
2011-02-04 22:15:10 +00:00
|
|
|
cd $(WEBDIR) && make pub
|
2011-02-02 20:49:49 +00:00
|
|
|
|
|
|
|
pub:
|
|
|
|
git push --mirror
|
2011-03-16 10:38:05 +00:00
|
|
|
git push --mirror github
|