X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=blobdiff_plain;f=doc%2FMakefile;h=ac78fc305437d648becf75e1fd9fc1f37644d27a;hp=c4dc520effe08083d007cfbb95a9a0dedce59135;hb=875d79044758b75907f82f340d1cce9998dd3be7;hpb=9a03447739ef5e8dd12d745805516dd5bcc00bea diff --git a/doc/Makefile b/doc/Makefile index c4dc520..ac78fc3 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,47 +1,82 @@ -DOCNAME = yacasl2 -SRC = $(DOCNAME).texi +MANUAL = manual +INSTALLDOC = install +CASL2SPEC = casl2_spec +MANUAL_SYSINFO = yacasl2.info CSS = style.css -MV = mv -CP = cp -MKDIR = mkdir -RMRF = rm -rf -PTEX = ptex -TEXI2DVI = texi2dvi -DVI2PDF = dvipdfmx -MAKEINFO = makeinfo +MV ?= mv +CP ?= cp +MKDIR ?= mkdir +RMF = rm -f +RMRF ?= rm -rf +PTEX ?= ptex +TEXI2DVI ?= texi2dvi +DVI2PDF ?= dvipdfmx +MAKEINFO ?= gmakeinfo +INSTALL ?= install +INSTALL-INFO ?= ginstall-info +GZIP = gzip +SED = sed -.PHONY: doc info htmlnosplit html pdf clean clean_docs clean_tex_tmp +prefix ?= ~ +infodir ?= $(prefix)/share/info -.INTERMEDIATE: $(DOCNAME).dvi +.PHONY: all info html htmls pdf install-info uninstall-info clean clean-textmp -doc: info htmlnosplit html pdf +.INTERMEDIATE: *.dvi -info: $(DOCNAME).info +base: ../INSTALL $(MANUAL_SYSINFO) $(MANUAL).html -htmlnosplit: index.html +all: info html htmls pdf ../INSTALL $(MANUAL_SYSINFO) -index.html: $(SRC) $(CSS) - $(MAKEINFO) -o $@ --no-split --html --css-include=$(CSS) $(SRC) +info: $(MANUAL_SYSINFO) $(INSTALLDOC).info -html: $(SRC) $(CSS) - if test ! -e $@; then $(MKDIR) $@; fi; - $(CP) $(CSS) $@/$(CSS) - $(MAKEINFO) -o $@ --html --css-ref=$(CSS) $(SRC) +html: $(MANUAL).html $(INSTALLDOC).html -pdf: $(DOCNAME).pdf +htmls: $(MANUAL)_html -$(DOCNAME).pdf: $(DOCNAME).dvi - $(DVI2PDF) $^ +pdf: $(INSTALLDOC).pdf $(MANUAL).pdf -$(DOCNAME).dvi: $(SRC) +$(MANUAL_SYSINFO): $(MANUAL).info + $(CP) $< $@ + $(SED) -i -e "s/@setfilename manual/@setfilename $(MANUAL_SYSINFO)/" $@ + +%.html: %.texi $(CSS) + $(MAKEINFO) -o $@ --no-split --html --css-include=$(CSS) $< + +%_html: %.texi $(CSS) + $(INSTALL) -d $@ + $(INSTALL) $(CSS) $@/ + $(MAKEINFO) -o $@ --html --css-ref=$(CSS) $< + +%.pdf: %.dvi + $(DVI2PDF) $< + +%.dvi: %.texi TEX=$(PTEX) $(TEXI2DVI) -q --texinfo=@afourpaper -o $@ $< - @$(MAKE) clean_tex_tmp + @$(MAKE) clean-textmp + +%.txt: %.texi + $(MAKEINFO) --no-headers --disable-encoding -o $@ $< + +install-info: $(MANUAL_SYSINFO) + $(INSTALL) -d $(infodir) + $(INSTALL) $(MANUAL_SYSINFO) $(infodir)/ + $(INSTALL-INFO) $(infodir)/$(MANUAL_SYSINFO) $(infodir)/dir + $(GZIP) -f $(infodir)/$(MANUAL_SYSINFO) + +uninstall-info: $(MANUAL).info + $(INSTALL-INFO) --delete $(infodir)/$(MANUAL_SYSINFO) $(infodir)/dir + $(RMF) $(infodir)/$(MANUAL_SYSINFO)* + +$(INSTALLDOC).html: $(INSTALLDOC).texi $(CSS) + $(MAKEINFO) -o $@ --no-split --html --css-include=$(CSS) $< -clean: clean_docs clean_tex_tmp +../INSTALL: $(INSTALLDOC).txt + $(CP) $< $@ -clean_docs: - @$(RMRF) html $(DOCNAME).info $(DOCNAME).pdf $(DOCNAME).html +clean: clean-textmp + @$(RMRF) *_html *.info *.html *.pdf *.dvi *.txt -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 +clean-textmp: + @$(RMF) *.aux *.cp *.cps *.fn *.ky *.log *.pg *.pgs *.tmp *.toc *.tp *.vr