doc/Makefileで、sedの記述を変更。いったん.html.bakファイルを作成してから削除
[YACASL2.git] / doc / Makefile
index 7e7a0b1..2861845 100644 (file)
@@ -1,3 +1,6 @@
+RMR := $(RM) -r
+SED := sed
+
 DOCS := install manual
 CSS := style.css
 
@@ -13,17 +16,23 @@ all: base htmls pdf
 info: yacasl2.info
 
 html: $(addsuffix .html,$(DOCS))
+       for f in $^; do $(SED) -i .bak -e 's!dir\.html#Top!\.\./!g' $$f && $(RM) $$f.bak; done
 
 htmls: $(addsuffix _html,$(DOCS))
+       for d in $^; do $(SED) -i .bak -e 's!\.\./dir/index\.html!\.\./\.\./!g' $$d/index.html && $(RM) $$d/index.html.bak; done
 
 pdf: $(addsuffix .pdf,$(DOCS))
 
 yacasl2.info: manual.texi
        $(MAKEINFO) $(MAKEINFO_FLAGS) $<
 
-distclean: texinfo-distclean
+# makeで作成されたドキュメントはすべて削除
+distclean: clean texinfo-distclean
+       $(RM) install.txt *.info *.html *_html *.pdf
 
+# make baseで作成されたドキュメントは残す
 clean: texinfo-clean
+       $(RM) *.bak
 
 include texinfo.mk