-DOCS := install manual
+RMR := $(RM) -r
+SED := sed
+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 clean-textmp
+TEXITARGETS := install.html manual.html
-.INTERMEDIATE: *.dvi
+INSTALL-INFO-TARGETS := yacasl2.info
+
+.PHONY: base all info html htmls pdf casl2_spec distclean clean
base: install.txt info html
-all: base htmls pdf
+all: base htmls pdf casl2_spec
info: yacasl2.info
pdf: $(addsuffix .pdf,$(DOCS))
+casl2_spec:
+ $(MAKE) -C casl2_spec
+
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)/$<
+# makeで作成されたドキュメントはすべて削除
+distclean: clean texinfo-distclean
+ $(RM) install.txt *.info *.html *_html *.pdf
+ $(MAKE) -C casl2_spec distclean
-uninstall-info:
- $(INSTALL-INFO) --delete $(infodir)/yacasl2.info $(infodir)/dir
- $(RM) $(infodir)/yacasl2.info
+# make baseで作成されたドキュメントは残す
+clean: texinfo-clean
+ $(RM) *.bak
+ $(MAKE) -C casl2_spec clean
-clean: clean-textmp
- @$(RMR) *_html *.info *.html *.pdf *.dvi *.txt
+include texinfo.mk
-clean-textmp:
- @$(RM) *.aux *.cp *.cps *.fn *.ky *.log *.pg *.pgs *.tmp *.toc *.tp *.vr
+include install-info.mk