| version 1.16, 2005/04/19 17:07:13 |
version 1.17, 2005/05/29 00:02:50 |
|
|
| # This file is included by 'make' from Makefile |
# This file is included by 'make' from Makefile |
| # |
# |
| # Developed by Lubomir Host 'rajo' <rajo AT platon.sk> |
# Developed by Lubomir Host 'rajo' <rajo AT platon.sk> |
| # Copyright (c) 2005 Platon SDG, http://platon.sk/ |
# Copyright (c) 2003-2005 Platon SDG, http://platon.sk/ |
| # 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.15 2005/04/18 22:10:57 nepto Exp $ |
# $Platon: Platon.SK/office/_templates/Rules.make,v 1.16 2005/04/19 17:07:13 rajo Exp $ |
| # |
# |
| |
|
| |
ps__OUTPUT = $(shell sed 's/\#.*$$//g;' ps__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) |
| |
|
| # Other programs configured automaticaly: |
# Other programs configured automaticaly: |
| BUILD_STRUCT = $(TOP_DIR)/_scripts/build-struct |
BUILD_STRUCT = $(TOP_DIR)/_scripts/build-struct |
| CREATE_DOC = $(TOP_DIR)/_scripts/create-document |
CREATE_DOC = $(TOP_DIR)/_scripts/create-document |
| |
|
| |
# |
| |
# Default programs (if not set in Makefiles) |
| |
# {{{ |
| |
ifndef TEX |
| |
TEX = csplain |
| |
endif |
| |
ifndef PDFTEX |
| |
PDFTEX = pdfcsplain |
| |
endif |
| |
ifndef LATEX |
| |
#LATEX = cslatex |
| |
LATEX = latex |
| |
endif |
| |
ifndef PDFLATEX |
| |
#PDFLATEX = pdfcslatex |
| |
PDFLATEX = pdflatex |
| |
endif |
| |
ifndef LATEX2HTML |
| |
LATEX2HTML = latex2html |
| |
endif |
| |
|
| |
ifndef DVIPS |
| |
DVIPS = dvips |
| |
endif |
| |
ifndef GV |
| |
GV = gv |
| |
endif |
| |
ifndef GNUPLOT |
| |
GNUPLOT = gnuplot |
| |
endif |
| |
ifndef CC |
| |
CC = gcc |
| |
endif |
| |
ifndef TAR |
| |
TAR = tar |
| |
endif |
| |
ifndef ZIP |
| |
ZIP = zip |
| |
endif |
| |
|
| |
ifndef ZIP_ENV |
| |
ZIP_ENV = -r9 |
| |
endif |
| |
ifndef GZIP_ENV |
| |
GZIP_ENV = --best |
| |
endif |
| |
ifndef LATEX2HTML_ENV |
| |
LATEX2HTML_ENV = -split 0 -info 0 -link 0 -no_auto_link |
| |
endif |
| |
# }}} |
| |
|
| TEX_COMPILER = $(LATEX) |
TEX_COMPILER = $(LATEX) |
| TEX_COMPILER_BATCH = $(LATEX) -interaction=batchmode |
TEX_COMPILER_BATCH = $(LATEX) -interaction=batchmode |
| PDFTEX_COMPILER = $(PDFLATEX) |
PDFTEX_COMPILER = $(PDFLATEX) |
| PDFTEX_COMPILER_BATCH = $(PDFLATEX) -interaction=batchmode |
PDFTEX_COMPILER_BATCH = $(PDFLATEX) -interaction=batchmode |
| |
HTML_COMPILER = $(LATEX2HTML) $(LATEX2HTML_ENV) |
| |
|
| # TEX_COMPILER = $(TEX) |
# TEX_COMPILER = $(TEX) |
| # TEX_COMPILER_BATCH = $(TEX) -interaction=batchmode |
# TEX_COMPILER_BATCH = $(TEX) -interaction=batchmode |
|
|
| DEPEND_all = Makefile \ |
DEPEND_all = Makefile \ |
| ps__OUTPUT \ |
ps__OUTPUT \ |
| pdf_OUTPUT \ |
pdf_OUTPUT \ |
| |
htm_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 49 export pdf_OUTPUT |
|
| Line 106 export pdf_OUTPUT |
|
| OUTPUT := $(OUTPUT) $(pdf_OUTPUT) |
OUTPUT := $(OUTPUT) $(pdf_OUTPUT) |
| endif # ifdef pdf_OUTPUT |
endif # ifdef pdf_OUTPUT |
| |
|
| |
ifdef htm_OUTPUT |
| |
export htm_OUTPUT |
| |
OUTPUT := $(OUTPUT) $(htm_OUTPUT) |
| |
endif # ifdef htm_OUTPUT |
| |
|
| ifdef OUTPUT |
ifdef OUTPUT |
| export OUTPUT |
export OUTPUT |
| endif # ifdef OUTPUT |
endif # ifdef 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)) |
| export ps__INPUT |
export ps__INPUT |
| export pdf_INPUT |
export pdf_INPUT |
| |
export htm_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 64 DVI_OUTPUT = $(DVI_ps__OUTPUT) $( |
|
| Line 128 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)) |
| 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)) |
| 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)) |
| OUTPUT_third = $(ps__OUTPUT_third) |
OUTPUT_third = $(ps__OUTPUT_third) |
| |
|
| ifdef APPEND_DIRNAME |
ifdef APPEND_DIRNAME |
| Line 86 endif # ifdef APPEND_DIRNAME |
|
| Line 153 endif # ifdef APPEND_DIRNAME |
|
| ifdef PREFIX |
ifdef 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)) |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| |
|
| .SUFFIXES: |
.SUFFIXES: |
| Line 95 endif # ifdef PREFIX |
|
| Line 163 endif # ifdef PREFIX |
|
| # |
# |
| # With variables $(ps__OUTPUT) and $(pdf_OUTPUT) you can customize, |
# With variables $(ps__OUTPUT) and $(pdf_OUTPUT) you can customize, |
| # which type of output you will create. |
# which type of output you will create. |
| # |
# target all {{{ |
| ifdef ps__OUTPUT # {{{ |
ifdef ps__OUTPUT # {{{ |
| ifdef PREFIX |
ifdef PREFIX |
| all: ps-subdir ps-prefixed-output |
PS__TARGETS := ps-subdir ps-prefixed-output |
| else |
else |
| all: ps-subdir |
PS__TARGETS := ps-subdir |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| endif # }}} ifdef ps__OUTPUT |
endif # }}} ifdef ps__OUTPUT |
| |
|
| ifdef pdf_OUTPUT # {{{ |
ifdef pdf_OUTPUT # {{{ |
| ifdef PREFIX |
ifdef PREFIX |
| all: pdf-subdir pdf-prefixed-output |
PDF_TARGETS := pdf-subdir pdf-prefixed-output |
| else |
else |
| all: pdf-subdir |
PDF_TARGETS := pdf-subdir |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| |
endif # }}} ifdef pdf_OUTPUT |
| |
|
| |
ifdef htm_OUTPUT # {{{ |
| |
ifdef PREFIX |
| |
HTM_TARGETS := html-subdir html-prefixed-output |
| |
else |
| |
HTM_TARGETS := html-subdir |
| |
endif # ifdef PREFIX |
| |
endif # }}} ifdef htm_OUTPUT |
| |
|
| ifdef ps__OUTPUT # {{{ |
|
| ifdef PREFIX |
ifdef PREFIX |
| all: ps-subdir pdf-subdir ps-prefixed-output pdf-prefixed-output |
all: $(PS__TARGETS) $(PDF_TARGETS) $(HTM_TARGETS) |
| @echo 'PREFIX = "$(PREFIX)"' |
@echo 'PREFIX = "$(PREFIX)"' |
| else |
else |
| all: ps-subdir pdf-subdir |
all: $(PS__TARGETS) $(PDF_TARGETS) $(HTM_TARGETS) |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| endif # }}} ifdef ps__OUTPUT |
|
| |
|
| endif # }}} ifdef pdf_OUTPUT |
# }}} end of taget `all' |
| # end of taget `all' |
|
| |
|
| |
# Create default files, if not exists: |
| |
# {{{ |
| |
ps__OUTPUT: |
| |
touch $@ |
| |
|
| |
pdf_OUTPUT: |
| |
touch $@ |
| |
|
| |
htm_OUTPUT: |
| |
touch $@ |
| |
# }}} |
| |
|
| ps-subdir: |
ps-subdir: |
| -@$(BUILD_STRUCT) "PostScript" \ |
-@$(BUILD_STRUCT) "PostScript" \ |
|
|
| -@$(BUILD_STRUCT) "PDF" \ |
-@$(BUILD_STRUCT) "PDF" \ |
| && $(MAKE) TOP_DIR=$(TOP_DIR)/.. -C PDF PDF |
&& $(MAKE) TOP_DIR=$(TOP_DIR)/.. -C PDF PDF |
| |
|
| |
html-subdir: |
| |
-@$(BUILD_STRUCT) "HTML" \ |
| |
&& $(MAKE) TOP_DIR=$(TOP_DIR)/.. -C HTML HTML |
| |
|
| |
|
| 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) |
| |
|
| PDF: $(pdf_OUTPUT) |
PDF: $(pdf_OUTPUT) |
| |
|
| ifdef PREFIX # {{{ |
HTML: $(htm_OUTPUT) |
| |
|
| |
ifdef PREFIX # prefixed directories {{{ |
| ps-prefixed-output: |
ps-prefixed-output: |
| @-for file in $(ps__OUTPUT); do \ |
@-for file in $(ps__OUTPUT); do \ |
| echo "ln -f 'PostScript/$$file' '$(PREFIX)-$$file'"; \ |
echo "ln -f 'PostScript/$$file' '$(PREFIX)-$$file'"; \ |
| Line 151 pdf-prefixed-output: |
|
| Line 242 pdf-prefixed-output: |
|
| ln -f "PDF/$$file" "$(PREFIX)-$$file" \ |
ln -f "PDF/$$file" "$(PREFIX)-$$file" \ |
| || cp -f "PDF/$$file $(PREFIX)"; \ |
|| cp -f "PDF/$$file $(PREFIX)"; \ |
| done |
done |
| |
|
| |
html-prefixed-output: |
| |
@-for file in $(htm_OUTPUT); do \ |
| |
echo "ln -f 'HTML/$$file' '$(PREFIX)-$$file'"; \ |
| |
ln -f "HTML/$$file" "$(PREFIX)-$$file" \ |
| |
|| cp -f "HTML/$$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 161 endif # }}} ifdef PREFIX |
|
| Line 259 endif # }}} ifdef PREFIX |
|
| echo "$(PDFTEX_COMPILER) $${file%.pdf}.tex"; \ |
echo "$(PDFTEX_COMPILER) $${file%.pdf}.tex"; \ |
| $(PDFTEX_COMPILER) $${file%.pdf}.tex |
$(PDFTEX_COMPILER) $${file%.pdf}.tex |
| |
|
| |
%.html: $(htm_OUTPUT_first) $(DEPEND_all) |
| |
@file="`echo '$@'`"; \ |
| |
echo "$(HTML_COMPILER) $${file%.html}.tex"; \ |
| |
$(HTML_COMPILER) $${file%.html}.tex; \ |
| |
ln $${file%.html}/$${file%.html}.html |
| |
|
| |
|
| %.dvi: .third.%.ps |
%.dvi: .third.%.ps |
| |
|
| .third.%.ps: %.tex $(DEPEND_all) .second.%.ps |
.third.%.ps: %.tex $(DEPEND_all) .second.%.ps |
| Line 173 endif # }}} ifdef PREFIX |
|
| Line 278 endif # }}} ifdef PREFIX |
|
| $(TEX_COMPILER_BATCH) $${file%.ps}.tex \ |
$(TEX_COMPILER_BATCH) $${file%.ps}.tex \ |
| && touch $@ |
&& touch $@ |
| |
|
| |
.first.%.html: %.tex |
| |
$(HTML_COMPILER) $< \ |
| |
&& touch $@ |
| |
|
| .first.%.pdf: %.tex |
.first.%.pdf: %.tex |
| $(PDFTEX_COMPILER_BATCH) $< \ |
$(PDFTEX_COMPILER_BATCH) $< \ |
| && touch $@ |
&& touch $@ |
| Line 226 endif # ifdef SUBDIRS |
|
| Line 335 endif # ifdef SUBDIRS |
|
| # |
# |
| ifdef SUBDIRS |
ifdef SUBDIRS |
| |
|
| clean: clean-subdirs clean-tex-logs clean-graphs clean-postscript clean-pdf |
clean: clean-subdirs clean-tex-logs clean-graphs clean-postscript clean-pdf clean-html |
| -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 243 $(subdir-list-clean) : dummy |
|
| Line 352 $(subdir-list-clean) : dummy |
|
| |
|
| else |
else |
| |
|
| clean: clean-tex-logs clean-graphs clean-postscript clean-pdf |
clean: clean-tex-logs clean-graphs clean-postscript clean-pdf clean-html |
| -rm -f .first.* .second.* .third.* core core.* |
-rm -f .first.* .second.* .third.* core core.* |
| |
|
| endif # ifdef SUBDIRS |
endif # ifdef SUBDIRS |
| Line 256 clean-postscript: |
|
| Line 365 clean-postscript: |
|
| clean-pdf: |
clean-pdf: |
| -rm -rf PDF/ |
-rm -rf PDF/ |
| -rm -f $(prefix_pdf_OUTPUT) |
-rm -f $(prefix_pdf_OUTPUT) |
| |
|
| |
clean-html: |
| |
-rm -rf HTML/ |
| |
-rm -f $(prefix_htm_OUTPUT) |
| else |
else |
| clean-postscript: |
clean-postscript: |
| -rm -rf PostScript/ |
-rm -rf PostScript/ |
| |
|
| clean-pdf: |
clean-pdf: |
| -rm -rf PDF/ |
-rm -rf PDF/ |
| |
|
| |
clean-html: |
| |
-rm -rf HTML/ |
| endif |
endif |
| |
|
| # zmazanie docasnych suborov vytvorenych LaTeXom |
# zmazanie docasnych suborov vytvorenych LaTeXom |