-DOCNAME = yacasl2
-SRC = $(DOCNAME).texi
-CSS = style.css
-HTMLDIR = html
-
-MV ?= mv
-CP ?= cp
-MKDIR ?= mkdir
-RMRF ?= rm -rf
-PTEX ?= ptex
-TEXI2DVI ?= texi2dvi
-DVI2PDF ?= dvipdfmx
-MAKEINFO ?= gmakeinfo
-INSTALL ?= install
-INSTALL-INFO ?= ginstall-info
+RMR := $(RM) -r
+SED := sed
+
+DOCS := install manual
+CSS := style.css
prefix ?= ~
infodir ?= $(prefix)/share/info
-.PHONY: all info htmlnosplit html pdf install-info clean clean-docs clean-tex-tmp
+TEXITARGETS := install.html manual.html
-.INTERMEDIATE: $(DOCNAME).dvi
+INSTALL-INFO-TARGETS := yacasl2.info
-all: info html htmls pdf
+.PHONY: base all info html htmls pdf casl2_spec distclean clean
-info: $(DOCNAME).info
+base: install.txt info html
-html: $(DOCNAME).html
- $(MV) $< index.html
+all: base htmls pdf casl2_spec
-htmls: $(SRC) $(CSS)
- $(INSTALL) -d $(HTMLDIR)
- $(INSTALL) $(CSS) $(HTMLDIR)/
- $(MAKEINFO) -o $(HTMLDIR) --html --css-ref=$(CSS) $(SRC)
+info: yacasl2.info
-pdf: $(DOCNAME).pdf
+html: $(addsuffix .html,$(DOCS))
-$(DOCNAME).html: $(SRC) $(CSS)
- $(MAKEINFO) -o $@ --no-split --html --css-include=$(CSS) $(SRC)
+htmls: $(addsuffix _html,$(DOCS))
-$(DOCNAME).pdf: $(DOCNAME).dvi
- $(DVI2PDF) $^
+pdf: $(addsuffix .pdf,$(DOCS))
-$(DOCNAME).dvi: $(SRC)
- TEX=$(PTEX) $(TEXI2DVI) -q --texinfo=@afourpaper -o $@ $<
- @$(MAKE) clean-tex-tmp
+casl2_spec:
+ $(MAKE) -C casl2_spec
-install-info: $(DOCNAME).info
- $(INSTALL) -d $(infodir)
- $(INSTALL) $(DOCNAME).info $(infodir)/$(DOCNAME)
- $(INSTALL-INFO) $(infodir)/$(DOCNAME) $(infodir)/dir
+yacasl2.info: manual.texi
+ $(MAKEINFO) $(MAKEINFO_FLAGS) $<
-uninstall-info: $(DOCNAME).info
- $(INSTALL-INFO) --delete $(infodir)/$(DOCNAME) $(infodir)/dir
- $(RM) $(infodir)/$(DOCNAME)
+# makeで作成されたドキュメントはすべて削除
+distclean: clean texinfo-distclean
+ $(RM) install.txt *.info *.html *_html *.pdf
+ $(MAKE) -C casl2_spec distclean
-clean: clean-docs clean-tex-tmp
+# make baseで作成されたドキュメントは残す
+clean: texinfo-clean
+ $(RM) *.bak
+ $(MAKE) -C casl2_spec clean
-clean-docs:
- @$(RMRF) html $(DOCNAME).info $(DOCNAME).pdf index.html
+include texinfo.mk
-clean-tex-tmp:
- @$(RMRF) $(DOCNAME).aux $(DOCNAME).cp $(DOCNAME).cps $(DOCNAME).fn $(DOCNAME).ky $(DOCNAME).log $(DOCNAME).pg $(DOCNAME).pgs $(DOCNAME).tmp $(DOCNAME).toc $(DOCNAME).tp $(DOCNAME).vr
+include install-info.mk