about summary refs log tree commit homepage
path: root/local.mk.sample
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-09 15:46:11 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-09 15:46:11 -0800
commit27744eed51e3a21786a9e3dcd0b83937e1047f60 (patch)
treeb7c3325d2c9de7978dee8592729225d2919fdeca /local.mk.sample
parentc0813d5c3307082dcc73a930e2de218aab8be235 (diff)
downloadunicorn-27744eed51e3a21786a9e3dcd0b83937e1047f60.tar.gz
Rack 1.0.1 is the current version, also make it easier to add
more gems library paths in the future for testing even though
Rack is the only thing we depend on right now.  While we're at
it, simplify and make it easier to modify for use with alternate
prefixes.
Diffstat (limited to 'local.mk.sample')
-rw-r--r--local.mk.sample29
1 files changed, 19 insertions, 10 deletions
diff --git a/local.mk.sample b/local.mk.sample
index 9139ab0..f351be2 100644
--- a/local.mk.sample
+++ b/local.mk.sample
@@ -5,27 +5,36 @@
 # This is depends on a bunch of GNU-isms from bash, sed, touch.
 
 DLEXT := so
-rack_ver := 1.0.0
+gems := rack-1.0.1
 
 # Avoid loading rubygems to speed up tests because gmake is
 # fork+exec heavy with Ruby.
+prefix = $(HOME)
 ifeq ($(r19),)
-  ruby := $(HOME)/bin/ruby
-  RUBYLIB := $(HOME)/lib/ruby/gems/1.8/gems/rack-$(rack_ver)/lib
+  ruby := $(prefix)/bin/ruby
+  gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.8/gems/,$(gems))
 else
-  export PATH := $(HOME)/ruby-1.9/bin:$(PATH)
-  ruby := $(HOME)/ruby-1.9/bin/ruby --disable-gems
-  RUBYLIB := $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/rack-$(rack_ver)/lib
+  prefix := $(prefix)/ruby-1.9
+  export PATH := $(prefix)/bin:$(PATH)
+  ruby := $(prefix)/bin/ruby --disable-gems
+  gem_paths := $(addprefix $(prefix)/lib/ruby/gems/1.9.1/gems/,$(gems))
 endif
 
-# pipefail is THE reason to use bash (v3+)
-SHELL := /bin/bash -e -o pipefail
+ifdef gem_paths
+  sp :=
+  sp +=
+  export RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
+endif
+
+# pipefail is THE reason to use bash (v3+) or never revisions of ksh93
+# SHELL := /bin/bash -e -o pipefail
+SHELL := /bin/ksh93 -e -o pipefail
 
 full-test: test-18 test-19
 test-18:
-        $(MAKE) test test-rails 2>&1 | sed -u -e 's!^!1.8 !'
+        $(MAKE) test test-rails 2>&1 | sed -e 's!^!1.8 !'
 test-19:
-        $(MAKE) test test-rails r19=1 2>&1 | sed -u -e 's!^!1.9 !'
+        $(MAKE) test test-rails r19=1 2>&1 | sed -e 's!^!1.9 !'
 
 latest: NEWS
         @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<