about summary refs log tree commit homepage
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile63
1 files changed, 63 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..9fb82f5
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,63 @@
+# maintainer jobs here, not needed for normal users
+all::
+
+.ri/created.rid: ext/mahoro/mahoro.c lib/mahoro/thread_safe.rb
+        rdoc --ri -o $(@D) $^
+
+order =
+order += Mahoro
+order += Mahoro.new
+order += Mahoro\#file
+order += Mahoro\#buffer
+order += Mahoro\#flags=
+order += Mahoro\#valid?
+order += Mahoro\#compile
+order += Mahoro.compile
+order += Mahoro::ThreadSafe
+
+www/API: .ri/created.rid
+        ( \
+                for i in $(order); \
+                do \
+                        ri --no-standard-docs -T -d .ri -w 80 "$$i" \
+                                | col -b \
+                                | grep -vF $(CURDIR)/.ri; \
+                done \
+        ) > $@
+
+www/API.gz: www/API
+        gzip < $< > $@
+        touch -r $< $@
+
+www/README.gz: README
+        install -p -m 644 README www/
+        gzip < $< > $@
+        touch -r $< $@
+
+all:: www/API.gz www/README.gz
+clean:
+        $(RM) www/*
+
+ifneq ($(VERSION),)
+gem := mahoro-$(VERSION).gem
+$(gem): $(shell git ls-files)
+        VERSION=$(VERSION) gem build mahoro.gemspec
+
+tgz := mahoro-$(VERSION).tar.gz
+$(tgz): $(shell git ls-files)
+        git archive --format=tar --prefix=mahoro-$(VERSION)/ HEAD | \
+          gzip -9 > $@
+else
+gem tgz:
+        @echo >&2 error VERSION not defined
+        @false
+endif
+
+package: $(gem) $(tgz)
+
+RSYNC = rsync
+publish_doc: all
+        $(RSYNC) --delete --exclude .gitignore -av \
+                www/ dcvr:/srv/bogomips/mahoro/
+
+.PHONY: publish_doc package