about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--pkg.mk24
1 files changed, 14 insertions, 10 deletions
diff --git a/pkg.mk b/pkg.mk
index fd8dc0c..487733a 100644
--- a/pkg.mk
+++ b/pkg.mk
@@ -1,12 +1,13 @@
 RUBY = ruby
 RAKE = rake
 RSYNC = rsync
+WRONGDOC = wrongdoc
 
 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
@@ -43,27 +44,30 @@ $(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
+        $(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
+        $(WRONGDOC) all
         install -m644 COPYING doc/COPYING
         install -m644 $(shell grep '^[A-Z]' .document) doc/
 
@@ -76,10 +80,10 @@ release_changes := release_changes-$(VERSION)
 release-notes: $(release_notes)
 release-changes: $(release_changes)
 $(release_changes):
-        wrongdoc release_changes > $@+
+        $(WRONGDOC) release_changes > $@+
         $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
 $(release_notes):
-        wrongdoc release_notes > $@+
+        $(WRONGDOC) release_notes > $@+
         $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
 
 # ensures we're actually on the tagged $(VERSION), only used for release
@@ -143,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),)