branch: scratch/editorconfig-cc
commit f8c0b1240d9e019ca8c43ad676c5302711abf3e3
Author: 10sr <8.slas...@gmail.com>
Commit: Stefan Monnier <monn...@iro.umontreal.ca>

    Update Makefile for info generation
---
 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 0808bd842d..30dd25f663 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,10 @@
 # -*- Makefile -*-
 
-TEXI_TOP := EditorConfig Emacs Plugin
+TEXI_CHAPTER := EditorConfig Emacs Plugin
 
 EMACS = emacs
 PANDOC = pandoc
+AWK = awk
 
 PROJECT_ROOT_DIR = $(PWD)
 ERT_TESTS = $(wildcard $(PROJECT_ROOT_DIR)/ert-tests/*.el)
@@ -26,9 +27,9 @@ doc: doc/editorconfig.texi
 doc/editorconfig.texi: README.md doc/header.txt
        mkdir -p doc
        tail -n +4 $< | $(PANDOC) -s -f markdown -t texinfo -o $@.body
-       cat doc/header.txt $@.body >$@
-       sed -i.bak -e 's/^@top .*/@top ${TEXI_TOP}/' $@
-       rm -f $@.body $@.bak
+       $(AWK) 'f{print} /^@chapter $(TEXI_CHAPTER)/{f=1;print}' $@.body 
>$@.body2
+       cat doc/header.txt $@.body2 >$@
+       rm -f $@.body $@.body2
 
 test: test-ert test-core test-metadata $(OBJS)
        $(EMACS) $(BATCHFLAGS) -l editorconfig.el

Reply via email to