You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
4.5 KiB
159 lines
4.5 KiB
14 years ago
|
#!/bin/sh
|
||
|
#
|
||
|
# 2011 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/>.
|
||
|
#
|
||
|
#
|
||
|
# Push a directory to a target, both sides have the same name (i.e. explorers)
|
||
|
# or
|
||
|
# Pull a directory from a target, both sides have the same name (i.e. explorers)
|
||
|
#
|
||
14 years ago
|
|
||
|
# Manpage and HTML
|
||
|
A2XM=a2x -f manpage --no-xmllint
|
||
14 years ago
|
A2XH=a2x -f xhtml --no-xmllint
|
||
14 years ago
|
|
||
14 years ago
|
# Developer webbase
|
||
14 years ago
|
WEBDIR=$$HOME/niconetz
|
||
|
WEBBASE=software/cdist
|
||
|
WEBPAGE=$(WEBBASE).mdwn
|
||
|
|
||
14 years ago
|
# Documentation
|
||
14 years ago
|
MANDIR=doc/man
|
||
14 years ago
|
|
||
|
MAN1DSTDIR=$(MANDIR)/man1
|
||
|
MAN7DSTDIR=$(MANDIR)/man7
|
||
14 years ago
|
MANOUTDIRS=$(MAN1DSTDIR) $(MAN7DSTDIR)
|
||
14 years ago
|
|
||
14 years ago
|
MAN1SRC= \
|
||
14 years ago
|
$(MANDIR)/cdist-code-run.text \
|
||
14 years ago
|
$(MANDIR)/cdist-code-run-all.text \
|
||
14 years ago
|
$(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 \
|
||
14 years ago
|
$(MANDIR)/cdist-manifest-run.text \
|
||
14 years ago
|
$(MANDIR)/cdist-manifest-run-init.text \
|
||
14 years ago
|
$(MANDIR)/cdist-manifest-run-all.text \
|
||
14 years ago
|
$(MANDIR)/cdist-object-explorer-all.text \
|
||
14 years ago
|
$(MANDIR)/cdist-object-gencode.text \
|
||
14 years ago
|
$(MANDIR)/cdist-object-gencode-all.text \
|
||
14 years ago
|
$(MANDIR)/cdist-remote-explorer-run.text \
|
||
14 years ago
|
$(MANDIR)/cdist-run-remote.text \
|
||
14 years ago
|
$(MANDIR)/cdist-type-build-emulation.text \
|
||
14 years ago
|
$(MANDIR)/cdist-type-emulator.text \
|
||
14 years ago
|
$(MANDIR)/cdist-type-template.text \
|
||
14 years ago
|
|
||
14 years ago
|
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 \
|
||
14 years ago
|
|
||
14 years ago
|
# Manpages from types
|
||
14 years ago
|
MAN7TYPESRC=$(shell ls conf/type/*/man.text)
|
||
14 years ago
|
|
||
14 years ago
|
# Source files after linking them
|
||
|
MAN1TMPSRC=$(shell ls $(MAN1DSTDIR)/*.text)
|
||
|
MAN7TMPSRC=$(shell ls $(MAN7DSTDIR)/*.text)
|
||
|
|
||
|
# Destination files based on linked files, not static list
|
||
|
MAN1DST=$(MAN1TMPSRC:.text=.1)
|
||
|
MAN7DST=$(MAN7TMPSRC:.text=.7)
|
||
|
MANHTML=$(MAN1TMPSRC:.text=.html) $(MAN7TMPSRC:.text=.html)
|
||
14 years ago
|
|
||
14 years ago
|
################################################################################
|
||
|
# User targets
|
||
|
#
|
||
14 years ago
|
|
||
14 years ago
|
all:
|
||
|
@echo ''
|
||
|
@echo 'Welcome to cdist!'
|
||
|
@echo ''
|
||
|
@echo 'Here are the possible targets:'
|
||
|
@echo ''
|
||
14 years ago
|
@echo ' man: Build manpages (requires Asciidoc)'
|
||
14 years ago
|
@echo ' manhtml: Build html-manpages (requires Asciidoc)'
|
||
14 years ago
|
@echo ' clean: Remove build stuff'
|
||
|
@echo ''
|
||
|
@echo ''
|
||
14 years ago
|
|
||
14 years ago
|
|
||
14 years ago
|
################################################################################
|
||
|
# Documentation
|
||
|
#
|
||
|
|
||
14 years ago
|
# Create manpages
|
||
|
man: $(MAN1DST) $(MAN7DST)
|
||
|
manhtml: $(MANHTML)
|
||
14 years ago
|
|
||
14 years ago
|
$(MAN1DST) $(MAN7DST) $(MANHTML): $(MANOUTDIRS)
|
||
14 years ago
|
|
||
14 years ago
|
# Create output dirs
|
||
14 years ago
|
$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) $(MANTMPDIR):
|
||
14 years ago
|
mkdir -p $@
|
||
|
|
||
|
# Link source files
|
||
14 years ago
|
manlink: $(MAN1SRC) $(MAN7SRC) $(MANTYPE7SRC) $(MANOUTDIRS)
|
||
14 years ago
|
for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MAN1DSTDIR); done
|
||
|
for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MAN7DSTDIR); done
|
||
14 years ago
|
for mansrc in $(MAN7TYPESRC); do \
|
||
|
dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \
|
||
14 years ago
|
ln -sf ../../../$$mansrc $$dst; done
|
||
14 years ago
|
|
||
14 years ago
|
%.1 %.7: %.text manlink
|
||
14 years ago
|
$(A2XM) $*.text
|
||
14 years ago
|
|
||
14 years ago
|
%.html: %.text manlink
|
||
14 years ago
|
$(A2XH) $<
|
||
14 years ago
|
|
||
14 years ago
|
$(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh
|
||
14 years ago
|
$(MANDIR)/cdist-reference.text.sh
|
||
14 years ago
|
|
||
14 years ago
|
clean:
|
||
14 years ago
|
rm -rf $(MANOUTDIRS)
|
||
|
rm -f $(MANDIR)/cdist-reference.text
|
||
14 years ago
|
|
||
|
################################################################################
|
||
|
# Developer targets
|
||
|
#
|
||
|
|
||
|
test:
|
||
14 years ago
|
# ubuntu
|
||
14 years ago
|
.rsync lyni@tablett:cdist
|
||
14 years ago
|
# redhat
|
||
14 years ago
|
.rsync nicosc@free.ethz.ch:cdist
|
||
14 years ago
|
# gentoo
|
||
|
.rsync nicosc@ru3.inf.ethz.ch:cdist
|
||
14 years ago
|
|
||
14 years ago
|
web: manmove
|
||
14 years ago
|
cp README $(WEBDIR)/$(WEBPAGE)
|
||
14 years ago
|
rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man
|
||
14 years ago
|
cp -r $(MANHTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man
|
||
14 years ago
|
cd $(WEBDIR) && git add $(WEBBASE)/man
|
||
14 years ago
|
cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE)
|
||
14 years ago
|
cd $(WEBDIR) && make pub
|
||
14 years ago
|
|
||
|
pub:
|
||
|
git push --mirror
|
||
14 years ago
|
git push --mirror github
|