2006-08-02 12:07:50 +02:00
|
|
|
# validation program
|
|
|
|
VALIDATE_BIN := validate
|
2006-12-29 16:35:05 +01:00
|
|
|
VALIDATE_OPTS :=
|
|
|
|
# alternativ kann auch ein anderes Pruef-Programm verwendet werden - tidy kann
|
|
|
|
# aber wohl nicht daran gehindert werden, unwichtige Nachrichten auszugeben
|
|
|
|
#VALIDATE_BIN := tidy
|
|
|
|
#VALIDATE_OPTS := -o /dev/null -errors -quiet
|
2005-05-13 11:51:13 +02:00
|
|
|
# our self written documents
|
2006-12-18 16:00:38 +01:00
|
|
|
LYX_FILES := $(shell find . -name *.lyx -type f)
|
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
|
2006-07-27 15:23:04 +02:00
|
|
|
EXPORT_DIRS := $(shell for a in $(LYX_FILES); do echo -n "$$a" | sed "s%/\([^/]*\).lyx%/export-%"; echo "$$(basename $${a%.lyx})" ; done)
|
2006-06-11 03:44:42 +02:00
|
|
|
# png files (get converted to eps)
|
2006-12-18 16:00:38 +01:00
|
|
|
PNG_FILES := $(shell find . -name *.png -type f)
|
2006-06-11 03:44:42 +02:00
|
|
|
# converted eps files
|
|
|
|
EPS_FILES := $(patsubst %.png,%.eps,$(PNG_FILES))
|
2006-07-27 15:23:04 +02:00
|
|
|
# menue and footer files
|
2006-07-31 23:13:50 +02:00
|
|
|
INC_FILES := $(wildcard *.inc) $(wildcard progress/*.inc)
|
2006-07-27 15:23:04 +02:00
|
|
|
# the tex output of include files
|
|
|
|
INC_TEX_FILES := $(patsubst %.inc,%.tex,$(INC_FILES))
|
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
|
2006-07-27 02:10:18 +02:00
|
|
|
LATEX2HTML_OPTS := -no_auto_link -split 0 -no_navigation -no_subdir -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)
|
2006-04-21 10:25:45 +02:00
|
|
|
.PHONY : clean clean-targets install all
|
2005-04-24 02:20:04 +02:00
|
|
|
|
2006-08-02 12:07:50 +02:00
|
|
|
|
2006-07-27 15:23:04 +02:00
|
|
|
# default target
|
|
|
|
all: $(EXPORT_DIRS)
|
2005-05-13 11:51:13 +02:00
|
|
|
|
2006-08-02 12:07:50 +02:00
|
|
|
|
|
|
|
# validate the html files
|
|
|
|
validate: $(EXPORT_DIRS)
|
2006-12-28 19:39:49 +01:00
|
|
|
@if which $(VALIDATE_BIN) >/dev/null ;\
|
|
|
|
then true ;\
|
|
|
|
else echo >&2 ;\
|
|
|
|
echo >&2 "*****************************************************************" ;\
|
|
|
|
echo >&2 "* Could not find the html-checker '$(VALIDATE_BIN)'! *" ;\
|
|
|
|
echo >&2 "* Debian users should run 'apt-get install wdg-html-validator'. *" ;\
|
|
|
|
echo >&2 "*****************************************************************";\
|
|
|
|
echo >&2 ;\
|
|
|
|
false ;\
|
|
|
|
fi
|
2006-12-29 16:35:05 +01:00
|
|
|
@$(VALIDATE_BIN) $(VALIDATE_OPTS) $(shell find . -name *.html -type f) ;\
|
2006-08-02 12:07:50 +02:00
|
|
|
|
|
|
|
|
2005-05-13 11:51:13 +02:00
|
|
|
# copy the created files to the destination directory (usually outside of this directory tree)
|
2006-07-27 15:23:04 +02:00
|
|
|
install: $(EXPORT_DIRS)
|
|
|
|
echo $(EXPORT_DIRS)
|
2006-07-29 18:23:30 +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 ;\
|
2005-05-13 22:39:10 +02:00
|
|
|
fi
|
2006-07-29 18:23:30 +02:00
|
|
|
@if [ ! -e "$(CCD_BUILD_DIR)" ] ;\
|
|
|
|
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ;\
|
|
|
|
false ;\
|
2005-04-24 16:54:04 +02:00
|
|
|
fi
|
2006-07-27 15:23:04 +02:00
|
|
|
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
|
2006-07-29 18:23:30 +02:00
|
|
|
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 ;\
|
2006-07-27 15:23:04 +02:00
|
|
|
done
|
2006-07-27 02:10:18 +02:00
|
|
|
@# copy os-specific stuff
|
2006-07-29 18:23:30 +02:00
|
|
|
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
|
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:
|
2006-07-27 15:23:04 +02:00
|
|
|
-rm -r $(EXPORT_DIRS) 2>/dev/null
|
2005-04-24 02:20:04 +02:00
|
|
|
|
2005-05-13 11:51:13 +02:00
|
|
|
|
2005-04-24 02:20:04 +02:00
|
|
|
# create tex files from lyx
|
2006-07-27 15:23:04 +02:00
|
|
|
$(TEX_FILES): $(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
|
2006-07-27 15:23:04 +02:00
|
|
|
$(EXPORT_DIRS): $(TEX_FILES) $(INC_FILES) footer.asc
|
|
|
|
-test -d "$@" && rm -rf "$@"
|
|
|
|
mkdir -p "$@"
|
|
|
|
latex2html $(LATEX2HTML_OPTS) -dir "$@" $(dir $@)/$(patsubst export-%,%.tex,$(notdir $@))
|
2006-07-27 02:10:18 +02:00
|
|
|
@# die html-Datei wurde jetzt erstellt (inklusive Bilder)
|
2006-07-27 15:23:04 +02:00
|
|
|
-#rm $(dir $@)WARNINGS $(dir $@)labels.pl $(dir $@)internals.pl $*.log 2>/dev/null
|
|
|
|
-rm $@/$(patsubst export-%,%.css,$(notdir $@)) 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 $@/$(patsubst export-%,%.html,$(notdir $@))
|
2006-07-27 02:10:18 +02:00
|
|
|
@# add footer
|
2006-07-27 15:23:04 +02:00
|
|
|
cat footer.asc >>$@/$(patsubst export-%,%.html,$(notdir $@))
|
2006-07-27 02:10:18 +02:00
|
|
|
@# replace unix-like linebreaks with their DOS counterparts
|
2006-07-27 15:23:04 +02:00
|
|
|
unix2dos $@/$(patsubst export-%,%.html,$(notdir $@))
|
2005-04-24 02:20:04 +02:00
|
|
|
|
|
|
|
|
2006-07-27 15:23:04 +02:00
|
|
|
clean: clean-targets
|
2005-04-24 02:20:04 +02:00
|
|
|
-rm $(TEX_FILES) 2>/dev/null
|
2006-07-27 15:23:04 +02:00
|
|
|
-rm $(INC_TEX_FILES) 2>/dev/null
|
2006-06-11 03:44:42 +02:00
|
|
|
-rm $(EPS_FILES) 2>/dev/null
|
2005-04-24 02:20:04 +02:00
|
|
|
|