| version 1.19, 2005/05/29 00:51:59 |
version 1.20, 2005/05/29 01:59:18 |
|
|
| # 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.18 2005/05/29 00:39:15 rajo Exp $ |
# $Platon: Platon.SK/office/_templates/Rules.make,v 1.19 2005/05/29 00:51:59 rajo Exp $ |
| # |
# |
| |
|
| ps__OUTPUT = $(shell sed 's/\#.*$$//g;' ps__OUTPUT 2>/dev/null) |
ps__OUTPUT = $(shell sed 's/\#.*$$//g;' ps__OUTPUT 2>/dev/null) |
| Line 21 CREATE_DOC = $(TOP_DIR)/_scripts/creat |
|
| Line 21 CREATE_DOC = $(TOP_DIR)/_scripts/creat |
|
| # |
# |
| # Default programs (if not set in Makefiles) |
# Default programs (if not set in Makefiles) |
| # {{{ |
# {{{ |
| ifndef TEX |
ifeq ($(strip $(TEX)),) |
| TEX = csplain |
TEX = csplain |
| endif |
endif |
| ifndef PDFTEX |
ifeq ($(strip $(PDFTEX)),) |
| PDFTEX = pdfcsplain |
PDFTEX = pdfcsplain |
| endif |
endif |
| ifndef LATEX |
ifeq ($(strip $(LATEX)),) |
| #LATEX = cslatex |
#LATEX = cslatex |
| LATEX = latex |
LATEX = latex |
| endif |
endif |
| ifndef PDFLATEX |
ifeq ($(strip $(PDFLATEX)),) |
| #PDFLATEX = pdfcslatex |
#PDFLATEX = pdfcslatex |
| PDFLATEX = pdflatex |
PDFLATEX = pdflatex |
| endif |
endif |
| ifndef LATEX2HTML |
ifeq ($(strip $(LATEX2HTML)),) |
| LATEX2HTML = latex2html |
LATEX2HTML = latex2html |
| endif |
endif |
| |
|
| ifndef DVIPS |
ifeq ($(strip $(DVIPS)),) |
| DVIPS = dvips |
DVIPS = dvips |
| endif |
endif |
| ifndef PS2PDF |
ifeq ($(strip $(PS2PDF)),) |
| PS2PDF = dvips |
PS2PDF = dvips |
| endif |
endif |
| ifndef GV |
ifeq ($(strip $(GV)),) |
| GV = gv |
GV = gv |
| endif |
endif |
| ifndef GNUPLOT |
ifeq ($(strip $(GNUPLOT)),) |
| GNUPLOT = gnuplot |
GNUPLOT = gnuplot |
| endif |
endif |
| ifndef CC |
ifeq ($(strip $(CC)),) |
| CC = gcc |
CC = gcc |
| endif |
endif |
| ifndef TAR |
ifeq ($(strip $(TAR)),) |
| TAR = tar |
TAR = tar |
| endif |
endif |
| ifndef ZIP |
ifeq ($(strip $(ZIP)),) |
| ZIP = zip |
ZIP = zip |
| endif |
endif |
| |
|
| ifndef ZIP_ENV |
ifeq ($(strip $(ZIP_ENV)),) |
| ZIP_ENV = -r9 |
ZIP_ENV = -r9 |
| endif |
endif |
| ifndef GZIP_ENV |
ifeq ($(strip $(GZIP_ENV)),) |
| GZIP_ENV = --best |
GZIP_ENV = --best |
| endif |
endif |
| ifndef 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 |
| # }}} |
# }}} |
| Line 83 HTML_COMPILER = $(LATEX2HTML) |
|
| Line 83 HTML_COMPILER = $(LATEX2HTML) |
|
| # PDFTEX_COMPILER = $(PDFTEX) |
# PDFTEX_COMPILER = $(PDFTEX) |
| # PDFTEX_COMPILER_BATCH = $(PDFTEX) -interaction=batchmode |
# PDFTEX_COMPILER_BATCH = $(PDFTEX) -interaction=batchmode |
| |
|
| ifndef PLATON_STYLE |
ifeq ($(strip $(PLATON_STYLE)),) |
| PLATON_STYLE = $(TOP_DIR)/_templates/platon-core.sty $(TOP_DIR)/_templates/platon.sty |
PLATON_STYLE = $(TOP_DIR)/_templates/platon-core.sty $(TOP_DIR)/_templates/platon.sty |
| endif |
endif |
| |
|
| Line 99 DEPEND_all = Makefile \ |
|
| Line 99 DEPEND_all = Makefile \ |
|
| export TOP_DIR |
export TOP_DIR |
| export DEPEND_all |
export DEPEND_all |
| |
|
| ifdef ps__OUTPUT |
ifneq ($(strip $(ps__OUTPUT)),) |
| export ps__OUTPUT |
export ps__OUTPUT |
| OUTPUT := $(ps__OUTPUT) |
OUTPUT := $(ps__OUTPUT) |
| endif # ifdef ps__OUTPUT |
endif # ifdef ps__OUTPUT |
| |
|
| ifdef 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 # ifdef pdf_OUTPUT |
| |
|
| ifdef 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 # ifdef htm_OUTPUT |
| |
|
| ifdef OUTPUT |
ifneq ($(strip $(OUTPUT)),) |
| export OUTPUT |
export OUTPUT |
| endif # ifdef OUTPUT |
endif # ifdef OUTPUT |
| |
|
| Line 144 pdf_OUTPUT_third = $(patsubst %,.third. |
|
| Line 144 pdf_OUTPUT_third = $(patsubst %,.third. |
|
| htm_OUTPUT_third = $(patsubst %,.third.%,$(htm_OUTPUT)) |
htm_OUTPUT_third = $(patsubst %,.third.%,$(htm_OUTPUT)) |
| OUTPUT_third = $(ps__OUTPUT_third) |
OUTPUT_third = $(ps__OUTPUT_third) |
| |
|
| ifdef APPEND_DIRNAME |
ifneq ($(strip $(APPEND_DIRNAME)),) |
| ifdef PREFIX |
ifneq ($(strip $(PREFIX)),) |
| PREFIX := $(PREFIX)-$(shell basename `pwd`) |
PREFIX := $(PREFIX)-$(shell basename `pwd`) |
| else |
else |
| PREFIX := $(shell basename `pwd`) |
PREFIX := $(shell basename `pwd`) |
| Line 153 endif # ifdef PREFIX |
|
| Line 153 endif # ifdef PREFIX |
|
| endif # ifdef APPEND_DIRNAME |
endif # ifdef APPEND_DIRNAME |
| |
|
| |
|
| ifdef 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)) |
| Line 167 endif # ifdef PREFIX |
|
| Line 167 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 {{{ |
# target all {{{ |
| ifdef ps__OUTPUT # {{{ |
ifneq ($(strip $(ps__OUTPUT)),) # {{{ |
| ifdef PREFIX |
ifneq ($(strip $(PREFIX)),) |
| PS__TARGETS := ps-subdir ps-prefixed-output |
PS__TARGETS := ps-subdir ps-prefixed-output |
| else |
else |
| PS__TARGETS := ps-subdir |
PS__TARGETS := ps-subdir |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| endif # }}} ifdef ps__OUTPUT |
endif # }}} ifdef ps__OUTPUT |
| |
|
| ifdef pdf_OUTPUT # {{{ |
ifneq ($(strip $(pdf_OUTPUT)),) # {{{ |
| ifdef PREFIX |
ifneq ($(strip $(PREFIX)),) |
| PDF_TARGETS := pdf-subdir pdf-prefixed-output |
PDF_TARGETS := pdf-subdir pdf-prefixed-output |
| else |
else |
| PDF_TARGETS := pdf-subdir |
PDF_TARGETS := pdf-subdir |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| endif # }}} ifdef pdf_OUTPUT |
endif # }}} ifdef pdf_OUTPUT |
| |
|
| ifdef htm_OUTPUT # {{{ |
ifneq ($(strip $(htm_OUTPUT)),) # {{{ |
| ifdef PREFIX |
ifneq ($(strip $(PREFIX)),) |
| HTM_TARGETS := html-subdir html-prefixed-output |
HTM_TARGETS := html-subdir html-prefixed-output |
| else |
else |
| HTM_TARGETS := html-subdir |
HTM_TARGETS := html-subdir |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| endif # }}} ifdef htm_OUTPUT |
endif # }}} ifdef htm_OUTPUT |
| |
|
| ifdef PREFIX |
ifeq ($(strip $(ps__OUTPUT)$(pdf_OUTPUT)$(htm_OUTPUT)),) |
| all: $(PS__TARGETS) $(PDF_TARGETS) $(HTM_TARGETS) |
# if *_OUTPUT is empty, build target 'all-top' (print help, etc) |
| |
all-top:: |
| |
# ... and don't do anything |
| |
ALL_TARGETS = |
| |
else |
| |
ALL_TARGETS = $(PS__TARGETS) $(PDF_TARGETS) $(HTM_TARGETS) |
| |
endif |
| |
|
| |
ifneq ($(strip $(PREFIX)),) |
| |
all: $(ALL_TARGETS) |
| @echo 'PREFIX = "$(PREFIX)"' |
@echo 'PREFIX = "$(PREFIX)"' |
| else |
else |
| all: $(PS__TARGETS) $(PDF_TARGETS) $(HTM_TARGETS) |
all: $(ALL_TARGETS) |
| endif # ifdef PREFIX |
endif # ifdef PREFIX |
| |
|
| # }}} end of taget `all' |
# }}} end of taget `all' |
| |
|
| |
|
| |
# |
| |
# Print usage message |
| |
# {{{ |
| |
all-top:: |
| |
@echo "Usage:" |
| |
@echo "" |
| |
@echo " make clean - recursive clean, removes all unnecessary files" |
| |
@echo " make new - creates new document" |
| |
@echo " make doc[uments] - build all documents" |
| |
@echo " make dist - create tarball for distribution" |
| |
@echo "" |
| |
# }}} |
| |
|
| |
# Create new document with command 'make new' |
| |
new: |
| |
$(CREATE_DOC) |
| |
|
| # Create default files, if not exists: |
# Create default files, if not exists: |
| # {{{ |
# {{{ |
| ps__OUTPUT: |
ps__OUTPUT: |
| Line 231 PDF: $(pdf_OUTPUT) |
|
| Line 258 PDF: $(pdf_OUTPUT) |
|
| |
|
| HTML: $(htm_OUTPUT) |
HTML: $(htm_OUTPUT) |
| |
|
| ifdef 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 \ |
| echo "ln -f 'PostScript/$$file' '$(PREFIX)-$$file'"; \ |
echo "ln -f 'PostScript/$$file' '$(PREFIX)-$$file'"; \ |
|
|
| |
|
| documents: doc |
documents: doc |
| |
|
| ifndef SUBDIRS |
ifeq ($(strip $(SUBDIRS)),) |
| SUBDIRS = $(shell sed 's/\#.*$$//g;' SUBDIRS 2>/dev/null) |
SUBDIRS = $(shell sed 's/\#.*$$//g;' SUBDIRS 2>/dev/null) |
| endif |
endif |
| |
|
| ifdef SUBDIRS |
ifneq ($(strip $(SUBDIRS)),) |
| |
|
| doc: doc-subdirs all |
doc: doc-subdirs all |
| |
|
| Line 340 endif # ifdef SUBDIRS |
|
| Line 367 endif # ifdef SUBDIRS |
|
| # |
# |
| # A rule to make clean in subdirectories |
# A rule to make clean in subdirectories |
| # |
# |
| ifdef 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 |
| -rm -f .first.* .second.* .third.* core core.* missfont.log |
-rm -f .first.* .second.* .third.* core core.* missfont.log |
| Line 364 clean: clean-tex-logs clea |
|
| Line 391 clean: clean-tex-logs clea |
|
| |
|
| endif # ifdef SUBDIRS |
endif # ifdef SUBDIRS |
| |
|
| ifdef PREFIX |
ifneq ($(strip $(PREFIX)),) |
| clean-postscript: |
clean-postscript: |
| -rm -rf PostScript/ |
-rm -rf PostScript/ |
| -rm -f $(prefix_ps__OUTPUT) |
-rm -f $(prefix_ps__OUTPUT) |
|
|
| endif |
endif |
| |
|
| # zmazanie docasnych suborov vytvorenych LaTeXom |
# zmazanie docasnych suborov vytvorenych LaTeXom |
| ifdef OUTPUT |
ifneq ($(strip $(OUTPUT)),) |
| clean-tex-logs: |
clean-tex-logs: |
| @for OUT in $(OUTPUT); \ |
@for OUT in $(OUTPUT); \ |
| do \ |
do \ |
|
|
| # }}} |
# }}} |
| |
|
| # Distribution {{{ |
# Distribution {{{ |
| ifdef DISTFILES |
ifneq ($(strip $(DISTFILES)),) |
| dist: distdir |
dist: distdir |
| GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) |
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) |
| @#BZIP=$(GZIP_ENV) $(TAR) chojf $(distdir).tar.bz2 $(distdir) |
@#BZIP=$(GZIP_ENV) $(TAR) chojf $(distdir).tar.bz2 $(distdir) |