about summary refs log tree commit homepage
path: root/GNUmakefile
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-06 17:36:06 -0800
committerEric Wong <normalperson@yhbt.net>2009-02-09 19:51:45 -0800
commit23c0c3babf738dd2fb08fc7b7333da899426d992 (patch)
tree2234114b34acb4fc855fec8ec49b987b88fb19aa /GNUmakefile
parentb1346861133517b939684d2e6eb62ef694b1062f (diff)
downloadunicorn-23c0c3babf738dd2fb08fc7b7333da899426d992.tar.gz
Running Rake is too slow for me to do builds on, and
I don't have net access to install the Echoe gem at
the moment for Ruby 1.9...
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile26
1 files changed, 24 insertions, 2 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 457d30d..79ed355 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,5 +1,9 @@
 # use GNU Make to run tests in parallel, and without depending on Rubygems
 all:: test
+-include local.mk
+ifeq ($(DLEXT),) # "so" for Linux
+  DLEXT := $(shell ruby -rrbconfig -e 'puts Config::CONFIG["DLEXT"]')
+endif
 
 slow_tests := test/unit/test_server.rb
 awk_slow := awk '/def test_/{print FILENAME"--"$$2".n"}'
@@ -11,9 +15,27 @@ $(slow_tests):
         @$(MAKE) $(shell $(awk_slow) $@)
 %.n: arg = $(subst .n,,$(subst --, -n ,$@))
 %.n: name = $(subst .n,,$(subst --, ,$@))
-%.n:
+%.n: lib/http11.$(DLEXT)
         @echo '**** $(name) ****'; ruby -I lib $(arg) $(TEST_OPTS)
-$(T):
+$(T): lib/http11.$(DLEXT)
         @echo '**** $@ ****'; ruby -I lib $@ $(TEST_OPTS)
 
+http11_deps := $(addprefix ext/http11/, \
+                 ext_help.h http11.c http11_parser.c http11_parser.h \
+                 http11_parser.rl http11_parser_common.rl \
+                 Makefile)
+ext/http11/http11_parser.c: ext/http11/http11_parser.rl
+        cd $(@D) && ragel $(<F) -C -G2 -o $(@F)
+ext/http11/Makefile: ext/http11/extconf.rb
+        cd $(@D) && ruby $(<F)
+ext/http11/http11.$(DLEXT): $(http11_deps)
+        $(MAKE) -C $(@D)
+lib/http11.$(DLEXT): ext/http11/http11.$(DLEXT)
+        @mkdir -p lib
+        install -m644 $< $@
+
+clean:
+        -$(MAKE) -C ext/http11 clean
+        $(RM) ext/http11/Makefile lib/http11.$(DLEXT)
+
 .PHONY: $(T) $(slow_tests)