DOCS := install manual
-
CSS := style.css
-CP := cp
-DVIPDFMX := dvipdfmx
-GZIP := gzip
-INSTALL := install
-INSTALL-INFO := install-info
-MKDIR := mkdir
-RMR := rm -rf
-TEX := ptex
-TEXI2DVI := TEX=ptex texi2dvi
-TEX2DVI_FLAGS = -q --texinfo=@afourpaper
-
prefix ?= ~
infodir ?= $(prefix)/share/info
-.PHONY: base all info html htmls pdf install-info uninstall-info clean textmp-clean
-
-.INTERMEDIATE: *.dvi
+.PHONY: base all info html htmls pdf distclean clean
base: install.txt info html
yacasl2.info: manual.texi
$(MAKEINFO) $(MAKEINFO_FLAGS) $<
-$(addsuffix .html,$(DOCS)) $(addsuffix _html,$(DOCS)): $(CSS)
-
-%.html: %.texi
- $(MAKEINFO) -o $@ --no-split --html --css-include=$(CSS) $<
-
-%_html: %.texi
- if test ! -e $@; then $(MKDIR) $@; fi
- $(CP) $(CSS) $@/
- $(MAKEINFO) -o $@ --html --css-ref=$(CSS) $<
-
-%.pdf: %.dvi
- $(DVIPDFMX) $<
-
-%.txt: %.texi
- $(MAKEINFO) --no-headers --disable-encoding -o $@ $<
-
-install-info: yacasl2.info
- $(INSTALL) -d $(infodir)
- $(INSTALL) $< $(infodir)/
- $(INSTALL-INFO) $(infodir)/$< $(infodir)/dir
- $(GZIP) -f $(infodir)/$<
+distclean: texinfo-distclean
-uninstall-info:
- $(INSTALL-INFO) --delete $(infodir)/yacasl2.info $(infodir)/dir
- $(RM) $(infodir)/yacasl2.info
+clean: texinfo-clean
-clean: textmp-clean
- @$(RMR) *_html *.info *.html *.pdf *.dvi *.txt
+include texinfo.mk
-textmp-clean:
- @$(RM) *.aux *.cp *.cps *.fn *.ky *.log *.pg *.pgs *.tmp *.toc *.tp *.vr
+include install-info.mk
--- /dev/null
+prefix ?= ~
+infodir ?= $(prefix)/share/info
+
+GZIP := gzip
+INSTALL := install
+INSTALL-INFO := install-info
+
+.PHONY: install-info uninstall-info
+
+install-info: yacasl2.info
+ $(INSTALL) -d $(infodir)
+ $(INSTALL) $< $(infodir)/
+ $(INSTALL-INFO) $(infodir)/$< $(infodir)/dir
+ $(GZIP) -f $(infodir)/$<
+
+uninstall-info:
+ $(INSTALL-INFO) --delete $(addprefix $(infodir)/,$(TARGETS)) $(infodir)/dir
+ $(RM) $(addprefix $(infodir)/,$(TARGETS))
--- /dev/null
+.PHONY: texinfo-distclean textmp-clean
+
+CP ?= cp
+DVIPDFMX := dvipdfmx
+INSTALL-INFO := install-info
+MKDIR := mkdir
+RMR := rm -rf
+TEX := ptex
+TEXI2DVI := TEX=$(TEX) texi2dvi
+
+DVIPDFMX_FLAGS ?=
+MAKEINFO_FLAGS ?=
+TEXI2DVI_FLAGS ?= -q --texinfo=@afourpaper
+
+%.info: %.texi
+ $(MAKEINFO) $(MAKEINFO_FLAGS) -o $@ $<
+
+%.html: %.texi $(CSS)
+ $(MAKEINFO) -o $@ --no-split --html --css-include=$(CSS) $<
+
+%_html: %.texi $(CSS)
+ if test ! -e $@; then $(MKDIR) $@; fi
+ $(CP) $(CSS) $@/
+ $(MAKEINFO) -o $@ --html --css-ref=$(CSS) $<
+
+%.pdf: %.dvi
+ $(DVIPDFMX) $(DVIPDFMXFLAGS) $<
+
+%.txt: %.texi
+ $(MAKEINFO) --no-headers --disable-encoding -o $@ $<
+
+texinfo-distclean: textmp-clean
+ @$(RMR) *_html *.info *.html *.pdf *.dvi *.txt
+
+texinfo-clean: textmp-clean
+
+textmp-clean:
+ @$(RM) *.aux *.cp *.cps *.fn *.ky *.log *.pg *.pgs *.tmp *.toc *.tp *.vr