Dokument-Makefile lauffaehig gemacht

This commit is contained in:
lars 2005-04-24 12:06:14 +00:00
parent 62c34ca836
commit f261f7e793
2 changed files with 29 additions and 19 deletions

View file

@ -1,31 +1,37 @@
DOCUMENT_NAMES="asymmetrie chaosradio copyleft intro mailserviceanbieter mozilla outlook pgp_vs_gpg senselab thunderbird thunderbirdnutzung warumverschluesselung wiefunktionierts winpt"
#DOCUMENT_NAMES=asymmetrie chaosradio copyleft intro mailserviceanbieter mozilla outlook pgp_vs_gnupg senselab thunderbird thunderbirdnutzung warumverschluesselung wiefunktionierts winpt
DOCUMENT_NAMES=asymmetrie chaosradio copyleft intro mailserviceanbieter mozilla outlook pgp_vs_gnupg senselab wiefunktionierts
LYX_FILES := $(foreach dir,$(DOCUMENT_NAMES),$(dir)/$(dir).lyx)
TEX_FILES := $(patsubst %.lyx,%.tex.$(LYX_FILES))
HTML_FILES := $(patsubst %.lyx,%.html.$(LYX_FILES))
TARGET_FILES := $(forecho dir,$(DOCUMENT_NAMES),_output/$(dir).html)
TEX_FILES := $(patsubst %.lyx,%.tex,$(LYX_FILES))
HTML_FILES := $(patsubst %.lyx,%.html,$(LYX_FILES))
TARGET_FILES := $(foreach dir,$(DOCUMENT_NAMES),_output/$(dir).html)
ASC_FILES := $(wildcard *.asc)
LINE_STATUS = offline
#LATEX2HTMLPREFIX := -no_auto_link -split 0 -init_file ../../convert-scripts/latex2html-init -no_navigation -no_subdir
LATEX2HTMLPREFIX := -no_auto_link -split 0 -no_navigation -dir _output
#LATEX2HTMLPREFIX := -no_auto_link -split 0 -init_file ../convert-scripts/latex2html-init -no_navigation -no_subdir
LATEX2HTMLPREFIX := -no_auto_link -split 0 -no_navigation -no_subdir -dir _output
.PHONY : clean install-online install-offline
.PHONY : clean online offline clean-targets
# default target (offline)
all: $(HTML_FILES)
install: $(TARGET_FILES)
@[ -z "$(CCD_BUILD_DIR)" ] && echo "CCD_BUILD_DIR must be defined!" && exit 1
@[ ! -e "$(CCD_BUILD_DIR)" ] && echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" && exit 2
@[ ! -e "$(CCD_BUILD_DIR)/doku" ] && mkdir "$(CCD_BUILD_DIR)/doku"
@cp _output/* "$(CCD_BUILD_DIR)/doku"
install-%: LINE_STATUS=%
clean-targets:
-rm $(TARGET_FILES) 2>/dev/null
online offline: $(HTML_FILE) $(ASC_FILES)
online : LINE_STATUS=online
offline : LINE_STATUS=offline
online offline: clean-targets $(TARGET_FILES)
$(TARGET_FILES): _output/%.html: %/%.html $(ASC_FILES)
cat header.asc nav.asc.$(LINE_STATUS) footer.nav >$@
$(TARGET_FILES): $(HTML_FILES) $(ASC_FILES)
cat header.asc nav.asc.$(LINE_STATUS) $(notdir $(basename $@))/$(notdir $@) footer.asc >$@
# create tex files from lyx
@ -34,10 +40,14 @@ $(TEX_FILES): %.tex: %.lyx
# original html-files, as they are created by lyx
$(HTML_FILES): %/*.tex: %
latex2html $(LATEX2HTMLPREFIX) $*/$*.tex
-rm WARNINGS $*/$*-labels.pl $*/$*-internals.pl $*/$*.css 2>/dev/null
python ../../convert-scripts/mod_html_files.py $@
$(HTML_FILES): %.html: %.tex
latex2html $(LATEX2HTMLPREFIX) $*.tex
# die html-Datei wurde jetzt im _output-Verzeichnis erstellt (inklusive Bilder)
-rm _output/WARNINGS $*-labels.pl $*-internals.pl 2>/dev/null
-rm _output/$(notdir $(basename $@)).css 2>/dev/null
-rm _output/images.aux _output/images.log _output/images.out _output/images.pl _output/images.text _output/img?.old _output/labels.pl _output/missfont.log _output/images.tex 2>/dev/null
mv _output/$(shell dirname $@).html $@
python ../convert-scripts/mod_html_files.py $@
clean:
@ -45,5 +55,5 @@ clean:
-rm $(TEX_FILES) 2>/dev/null
-rm $(HTML_FILES) 2>/dev/null
-rm _output/* 2>/dev/null
-rm */*.emergency
-rm $(foreach dir,$(DOCUMENT_NAMES),$(dir)/$(dir).emergency) 2>/dev/null