| version 1.20, 2005/05/29 01:59:18 |
version 1.21, 2005/05/30 21:58:23 |
|
|
| # Licensed under terms of GNU General Public License. |
# Licensed under terms of GNU General Public License. |
| # All rights reserved. |
# All rights reserved. |
| # |
# |
| # $Platon: Platon.SK/office/_templates/Rules.make,v 1.19 2005/05/29 00:51:59 rajo Exp $ |
# $Platon: Platon.SK/office/_templates/Rules.make,v 1.20 2005/05/29 01:59:18 rajo Exp $ |
| # |
# |
| |
|
| ps__OUTPUT = $(shell sed 's/\#.*$$//g;' ps__OUTPUT 2>/dev/null) |
ps__OUTPUT = $(shell sed 's/\#.*$$//g;' ps__OUTPUT 2>/dev/null) |
| pdf_OUTPUT = $(shell sed 's/\#.*$$//g;' pdf_OUTPUT 2>/dev/null) |
pdf_OUTPUT = $(shell sed 's/\#.*$$//g;' pdf_OUTPUT 2>/dev/null) |
| htm_OUTPUT = $(shell sed 's/\#.*$$//g;' htm_OUTPUT 2>/dev/null) |
htm_OUTPUT = $(shell sed 's/\#.*$$//g;' htm_OUTPUT 2>/dev/null) |
| |
rtf_OUTPUT = $(shell sed 's/\#.*$$//g;' rtf_OUTPUT 2>/dev/null) |
| |
|
| # Other programs configured automaticaly: |
# Other programs configured automaticaly: |
| BUILD_STRUCT = $(TOP_DIR)/_scripts/build-struct |
BUILD_STRUCT = $(TOP_DIR)/_scripts/build-struct |
|
|
| ifeq ($(strip $(LATEX2HTML)),) |
ifeq ($(strip $(LATEX2HTML)),) |
| LATEX2HTML = latex2html |
LATEX2HTML = latex2html |
| endif |
endif |
| |
ifeq ($(strip $(LATEX2RTF)),) |
| |
LATEX2RTF = latex2rtf |
| |
endif |
| |
|
| ifeq ($(strip $(DVIPS)),) |
ifeq ($(strip $(DVIPS)),) |
| DVIPS = dvips |
DVIPS = dvips |
|
|
| ifeq ($(strip $(LATEX2HTML_ENV)),) |
ifeq ($(strip $(LATEX2HTML_ENV)),) |
| LATEX2HTML_ENV = -split 0 -info 0 -link 0 -no_auto_link |
LATEX2HTML_ENV = -split 0 -info 0 -link 0 -no_auto_link |
| endif |
endif |
| |
ifeq ($(strip $(LATEX2RTF_ENV)),) |
| |
LATEX2RTF_ENV = -C latin2 -F |
| |
endif |
| # }}} |
# }}} |
| |
|
| TEX_COMPILER = $(LATEX) |
TEX_COMPILER = $(LATEX) |
| Line 77 TEX_COMPILER_BATCH = $(LATEX) -int |
|
| Line 84 TEX_COMPILER_BATCH = $(LATEX) -int |
|
| PDFTEX_COMPILER = $(PDFLATEX) |
PDFTEX_COMPILER = $(PDFLATEX) |
| PDFTEX_COMPILER_BATCH = $(PDFLATEX) -interaction=batchmode |
PDFTEX_COMPILER_BATCH = $(PDFLATEX) -interaction=batchmode |
| HTML_COMPILER = $(LATEX2HTML) $(LATEX2HTML_ENV) |
HTML_COMPILER = $(LATEX2HTML) $(LATEX2HTML_ENV) |
| |
RTF_COMPILER = $(LATEX2RTF) $(LATEX2RTF_ENV) |
| |
|
| # TEX_COMPILER = $(TEX) |
# TEX_COMPILER = $(TEX) |
| # TEX_COMPILER_BATCH = $(TEX) -interaction=batchmode |
# TEX_COMPILER_BATCH = $(TEX) -interaction=batchmode |
| Line 91 DEPEND_all = Makefile \ |
|
| Line 99 DEPEND_all = Makefile \ |
|
| ps__OUTPUT \ |
ps__OUTPUT \ |
| pdf_OUTPUT \ |
pdf_OUTPUT \ |
| htm_OUTPUT \ |
htm_OUTPUT \ |
| |
rtf_OUTPUT \ |
| $(PLATON_STYLE) \ |
$(PLATON_STYLE) \ |
| $(TOP_DIR)/_templates/platon-logo.eps \ |
$(TOP_DIR)/_templates/platon-logo.eps \ |
| $(TOP_DIR)/_templates/platon-logo.png \ |
$(TOP_DIR)/_templates/platon-logo.png \ |
| Line 102 export DEPEND_all |
|
| Line 111 export DEPEND_all |
|
| ifneq ($(strip $(ps__OUTPUT)),) |
ifneq ($(strip $(ps__OUTPUT)),) |
| export ps__OUTPUT |
export ps__OUTPUT |
| OUTPUT := $(ps__OUTPUT) |
OUTPUT := $(ps__OUTPUT) |
| endif # ifdef ps__OUTPUT |
endif # ifneq ps__OUTPUT |
| |
|
| ifneq ($(strip $(pdf_OUTPUT)),) |
ifneq ($(strip $(pdf_OUTPUT)),) |
| export pdf_OUTPUT |
export pdf_OUTPUT |
| OUTPUT := $(OUTPUT) $(pdf_OUTPUT) |
OUTPUT := $(OUTPUT) $(pdf_OUTPUT) |
| endif # ifdef pdf_OUTPUT |
endif # ifneq pdf_OUTPUT |
| |
|
| ifneq ($(strip $(htm_OUTPUT)),) |
ifneq ($(strip $(htm_OUTPUT)),) |
| export htm_OUTPUT |
export htm_OUTPUT |
| OUTPUT := $(OUTPUT) $(htm_OUTPUT) |
OUTPUT := $(OUTPUT) $(htm_OUTPUT) |
| endif # ifdef htm_OUTPUT |
endif # ifneq htm_OUTPUT |
| |
|
| |
ifneq ($(strip $(rtf_OUTPUT)),) |
| |
export rtf_OUTPUT |
| |
OUTPUT := $(OUTPUT) $(rtf_OUTPUT) |
| |
endif # ifneq rtf_OUTPUT |
| |
|
| ifneq ($(strip $(OUTPUT)),) |
ifneq ($(strip $(OUTPUT)),) |
| export OUTPUT |
export OUTPUT |
| endif # ifdef OUTPUT |
endif # ifneq OUTPUT |
| |
|
| ps__INPUT = $(patsubst %.ps,%.tex,$(ps__OUTPUT)) |
ps__INPUT = $(patsubst %.ps,%.tex,$(ps__OUTPUT)) |
| pdf_INPUT = $(patsubst %.pdf,%.tex,$(pdf_OUTPUT)) |
pdf_INPUT = $(patsubst %.pdf,%.tex,$(pdf_OUTPUT)) |
| htm_INPUT = $(patsubst %.html,%.tex,$(htm_OUTPUT)) |
htm_INPUT = $(patsubst %.html,%.tex,$(htm_OUTPUT)) |
| |
rtf_INPUT = $(patsubst %.rtf,%.tex,$(rtf_OUTPUT)) |
| export ps__INPUT |
export ps__INPUT |
| export pdf_INPUT |
export pdf_INPUT |
| export htm_INPUT |
export htm_INPUT |
| |
export rtf_INPUT |
| |
|
| DVI_ps__OUTPUT = $(patsubst %.ps,%.dvi,$(ps__OUTPUT)) |
DVI_ps__OUTPUT = $(patsubst %.ps,%.dvi,$(ps__OUTPUT)) |
| DVI_pdf_OUTPUT = $(patsubst %.pdf,%.dvi,$(pdf_OUTPUT)) |
DVI_pdf_OUTPUT = $(patsubst %.pdf,%.dvi,$(pdf_OUTPUT)) |
| Line 132 DVI_OUTPUT = $(DVI_ps__OUTPUT) $( |
|
| Line 148 DVI_OUTPUT = $(DVI_ps__OUTPUT) $( |
|
| ps__OUTPUT_first = $(patsubst %,.first.%,$(ps__OUTPUT)) |
ps__OUTPUT_first = $(patsubst %,.first.%,$(ps__OUTPUT)) |
| pdf_OUTPUT_first = $(patsubst %,.first.%,$(pdf_OUTPUT)) |
pdf_OUTPUT_first = $(patsubst %,.first.%,$(pdf_OUTPUT)) |
| htm_OUTPUT_first = $(patsubst %,.first.%,$(htm_OUTPUT)) |
htm_OUTPUT_first = $(patsubst %,.first.%,$(htm_OUTPUT)) |
| |
rtf_OUTPUT_first = $(patsubst %,.first.%,$(rtf_OUTPUT)) |
| OUTPUT_first = $(ps__OUTPUT_first) |
OUTPUT_first = $(ps__OUTPUT_first) |
| |
|
| ps__OUTPUT_second = $(patsubst %,.second.%,$(ps__OUTPUT)) |
ps__OUTPUT_second = $(patsubst %,.second.%,$(ps__OUTPUT)) |
| pdf_OUTPUT_second = $(patsubst %,.second.%,$(pdf_OUTPUT)) |
pdf_OUTPUT_second = $(patsubst %,.second.%,$(pdf_OUTPUT)) |
| htm_OUTPUT_second = $(patsubst %,.second.%,$(htm_OUTPUT)) |
htm_OUTPUT_second = $(patsubst %,.second.%,$(htm_OUTPUT)) |
| |
rtf_OUTPUT_second = $(patsubst %,.second.%,$(rtf_OUTPUT)) |
| OUTPUT_second = $(ps__OUTPUT_second) |
OUTPUT_second = $(ps__OUTPUT_second) |
| |
|
| ps__OUTPUT_third = $(patsubst %,.third.%,$(ps__OUTPUT)) |
ps__OUTPUT_third = $(patsubst %,.third.%,$(ps__OUTPUT)) |
| pdf_OUTPUT_third = $(patsubst %,.third.%,$(pdf_OUTPUT)) |
pdf_OUTPUT_third = $(patsubst %,.third.%,$(pdf_OUTPUT)) |
| htm_OUTPUT_third = $(patsubst %,.third.%,$(htm_OUTPUT)) |
htm_OUTPUT_third = $(patsubst %,.third.%,$(htm_OUTPUT)) |
| |
rtf_OUTPUT_third = $(patsubst %,.third.%,$(rtf_OUTPUT)) |
| OUTPUT_third = $(ps__OUTPUT_third) |
OUTPUT_third = $(ps__OUTPUT_third) |
| |
|
| ifneq ($(strip $(APPEND_DIRNAME)),) |
ifneq ($(strip $(APPEND_DIRNAME)),) |
| Line 149 ifneq ($(strip $(PREFIX)),) |
|
| Line 168 ifneq ($(strip $(PREFIX)),) |
|
| PREFIX := $(PREFIX)-$(shell basename `pwd`) |
PREFIX := $(PREFIX)-$(shell basename `pwd`) |
| else |
else |
| PREFIX := $(shell basename `pwd`) |
PREFIX := $(shell basename `pwd`) |
| endif # ifdef PREFIX |
endif # ifneq PREFIX |
| endif # ifdef APPEND_DIRNAME |
endif # ifneq APPEND_DIRNAME |
| |
|
| |
|
| ifneq ($(strip $(PREFIX)),) |
ifneq ($(strip $(PREFIX)),) |
| prefix_ps__OUTPUT = $(patsubst %,$(PREFIX)-%,$(ps__OUTPUT)) |
prefix_ps__OUTPUT = $(patsubst %,$(PREFIX)-%,$(ps__OUTPUT)) |
| prefix_pdf_OUTPUT = $(patsubst %,$(PREFIX)-%,$(pdf_OUTPUT)) |
prefix_pdf_OUTPUT = $(patsubst %,$(PREFIX)-%,$(pdf_OUTPUT)) |
| prefix_htm_OUTPUT = $(patsubst %,$(PREFIX)-%,$(htm_OUTPUT)) |
prefix_htm_OUTPUT = $(patsubst %,$(PREFIX)-%,$(htm_OUTPUT)) |
| endif # ifdef PREFIX |
prefix_rtf_OUTPUT = $(patsubst %,$(PREFIX)-%,$(rtf_OUTPUT)) |
| |
endif # ifneq PREFIX |
| |
|
| .SUFFIXES: |
.SUFFIXES: |
| |
|
| Line 191 HTM_TARGETS := html-subdir |
|
| Line 211 HTM_TARGETS := html-subdir |
|
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| endif # }}} ifdef htm_OUTPUT |
endif # }}} ifdef htm_OUTPUT |
| |
|
| ifeq ($(strip $(ps__OUTPUT)$(pdf_OUTPUT)$(htm_OUTPUT)),) |
ifneq ($(strip $(rtf_OUTPUT)),) # {{{ |
| |
ifneq ($(strip $(PREFIX)),) |
| |
RTF_TARGETS := rtf-subdir rtf-prefixed-output |
| |
else |
| |
RTF_TARGETS := rtf-subdir |
| |
endif # ifdef PREFIX |
| |
endif # }}} ifdef rtf_OUTPUT |
| |
|
| |
ifeq ($(strip $(ps__OUTPUT)$(pdf_OUTPUT)$(htm_OUTPUT)$(rtf_OUTPUT)),) |
| # if *_OUTPUT is empty, build target 'all-top' (print help, etc) |
# if *_OUTPUT is empty, build target 'all-top' (print help, etc) |
| all-top:: |
all-top:: |
| # ... and don't do anything |
# ... and don't do anything |
| ALL_TARGETS = |
ALL_TARGETS = |
| else |
else |
| ALL_TARGETS = $(PS__TARGETS) $(PDF_TARGETS) $(HTM_TARGETS) |
ALL_TARGETS = $(PS__TARGETS) $(PDF_TARGETS) $(HTM_TARGETS) $(RTF_TARGETS) |
| endif |
endif |
| |
|
| ifneq ($(strip $(PREFIX)),) |
ifneq ($(strip $(PREFIX)),) |
|
|
| -@$(BUILD_STRUCT) "HTML" \ |
-@$(BUILD_STRUCT) "HTML" \ |
| && $(MAKE) TOP_DIR=$(TOP_DIR)/.. -C HTML HTML |
&& $(MAKE) TOP_DIR=$(TOP_DIR)/.. -C HTML HTML |
| |
|
| |
rtf-subdir: |
| |
-@$(BUILD_STRUCT) "RTF" \ |
| |
&& $(MAKE) TOP_DIR=$(TOP_DIR)/.. -C RTF RTF |
| |
|
| |
|
| PostScript: $(ps__OUTPUT_first) $(ps__OUTPUT_second) $(ps__OUTPUT_third) $(DVI_ps__OUTPUT) $(ps__OUTPUT) |
PostScript: $(ps__OUTPUT_first) $(ps__OUTPUT_second) $(ps__OUTPUT_third) $(DVI_ps__OUTPUT) $(ps__OUTPUT) |
| |
|
| Line 258 PDF: $(pdf_OUTPUT) |
|
| Line 290 PDF: $(pdf_OUTPUT) |
|
| |
|
| HTML: $(htm_OUTPUT) |
HTML: $(htm_OUTPUT) |
| |
|
| |
RTF: $(rtf_OUTPUT) |
| |
|
| ifneq ($(strip $(PREFIX)),) # prefixed directories {{{ |
ifneq ($(strip $(PREFIX)),) # prefixed directories {{{ |
| ps-prefixed-output: |
ps-prefixed-output: |
| @-for file in $(ps__OUTPUT); do \ |
@-for file in $(ps__OUTPUT); do \ |
| Line 279 html-prefixed-output: |
|
| Line 313 html-prefixed-output: |
|
| ln -f "HTML/$$file" "$(PREFIX)-$$file" \ |
ln -f "HTML/$$file" "$(PREFIX)-$$file" \ |
| || cp -f "HTML/$$file $(PREFIX)"; \ |
|| cp -f "HTML/$$file $(PREFIX)"; \ |
| done |
done |
| |
|
| |
rtf-prefixed-output: |
| |
@-for file in $(rtf_OUTPUT); do \ |
| |
echo "ln -f 'RTF/$$file' '$(PREFIX)-$$file'"; \ |
| |
ln -f "RTF/$$file" "$(PREFIX)-$$file" \ |
| |
|| cp -f "RTF/$$file $(PREFIX)"; \ |
| |
done |
| endif # }}} ifdef PREFIX |
endif # }}} ifdef PREFIX |
| |
|
| %.ps: %.dvi $(ps__OUTPUT_first) $(ps__OUTPUT_second) $(ps__OUTPUT_third) |
%.ps: %.dvi $(ps__OUTPUT_first) $(ps__OUTPUT_second) $(ps__OUTPUT_third) |
| Line 295 endif # }}} ifdef PREFIX |
|
| Line 336 endif # }}} ifdef PREFIX |
|
| $(HTML_COMPILER) $${file%.html}.tex; \ |
$(HTML_COMPILER) $${file%.html}.tex; \ |
| ln $${file%.html}/$${file%.html}.html |
ln $${file%.html}/$${file%.html}.html |
| |
|
| |
%.rtf: $(rtf_OUTPUT_first) $(DEPEND_all) |
| |
@file="`echo '$@'`"; \ |
| |
echo "$(RTF_COMPILER) $${file%.rtf}.tex"; \ |
| |
$(RTF_COMPILER) $${file%.rtf}.tex; |
| |
|
| |
|
| %.dvi: .third.%.ps |
%.dvi: .third.%.ps |
| |
|
| Line 312 endif # }}} ifdef PREFIX |
|
| Line 358 endif # }}} ifdef PREFIX |
|
| $(HTML_COMPILER) $< \ |
$(HTML_COMPILER) $< \ |
| && touch $@ |
&& touch $@ |
| |
|
| |
.first.%.rtf: %.tex |
| |
$(RTF_COMPILER) $< \ |
| |
&& touch $@ |
| |
|
| .first.%.pdf: %.tex |
.first.%.pdf: %.tex |
| $(PDFTEX_COMPILER_BATCH) $< \ |
$(PDFTEX_COMPILER_BATCH) $< \ |
| && touch $@ |
&& touch $@ |
| Line 369 endif # ifdef SUBDIRS |
|
| Line 419 endif # ifdef SUBDIRS |
|
| # |
# |
| ifneq ($(strip $(SUBDIRS)),) |
ifneq ($(strip $(SUBDIRS)),) |
| |
|
| clean: clean-subdirs clean-tex-logs clean-graphs clean-postscript clean-pdf clean-html |
clean: clean-subdirs clean-tex-logs clean-graphs clean-postscript clean-pdf clean-html clean-rtf |
| -rm -f .first.* .second.* .third.* core core.* missfont.log |
-rm -f .first.* .second.* .third.* core core.* missfont.log |
| |
|
| subdir-list-clean = $(sort $(patsubst %,_subdir_clean_%,$(SUBDIRS))) |
subdir-list-clean = $(sort $(patsubst %,_subdir_clean_%,$(SUBDIRS))) |
| Line 386 $(subdir-list-clean) : dummy |
|
| Line 436 $(subdir-list-clean) : dummy |
|
| |
|
| else |
else |
| |
|
| clean: clean-tex-logs clean-graphs clean-postscript clean-pdf clean-html |
clean: clean-tex-logs clean-graphs clean-postscript clean-pdf clean-html clean-rtf |
| -rm -f .first.* .second.* .third.* core core.* |
-rm -f .first.* .second.* .third.* core core.* |
| |
|
| endif # ifdef SUBDIRS |
endif # ifdef SUBDIRS |
|
|
| clean-html: |
clean-html: |
| -rm -rf HTML/ |
-rm -rf HTML/ |
| -rm -f $(prefix_htm_OUTPUT) |
-rm -f $(prefix_htm_OUTPUT) |
| |
|
| |
clean-rtf: |
| |
-rm -rf RTF/ |
| |
-rm -f $(prefix_rtf_OUTPUT) |
| else |
else |
| clean-postscript: |
clean-postscript: |
| -rm -rf PostScript/ |
-rm -rf PostScript/ |
|
|
| |
|
| clean-html: |
clean-html: |
| -rm -rf HTML/ |
-rm -rf HTML/ |
| |
|
| |
clean-rtf: |
| |
-rm -rf RTF/ |
| endif |
endif |
| |
|
| # zmazanie docasnych suborov vytvorenych LaTeXom |
# zmazanie docasnych suborov vytvorenych LaTeXom |