* Makefile und footer gepacht

This commit is contained in:
phil 2006-07-27 13:23:04 +00:00
parent 9125027691
commit e64b8dc228
2 changed files with 56 additions and 29 deletions

View file

@ -3,13 +3,15 @@ LYX_FILES := $(shell find -name *.lyx)
# the tex output of lyx # the tex output of lyx
TEX_FILES := $(patsubst %.lyx,%.tex,$(LYX_FILES)) TEX_FILES := $(patsubst %.lyx,%.tex,$(LYX_FILES))
# output files of lyx that are already processed by mod_html_files.py # output files of lyx that are already processed by mod_html_files.py
HTML_FILES := $(patsubst %.lyx,%.html,$(LYX_FILES)) EXPORT_DIRS := $(shell for a in $(LYX_FILES); do echo -n "$$a" | sed "s%/\([^/]*\).lyx%/export-%"; echo "$$(basename $${a%.lyx})" ; done)
# menue and footer files
INC_FILES := $(wildcard *.inc)
# png files (get converted to eps) # png files (get converted to eps)
PNG_FILES := $(shell find -name *.png) PNG_FILES := $(shell find -name *.png)
# converted eps files # converted eps files
EPS_FILES := $(patsubst %.png,%.eps,$(PNG_FILES)) EPS_FILES := $(patsubst %.png,%.eps,$(PNG_FILES))
# menue and footer files
INC_FILES := $(wildcard *.inc)
# the tex output of include files
INC_TEX_FILES := $(patsubst %.inc,%.tex,$(INC_FILES))
# look for lyx executable # look for lyx executable
LYX_BIN = $(shell which lyx lyx-qt lyx-xform | head -1) LYX_BIN = $(shell which lyx lyx-qt lyx-xform | head -1)
@ -22,11 +24,12 @@ LATEX2HTML_OPTS := -no_auto_link -split 0 -no_navigation -no_subdir -info 0 -sty
# if another target depends on them (they do not look for timestamps) # if another target depends on them (they do not look for timestamps)
.PHONY : clean clean-targets install all .PHONY : clean clean-targets install all
# default target (offline) # default target
all: $(HTML_FILES) all: $(EXPORT_DIRS)
# copy the created files to the destination directory (usually outside of this directory tree) # copy the created files to the destination directory (usually outside of this directory tree)
install: $(HTML_FILES) install: $(EXPORT_DIRS)
echo $(EXPORT_DIRS)
@if [ -z "$(CCD_BUILD_DIR)" ] ; \ @if [ -z "$(CCD_BUILD_DIR)" ] ; \
then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ; \ then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ; \
false ; \ false ; \
@ -35,46 +38,70 @@ install: $(HTML_FILES)
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \ then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \
false ; \ false ; \
fi fi
mkdir -p $(CCD_BUILD_DIR)/doku mkdir -p "$(CCD_BUILD_DIR)/doku/macos"
mkdir -p "$(CCD_BUILD_DIR)/doku/linux"
mkdir -p "$(CCD_BUILD_DIR)/doku/windows"
@# copy os-independent stuff
for a in $(EXPORT_DIRS) ; \
do if echo "$$(dirname $$a)" | grep -q "/common/" ; \
then DIRNAME_MAC="$(CCD_BUILD_DIR)/doku/macos/$$(basename $$(dirname $$a))" ; \
DIRNAME_LIN="$(CCD_BUILD_DIR)/doku/linux/$$(basename $$(dirname $$a))" ; \
DIRNAME_WIN="$(CCD_BUILD_DIR)/doku/windows/$$(basename $$(dirname $$a))" ; \
mkdir -p "$$DIRNAME_MAC" "$$DIRNAME_LIN" "$$DIRNAME_WIN" ; \
cp -r "$$a/"* "$$DIRNAME_MAC" ; \
cp -r "$$a/"* "$$DIRNAME_LIN" ; \
cp -r "$$a/"* "$$DIRNAME_WIN" ; \
fi ; \
done
@# copy os-specific stuff @# copy os-specific stuff
cp -r macos linux windows $(CCD_BUILD_DIR)/doku for a in $(EXPORT_DIRS) ; \
do if echo "$$(dirname $$a)" | grep -q "/common/" ; \
then true ; \
else mkdir -p "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ; \
cp -r "$$a/"* "$(CCD_BUILD_DIR)/doku/$$(dirname $$a)" ; \
fi ; \
done
@# copy general documents @# copy general documents
cp -rf common/* $(CCD_BUILD_DIR)/doku/macos #cp -r common $(CCD_BUILD_DIR)/doku/macos
cp -rf common/* $(CCD_BUILD_DIR)/doku/linux #cp -r common $(CCD_BUILD_DIR)/doku/linux
cp -rf common/* $(CCD_BUILD_DIR)/doku/windows #cp -r common $(CCD_BUILD_DIR)/doku/windows
@# copy os-specific stuff
#cp -r macos/* $(CCD_BUILD_DIR)/doku/macos
#cp -r linux/* $(CCD_BUILD_DIR)/doku/linux
#cp -r windows/* $(CCD_BUILD_DIR)/doku/windows
@# remove unnecessary files (eps, lyx, tex) @# remove unnecessary files (eps, lyx, tex)
find $(CCD_BUILD_DIR)/doku -name \*.tex -exec rm "{}" \; #find $(CCD_BUILD_DIR)/doku -name \*.tex -exec rm "{}" \;
find $(CCD_BUILD_DIR)/doku -name \*.lyx -exec rm "{}" \; #find $(CCD_BUILD_DIR)/doku -name \*.lyx -exec rm "{}" \;
find $(CCD_BUILD_DIR)/doku -name \*.eps -exec rm "{}" \; #find $(CCD_BUILD_DIR)/doku -name \*.eps -exec rm "{}" \;
clean-targets: clean-targets:
-rm $(HTML_FILES) 2>/dev/null -rm -r $(EXPORT_DIRS) 2>/dev/null
# create tex files from lyx # create tex files from lyx
$(TEX_FILES): $(INC_FILES) $(LYX_FILES) $(TEX_FILES): $(LYX_FILES)
$(LYX_BIN) -e latex $*.lyx $(LYX_BIN) -e latex $*.lyx
# original html-files, as they are created by lyx # original html-files, as they are created by lyx
$(HTML_FILES): %.html: %.tex $(LYX_FILES) $(INC_FILES) footer.asc $(EXPORT_DIRS): $(TEX_FILES) $(INC_FILES) footer.asc
cp $(INC_FILES) $(dir $@) -test -d "$@" && rm -rf "$@"
latex2html $(LATEX2HTML_OPTS) $*.tex mkdir -p "$@"
-rm $(dir $@)*.inc 2>/dev/null latex2html $(LATEX2HTML_OPTS) -dir "$@" $(dir $@)/$(patsubst export-%,%.tex,$(notdir $@))
@# die html-Datei wurde jetzt erstellt (inklusive Bilder) @# die html-Datei wurde jetzt erstellt (inklusive Bilder)
-rm $(dir $@)WARNINGS $(dir $@)labels.pl $(dir $@)internals.pl $*.log 2>/dev/null -#rm $(dir $@)WARNINGS $(dir $@)labels.pl $(dir $@)internals.pl $*.log 2>/dev/null
-rm $*.css 2>/dev/null -rm $@/$(patsubst export-%,%.css,$(notdir $@)) 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 -rm $@/images.aux $@/images.log $@/images.out $@/images.pl $@/images.tex $@/missfont.log $@/WARNINGS $@/labels.pl 2>/dev/null
python mod_html_files.py $@ python mod_html_files.py $@/$(patsubst export-%,%.html,$(notdir $@))
@# add footer @# add footer
cat footer.asc >>$@ cat footer.asc >>$@/$(patsubst export-%,%.html,$(notdir $@))
@# replace unix-like linebreaks with their DOS counterparts @# replace unix-like linebreaks with their DOS counterparts
unix2dos $@ unix2dos $@/$(patsubst export-%,%.html,$(notdir $@))
clean: clean: clean-targets
-rm $(TEX_FILES) 2>/dev/null -rm $(TEX_FILES) 2>/dev/null
-rm $(HTML_FILES) 2>/dev/null -rm $(INC_TEX_FILES) 2>/dev/null
-rm $(EPS_FILES) 2>/dev/null -rm $(EPS_FILES) 2>/dev/null

View file

@ -5,7 +5,7 @@
</div> </div>
<div class="right"> <div class="right">
<a href="about.html#lizenz" title="CryptoCD Lizenz"><img src="somerights20.png" width="88" height="31" border="0" alt="Creative Commons"></a> <a href="about.html#lizenz" title="CryptoCD Lizenz"><img src="../../somerights20.png" width="88" height="31" border="0" alt="Creative Commons"></a>
<!-- /Creative Commons License --> <!-- /Creative Commons License -->
<!-- <!--