about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-08-19 21:41:25 +0000
committerEric Wong <normalperson@yhbt.net>2011-08-19 21:41:25 +0000
commit9ca1afd1ff4fe759eeead7f044de712f13454ddc (patch)
tree0d9fc84fe8cc7475fa9b09754babb92cecd8229f
parent410404e1bbf1d16a887feba39512ba7867f6136e (diff)
downloadwrongdoc-9ca1afd1ff4fe759eeead7f044de712f13454ddc.tar.gz
pkg.mk: update to the latest version
-rw-r--r--pkg.mk21
1 files changed, 14 insertions, 7 deletions
diff --git a/pkg.mk b/pkg.mk
index fb71491..4cd5bef 100644
--- a/pkg.mk
+++ b/pkg.mk
@@ -7,7 +7,7 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
         @./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
 -include local.mk
-DLEXT := $(shell $(RUBY) -rrbconfig -e 'puts Config::CONFIG["DLEXT"]')
+DLEXT := $(shell $(RUBY) -rrbconfig -e 'puts RbConfig::CONFIG["DLEXT"]')
 RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
 RUBY_ENGINE := $(shell $(RUBY) -e 'puts((RUBY_ENGINE rescue "ruby"))')
 lib := lib
@@ -44,29 +44,32 @@ $(ext_dl): $(ext_src) $(ext_pfx_src) $(ext_pfx)/$(ext)/Makefile
         $(MAKE) -C $(@D)
 lib := $(lib):$(ext_pfx)/$(ext)
 build: $(ext_dl)
+else
+build:
 endif
 
-pkg_extra := GIT-VERSION-FILE NEWS ChangeLog LATEST
+pkg_extra += GIT-VERSION-FILE NEWS ChangeLog LATEST
 ChangeLog: GIT-VERSION-FILE .wrongdoc.yml
         $(WRONGDOC) prepare
+NEWS LATEST: ChangeLog
 
 manifest:
         $(RM) .manifest
         $(MAKE) .manifest
 
-.manifest: ChangeLog
+.manifest: $(pkg_extra)
         (git ls-files && for i in $@ $(pkg_extra); do echo $$i; done) | \
                 LC_ALL=C sort > $@+
         cmp $@+ $@ || mv $@+ $@
         $(RM) $@+
 
-doc:: .document .wrongdoc.yml
-        find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
+doc:: .document .wrongdoc.yml $(pkg_extra)
+        -find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
         -find ext -type f -name '*.rbc' -exec rm -f '{}' ';'
         $(RM) -r doc
         $(WRONGDOC) all
         install -m644 COPYING doc/COPYING
-        install -m644 $(shell grep '^[A-Z]' .document) doc/
+        install -m644 $(shell LC_ALL=C grep '^[A-Z]' .document) doc/
 
 ifneq ($(VERSION),)
 pkggem := pkg/$(rfpackage)-$(VERSION).gem
@@ -144,7 +147,7 @@ test_units := $(wildcard test/test_*.rb)
 test: test-unit
 test-unit: $(test_units)
 $(test_units): build
-        $(RUBY) -I $(lib) $@
+        $(RUBY) -I $(lib) $@ $(RUBY_TEST_OPTS)
 
 # this requires GNU coreutils variants
 ifneq ($(RSYNC_DEST),)
@@ -164,5 +167,9 @@ doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
 doc_gz:
         for i in $(docs); do \
           gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
+check-warnings:
+        @(for i in $$(git ls-files '*.rb'| grep -v '^setup\.rb$$'); \
+          do $(RUBY) -d -W2 -c $$i; done) | grep -v '^Syntax OK$$' || :
 
 .PHONY: all .FORCE-GIT-VERSION-FILE doc test $(test_units) manifest
+.PHONY: check-warnings