about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-04-26 16:17:26 -0700
committerEric Wong <normalperson@yhbt.net>2010-04-26 16:52:58 -0700
commit4bef5b2d0bf9cdad88a47a32b751f834877e4802 (patch)
treee584fe49966d45c45215f5501b2fd0157ce3b3bb
parentb8ca75667c5710ea43911d8eee994730a00d8eaa (diff)
downloadunicorn-4bef5b2d0bf9cdad88a47a32b751f834877e4802.tar.gz
-rw-r--r--.document4
-rw-r--r--GNUmakefile13
2 files changed, 10 insertions, 7 deletions
diff --git a/.document b/.document
index 2156af2..459f863 100644
--- a/.document
+++ b/.document
@@ -13,6 +13,6 @@ NEWS
 ChangeLog
 lib
 ext/unicorn_http/unicorn_http.c
-unicorn.1
-unicorn_rails.1
+unicorn_1
+unicorn_rails_1
 ISSUES
diff --git a/GNUmakefile b/GNUmakefile
index 735f5ee..67d9fb7 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -41,6 +41,7 @@ c_files := $(ext)/unicorn_http.c $(wildcard $(ext)/*.h)
 rl_files := $(wildcard $(ext)/*.rl)
 base_bins := unicorn unicorn_rails
 bins := $(addprefix bin/, $(base_bins))
+man1_rdoc := $(addsuffix _1, $(base_bins))
 man1_bins := $(addsuffix .1, $(base_bins))
 man1_paths := $(addprefix man/man1/, $(man1_bins))
 rb_files := $(bins) $(shell find lib ext -type f -name '*.rb')
@@ -176,18 +177,20 @@ cgit_atom := http://git.bogomips.org/cgit/unicorn.git/atom/?h=master
 atom = <link rel="alternate" title="Atom feed" href="$(1)" \
              type="application/atom+xml"/>
 
-# using rdoc 2.4.1+
+# using rdoc 2.5.x+
 doc: .document $(ext)/unicorn_http.c NEWS ChangeLog
-        for i in $(man1_bins); do > $$i; done
+        for i in $(man1_rdoc); do echo > $$i; done
         find bin lib -type f -name '*.rbc' -exec rm -f '{}' ';'
-        rdoc -Na -t "$(shell sed -ne '1s/^= //p' README)"
+        rdoc -a -t "$(shell sed -ne '1s/^= //p' README)"
         install -m644 COPYING doc/COPYING
         install -m644 $(shell grep '^[A-Z]' .document)  doc/
         $(MAKE) -C Documentation install-html install-man
         install -m644 $(man1_paths) doc/
         cd doc && for i in $(base_bins); do \
+          $(RM) $${i}.1.html; \
+          ln $${i}_1.html $${i}.1.html; \
           sed -e '/"documentation">/r man1/'$$i'.1.html' \
-                < $${i}_1.html > tmp.html && mv tmp.html $${i}_1.html; done
+                < $${i}.1.html > tmp && mv tmp $${i}_1.html; done
         $(RUBY) -i -p -e \
           '$$_.gsub!("</title>",%q{\&$(call atom,$(cgit_atom))})' \
           doc/ChangeLog.html
@@ -196,7 +199,7 @@ doc: .document $(ext)/unicorn_http.c NEWS ChangeLog
           doc/NEWS.html doc/README.html
         $(RAKE) -s news_atom > doc/NEWS.atom.xml
         cd doc && ln README.html tmp && mv tmp index.html
-        $(RM) $(man1_bins)
+        $(RM) $(man1_rdoc)
 
 rails_git_url = git://github.com/rails/rails.git
 rails_git := vendor/rails.git