fixed: "CCD_BUILD_DIR must be defined" error now only appears if necessary

added some comments to the Makefile
This commit is contained in:
lars 2005-05-13 09:51:13 +00:00
parent 22f12b3e87
commit dca1477be2

View file

@ -1,24 +1,34 @@
DOCUMENT_NAMES=asymmetrie chaosradio copyleft intro mailserviceanbieter mozilla outlook pgp_vs_gnupg senselab thunderbird thunderbirdnutzung warumverschluesselung wiefunktionierts winpt DOCUMENT_NAMES=asymmetrie chaosradio copyleft intro mailserviceanbieter mozilla outlook pgp_vs_gnupg senselab thunderbird thunderbirdnutzung warumverschluesselung wiefunktionierts winpt
# our self written documents
LYX_FILES := $(foreach dir,$(DOCUMENT_NAMES),$(dir)/$(dir).lyx) LYX_FILES := $(foreach dir,$(DOCUMENT_NAMES),$(dir)/$(dir).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
HTML_FILES := $(patsubst %.lyx,%.html,$(LYX_FILES)) HTML_FILES := $(patsubst %.lyx,%.html,$(LYX_FILES))
# headers, navigation and footers are added (according to online/offline target)
TARGET_FILES := $(foreach dir,$(DOCUMENT_NAMES),_output/$(dir).html) TARGET_FILES := $(foreach dir,$(DOCUMENT_NAMES),_output/$(dir).html)
# header, navigation and footer files
ASC_FILES := $(wildcard *.asc) ASC_FILES := $(wildcard *.asc)
# target: online or offline (will be overriden for online target automatically)
LINE_STATUS = offline LINE_STATUS = offline
# 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 LATEX2HTMLPREFIX := -no_auto_link -split 0 -no_navigation -no_subdir -dir _output -info 0 -style cryptocd.css -local_icons -address 0
.PHONY : clean online offline clean-targets install # 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
# default target (offline) # default target (offline)
all: $(HTML_FILES) all: $(HTML_FILES)
# copy the created files to the destination directory (usually outside of this directory tree)
install: $(TARGET_FILES) install: $(TARGET_FILES)
ifndef CCD_BUILD_DIR @[ -z "$(CCD_BUILD_DIR)" ] && echo "CCD_BUILD_DIR must be defined! (this should be done by the parent Makefile)" >&2 && false
$(error "CCD_BUILD_DIR must be defined!")
endif
@if [ ! -e "$(CCD_BUILD_DIR)" ] ; \ @if [ ! -e "$(CCD_BUILD_DIR)" ] ; \
then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \ then echo "CCD_BUILD_DIR ($(CCD_BUILD_DIR)) does not exist!" ; \
exit 1 ; \ exit 1 ; \
@ -29,10 +39,13 @@ install: $(TARGET_FILES)
clean-targets: clean-targets:
-rm $(TARGET_FILES) 2>/dev/null -rm $(TARGET_FILES) 2>/dev/null
online: LINE_STATUS=online online: LINE_STATUS=online
offline: LINE_STATUS=offline offline: LINE_STATUS=offline
online offline: clean-targets $(TARGET_FILES) online offline: clean-targets $(TARGET_FILES)
# add headers, navigation and footers
$(TARGET_FILES): $(HTML_FILES) $(ASC_FILES) $(TARGET_FILES): $(HTML_FILES) $(ASC_FILES)
cat nav.$(LINE_STATUS).asc $(notdir $(basename $@))/$(notdir $@) >$@ cat nav.$(LINE_STATUS).asc $(notdir $(basename $@))/$(notdir $@) >$@