* Lars' Patch

This commit is contained in:
phil 2006-07-27 00:10:18 +00:00
parent f4b5132dfd
commit 9125027691
2 changed files with 32 additions and 30 deletions

View file

@ -59,7 +59,7 @@ help:
clean:
-make -C documents clean
-rm -r $(TMP_ROOT)/* 2>/dev/null
-rm -rf $(TMP_ROOT)/* 2>/dev/null
dist-clean: clean
@ -87,7 +87,9 @@ $(CREATE_DIRS):
cd-template: verzeichnisstruktur
@rm -rf $(CCD_BUILD_DIR)
@svn export cd-template "$(CCD_BUILD_DIR)"
@# export local svn directory OR just copy the directories (for non-svn users)
@svn export cd-template "$(CCD_BUILD_DIR)" \
|| mkdir -p $(dir $(CCD_BUILD_DIR)) && cp -r cd-template $(CCD_BUILD_DIR)
doku: cd-template

View file

@ -4,10 +4,8 @@ LYX_FILES := $(shell find -name *.lyx)
TEX_FILES := $(patsubst %.lyx,%.tex,$(LYX_FILES))
# output files of lyx that are already processed by mod_html_files.py
HTML_FILES := $(patsubst %.lyx,%.html,$(LYX_FILES))
# menue and footers are added later
TARGET_FILES := $(foreach file,$(LYX_FILES),_output/$(basename $(notdir $(file))).html)
# menue and footer files
ASC_FILES := $(wildcard *.asc)
INC_FILES := $(wildcard *.inc)
# png files (get converted to eps)
PNG_FILES := $(shell find -name *.png)
# converted eps files
@ -17,7 +15,7 @@ LYX_BIN = $(shell which lyx lyx-qt lyx-xform | head -1)
# output parameters for latex2html
LATEX2HTMLPREFIX := -no_auto_link -split 0 -no_navigation -no_subdir -dir _output -info 0 -style cryptocd.css -local_icons -address 0
LATEX2HTML_OPTS := -no_auto_link -split 0 -no_navigation -no_subdir -info 0 -style ../../cryptocd.css -local_icons -address 0
# virtual targets that have different names than the produced files - they will alway be executed,
@ -25,10 +23,10 @@ LATEX2HTMLPREFIX := -no_auto_link -split 0 -no_navigation -no_subdir -dir _outpu
.PHONY : clean clean-targets install all
# default target (offline)
all: $(TARGET_FILES)
all: $(HTML_FILES)
# copy the created files to the destination directory (usually outside of this directory tree)
install: $(TARGET_FILES)
install: $(HTML_FILES)
@if [ -z "$(CCD_BUILD_DIR)" ] ; \
then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ; \
false ; \
@ -37,35 +35,41 @@ install: $(TARGET_FILES)
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \
false ; \
fi
@cp -r _output/* "$(CCD_BUILD_DIR)/doku"
mkdir -p $(CCD_BUILD_DIR)/doku
@# copy os-specific stuff
cp -r macos linux windows $(CCD_BUILD_DIR)/doku
@# copy general documents
cp -rf common/* $(CCD_BUILD_DIR)/doku/macos
cp -rf common/* $(CCD_BUILD_DIR)/doku/linux
cp -rf common/* $(CCD_BUILD_DIR)/doku/windows
@# remove unnecessary files (eps, lyx, tex)
find $(CCD_BUILD_DIR)/doku -name \*.tex -exec rm "{}" \;
find $(CCD_BUILD_DIR)/doku -name \*.lyx -exec rm "{}" \;
find $(CCD_BUILD_DIR)/doku -name \*.eps -exec rm "{}" \;
clean-targets:
-rm $(TARGET_FILES) 2>/dev/null
-rm $(HTML_FILES) 2>/dev/null
# add headers, navigation and footers
$(TARGET_FILES): $(HTML_FILES) $(ASC_FILES)
cat $(shell find -name $(notdir $@) | grep -v "_output") footer.asc >$@
# create tex files from lyx
$(TEX_FILES): menue.inc $(LYX_FILES)
$(TEX_FILES): $(INC_FILES) $(LYX_FILES)
$(LYX_BIN) -e latex $*.lyx
# original html-files, as they are created by lyx
$(HTML_FILES): %.html: %.tex
@-[ ! -e "_output" ] && mkdir _output
cp menue.inc $(dir $@)
latex2html $(LATEX2HTMLPREFIX) $*.tex
rm $(dir $@)/menue.inc
# die html-Datei wurde jetzt im _output-Verzeichnis erstellt (inklusive Bilder)
-rm _output/WARNINGS $*-labels.pl $*-internals.pl $*.log 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/$(notdir $(basename $@)).html $@
$(HTML_FILES): %.html: %.tex $(LYX_FILES) $(INC_FILES) footer.asc
cp $(INC_FILES) $(dir $@)
latex2html $(LATEX2HTML_OPTS) $*.tex
-rm $(dir $@)*.inc 2>/dev/null
@# die html-Datei wurde jetzt erstellt (inklusive Bilder)
-rm $(dir $@)WARNINGS $(dir $@)labels.pl $(dir $@)internals.pl $*.log 2>/dev/null
-rm $*.css 2>/dev/null
-rm $(dir $@)images.aux $(dir $@)images.log $(dir $@)images.out $(dir $@)images.pl $(dir $@)images.text $(dir $@)img?.old $(dir $@)missfont.log $(dir $@)images.tex 2>/dev/null
python mod_html_files.py $@
# replace unix-like linebreaks with their DOS couterparts
@# add footer
cat footer.asc >>$@
@# replace unix-like linebreaks with their DOS counterparts
unix2dos $@
@ -73,8 +77,4 @@ clean:
-rm $(TEX_FILES) 2>/dev/null
-rm $(HTML_FILES) 2>/dev/null
-rm $(EPS_FILES) 2>/dev/null
-rm -r _output 2>/dev/null
# -rm $(foreach dir,$(DOCUMENT_NAMES),$(dir)/menue.inc) 2>/dev/null
# -rm $(foreach dir,$(DOCUMENT_NAMES),$(dir)/WARNINGS) 2>/dev/null
# -rm $(foreach dir,$(DOCUMENT_NAMES),$(dir)/$(dir).emergency) 2>/dev/null