cryptocd/documents/Makefile

81 lines
2.7 KiB
Makefile
Raw Normal View History

# our self written documents
2005-12-12 21:47:35 +01:00
LYX_FILES := $(shell find -name *.lyx)
# the tex output of lyx
2005-04-24 14:06:14 +02:00
TEX_FILES := $(patsubst %.lyx,%.tex,$(LYX_FILES))
# 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 footer files
2006-07-27 02:10:18 +02:00
INC_FILES := $(wildcard *.inc)
# png files (get converted to eps)
PNG_FILES := $(shell find -name *.png)
# converted eps files
EPS_FILES := $(patsubst %.png,%.eps,$(PNG_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
# 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
# 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 clean-targets install all
2005-04-24 02:20:04 +02:00
# default target (offline)
2006-07-27 02:10:18 +02:00
all: $(HTML_FILES)
# copy the created files to the destination directory (usually outside of this directory tree)
2006-07-27 02:10:18 +02:00
install: $(HTML_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
@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 ; \
fi
2006-07-27 02:10:18 +02:00
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 "{}" \;
2005-04-24 02:20:04 +02:00
2005-04-24 14:06:14 +02:00
clean-targets:
2006-07-27 02:10:18 +02:00
-rm $(HTML_FILES) 2>/dev/null
2005-04-24 02:20:04 +02:00
2005-04-24 02:20:04 +02:00
# create tex files from lyx
2006-07-27 02:10:18 +02:00
$(TEX_FILES): $(INC_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 02:10:18 +02:00
$(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 $@
2006-07-27 02:10:18 +02:00
@# add footer
cat footer.asc >>$@
@# replace unix-like linebreaks with their DOS counterparts
unix2dos $@
2005-04-24 02:20:04 +02:00
clean:
-rm $(TEX_FILES) 2>/dev/null
-rm $(HTML_FILES) 2>/dev/null
-rm $(EPS_FILES) 2>/dev/null
2005-04-24 02:20:04 +02:00