2005-05-13 11:51:13 +02:00
|
|
|
# our self written documents
|
2005-12-12 21:47:35 +01:00
|
|
|
LYX_FILES := $(shell find -name *.lyx)
|
2005-05-13 11:51:13 +02:00
|
|
|
# the tex output of lyx
|
2005-04-24 14:06:14 +02:00
|
|
|
TEX_FILES := $(patsubst %.lyx,%.tex,$(LYX_FILES))
|
2005-05-13 11:51:13 +02:00
|
|
|
# output files of lyx that are already processed by mod_html_files.py
|
2005-04-24 14:06:14 +02:00
|
|
|
HTML_FILES := $(patsubst %.lyx,%.html,$(LYX_FILES))
|
2005-07-07 11:10:12 +02:00
|
|
|
# menue and footers are added (according to online/offline target)
|
2005-12-12 21:47:35 +01:00
|
|
|
TARGET_FILES := $(foreach file,$(LYX_FILES),_output/$(basename $(notdir $(file))).html)
|
2005-07-07 11:10:12 +02:00
|
|
|
# menue and footer files
|
2005-04-24 02:20:04 +02:00
|
|
|
ASC_FILES := $(wildcard *.asc)
|
2005-05-13 11:51:13 +02:00
|
|
|
# target: online or offline (will be overriden for online target automatically)
|
2005-04-24 02:20:04 +02:00
|
|
|
LINE_STATUS = offline
|
2006-01-21 18:46:19 +01:00
|
|
|
# look for lyx executable
|
|
|
|
LYX_BIN = $(shell which lyx lyx-qt lyx-xform | head -1)
|
2005-04-24 02:20:04 +02:00
|
|
|
|
2005-05-13 11:51:13 +02:00
|
|
|
|
|
|
|
# output parameters for latex2html
|
2005-05-13 10:40:22 +02:00
|
|
|
LATEX2HTMLPREFIX := -no_auto_link -split 0 -no_navigation -no_subdir -dir _output -info 0 -style cryptocd.css -local_icons -address 0
|
2005-04-24 02:20:04 +02:00
|
|
|
|
|
|
|
|
2005-05-13 11:51:13 +02:00
|
|
|
# virtual targets that have different names than the produced files - they will alway be executed,
|
|
|
|
# if another target depends on them (they do not look for timestamps)
|
|
|
|
.PHONY : clean online offline clean-targets install all
|
2005-04-24 02:20:04 +02:00
|
|
|
|
|
|
|
# default target (offline)
|
2005-05-14 15:19:19 +02:00
|
|
|
all: $(TARGET_FILES)
|
2005-05-13 11:51:13 +02:00
|
|
|
|
|
|
|
# copy the created files to the destination directory (usually outside of this directory tree)
|
2005-04-24 14:06:14 +02:00
|
|
|
install: $(TARGET_FILES)
|
2005-05-13 22:39:10 +02:00
|
|
|
@if [ -z "$(CCD_BUILD_DIR)" ] ; \
|
|
|
|
then echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 ; \
|
|
|
|
false ; \
|
|
|
|
fi
|
2005-04-24 16:54:04 +02:00
|
|
|
@if [ ! -e "$(CCD_BUILD_DIR)" ] ; \
|
|
|
|
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \
|
2005-05-13 22:39:10 +02:00
|
|
|
false ; \
|
2005-04-24 16:54:04 +02:00
|
|
|
fi
|
|
|
|
@cp -r _output/* "$(CCD_BUILD_DIR)/doku"
|
2005-04-24 02:20:04 +02:00
|
|
|
|
2005-04-24 15:06:48 +02:00
|
|
|
|
2005-04-24 14:06:14 +02:00
|
|
|
clean-targets:
|
|
|
|
-rm $(TARGET_FILES) 2>/dev/null
|
2005-04-24 02:20:04 +02:00
|
|
|
|
2005-05-13 11:51:13 +02:00
|
|
|
|
2005-04-24 15:20:57 +02:00
|
|
|
online: LINE_STATUS=online
|
|
|
|
offline: LINE_STATUS=offline
|
2005-05-14 15:19:19 +02:00
|
|
|
|
|
|
|
# pruefen, ob die Menue-Datei durch eine neuere ersetzt werden muss - ansonsten: ignorieren
|
2005-05-14 16:39:20 +02:00
|
|
|
menue.inc online offline: menue_$(LINE_STATUS).inc
|
|
|
|
@if diff -qN menue.inc menue_$(LINE_STATUS).inc >/dev/null ;\
|
2005-05-14 15:19:19 +02:00
|
|
|
then true ;\
|
2005-05-14 16:39:20 +02:00
|
|
|
else cp menue_$(LINE_STATUS).inc menue.inc ;\
|
2005-12-12 21:47:35 +01:00
|
|
|
make $@ ;\
|
2005-05-14 15:19:19 +02:00
|
|
|
fi
|
2005-12-12 21:47:35 +01:00
|
|
|
# "make $@" is necessary, as the dependency of HTML_FILES was checked, before
|
|
|
|
# menue.inc was updated
|
2005-05-14 15:19:19 +02:00
|
|
|
|
|
|
|
online offline: $(TARGET_FILES)
|
2005-04-24 02:20:04 +02:00
|
|
|
|
2005-05-13 11:51:13 +02:00
|
|
|
|
|
|
|
# add headers, navigation and footers
|
2005-04-24 14:06:14 +02:00
|
|
|
$(TARGET_FILES): $(HTML_FILES) $(ASC_FILES)
|
2005-12-13 00:26:52 +01:00
|
|
|
cat $(shell find -name $(notdir $@) | grep -v "_output") footer.asc >$@
|
2005-05-14 15:19:19 +02:00
|
|
|
|
2005-04-24 02:20:04 +02:00
|
|
|
# create tex files from lyx
|
2005-05-14 16:39:20 +02:00
|
|
|
$(TEX_FILES): menue.inc $(LYX_FILES)
|
2006-01-21 18:46:19 +01:00
|
|
|
$(LYX_BIN) -e latex $*.lyx
|
2005-04-24 02:20:04 +02:00
|
|
|
|
2005-04-24 15:20:57 +02:00
|
|
|
|
2005-04-24 02:20:04 +02:00
|
|
|
# original html-files, as they are created by lyx
|
2005-04-24 15:20:57 +02:00
|
|
|
$(HTML_FILES): %.html: %.tex
|
|
|
|
@-[ ! -e "_output" ] && mkdir _output
|
2005-12-12 21:47:35 +01:00
|
|
|
cp menue.inc $(dir $@)
|
2005-04-24 14:06:14 +02:00
|
|
|
latex2html $(LATEX2HTMLPREFIX) $*.tex
|
2005-12-12 21:47:35 +01:00
|
|
|
rm $(dir $@)/menue.inc
|
2005-04-24 14:06:14 +02:00
|
|
|
# die html-Datei wurde jetzt im _output-Verzeichnis erstellt (inklusive Bilder)
|
2005-04-24 15:20:57 +02:00
|
|
|
-rm _output/WARNINGS $*-labels.pl $*-internals.pl $*.log 2>/dev/null
|
2005-12-12 21:47:35 +01:00
|
|
|
-rm _output/$(dir $@).css 2>/dev/null
|
2005-04-24 14:06:14 +02:00
|
|
|
-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
|
2005-12-12 21:47:35 +01:00
|
|
|
mv _output/$(notdir $(basename $@)).html $@
|
2005-04-24 18:18:51 +02:00
|
|
|
python mod_html_files.py $@
|
2005-04-24 02:20:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm $(TEX_FILES) 2>/dev/null
|
|
|
|
-rm $(HTML_FILES) 2>/dev/null
|
2005-04-24 15:20:57 +02:00
|
|
|
-rm -r _output 2>/dev/null
|
2005-12-12 21:47:35 +01:00
|
|
|
# -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
|
2005-05-14 16:39:20 +02:00
|
|
|
-rm menue.inc
|
2005-04-24 02:20:04 +02:00
|
|
|
|