1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
## This is part of the GNU Octave Interval Package.
## Copyright 2015 Oliver Heimlich.
## See the file COPYING for copying conditions.
SHELL = /bin/sh
M_IMAGE = $(wildcard image/*.m) $(patsubst %.m.texinfo,%.m,$(wildcard image/*.m.texinfo))
IMAGE_OBJ = $(patsubst %,%.png,$(M_IMAGE))
OBJ = manual.html manual.pdf $(IMAGE_OBJ)
MAKEINFO ?= makeinfo
VERSION ?= $(shell grep "^Version: " ../packinfo/DESCRIPTION ../DESCRIPTION | head -1 | cut -f2 -d" ")
OCTAVE ?= octave
.PHONY: all clean images
all: $(OBJ)
images: $(IMAGE_OBJ)
manual.html: manual.texinfo $(wildcard chapter/*) license/gpl-3.0.texi $(wildcard image/*.texinfo) $(IMAGE_OBJ)
@echo " [MAKEINFO --html] $<"
@$(MAKEINFO) -D 'version $(VERSION)' --html --no-split --css-include manual.css "$<"
manual.pdf: manual.texinfo $(wildcard chapter/*) license/gpl-3.0.texi $(wildcard image/*.texinfo) $(wildcard image/*.pdf) $(IMAGE_OBJ)
@echo " [MAKEINFO --pdf] $<"
@$(MAKEINFO) --Xopt=--texinfo='@set version $(VERSION)' --pdf "$<"
image/%.m.png: image/%.m
@echo " [OCTAVE] $<"
@$(OCTAVE) --no-history \
--eval "addpath ('../inst');" \
--eval "addpath ('../src');" \
--eval "set (0, 'defaultfigurevisible', 'off');" \
--eval "source ('$<');" \
--eval "print (gcf, '$@');"
@# The image size is too large for inclusion in the pdf,
@# thus we increase the resolution from 150 to 250 dpi.
@echo " [IMAGEMAGICK] $@"
@convert -density 98.425 -units PixelsPerCentimeter "$@" "$@"
image/%.m: image/%.m.texinfo
@echo " [MAKEINFO --plaintext] $<"
@$(MAKEINFO) -D m-file --plaintext "$<" > "$@"
clean:
$(RM) $(OBJ)
$(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr
|