about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-02-11 16:54:59 +0000
committerEric Wong <normalperson@yhbt.net>2012-02-12 09:39:11 +0000
commite41cd7891e1f9ee799738ee947a45d4d59861fed (patch)
treec0ae56184500de6d6063a05447d3a883fa47635b
parentd33ce96f6c3806c8cf0c4f252909a8ad8ed96d85 (diff)
downloadcmogstored-e41cd7891e1f9ee799738ee947a45d4d59861fed.tar.gz
Hackers modifying test cases or manpages still need to use
GNU make, but this should make life easier for folks that
just want to run cmogstored and maybe make minor changes
to the code.
-rw-r--r--GNUmakefile17
-rw-r--r--HACKING5
-rw-r--r--INSTALL2
-rw-r--r--Makefile.am31
-rw-r--r--build-aux/coverage.mk6
-rw-r--r--test/.gitignore2
-rw-r--r--test/ruby.mk4
7 files changed, 39 insertions, 28 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..03452e5
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,17 @@
+# This GNUmakefile is only required to build targets of interest
+# to the maintainers, not users building from the source tarball
+
+include test/ruby.mk
+_check_slow_mk := $(shell test -s test/slow.mk || $(RM) test/slow.mk)
+-include test/slow.mk
+-include Makefile
+test/slow.mk: $(RB_TESTS_SLOW) test/gen-slow.sh
+        $(AM_V_GEN)test/gen-slow.sh $(RB_TESTS_SLOW) > $@.$$$$ && \
+        mv $@.$$$$ $@
+# manpage-hack.mk is intended for maintainers and _not_ distributed with
+# the tarball.  This hack is to avoid recursively calling make inside
+# the cmogstored.1 rule, as recursively building "cmogstored" breaks
+# parallel builds.  We also don't want to rely on users having help2man
+# installed, so we distribute the generated manpage from the tarball.
+# manpage-hack.mk is only in the git repo: git://bogomips.org/cmogstored
+-include build-aux/manpage-hack.mk
diff --git a/HACKING b/HACKING
index d8c236d..8a66663 100644
--- a/HACKING
+++ b/HACKING
@@ -1,11 +1,14 @@
 Bootstrapping from the git repo requires GNU autotools, Gnulib and
 Ragel.  You will need "autoreconf", "gnulib-tool" and "ragel" in your
-$PATH.  Some of the tests require "ruby" (1.8.7-p299 or later)
+$PATH.  Some of the tests require "ruby" (1.8.7-p299 or later).
+GNU make ("gmake" on non-GNU systems) is not required for normal user
+builds and installation, but highly recommended for hackers.
 
 * autoconf - https://www.gnu.org/software/autoconf/
 * automake - https://www.gnu.org/software/automake/
 * Gnulib - https://www.gnu.org/software/gnulib/
 * Ragel - http://www.comp-lang.org/ragel/ (parser)
+* GNU make - https://www.gnu.org/software/make/
 * ruby - http://www.ruby-lang.org/
 * git - http://www.git-scm.com/
 
diff --git a/INSTALL b/INSTALL
index f3f5877..454eded 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,6 @@ Standard autotools installation
   ./configure && make && make install
 
 Full instructions (as written by the FSF at the bottom).
-If your "make" command is not GNU make, run "gmake" instead of "make"
 
 Runtime Requirements (GNU/Linux)
 ================================
@@ -36,7 +35,6 @@ Build Requirements
 ==================
 
 * gcc 4.1 or later or compatible.  We depend on GCC-specific features.
-* GNU make, this is "gmake" on non-GNU systems.
 
 See the "HACKING" document for required development tools.
 
diff --git a/Makefile.am b/Makefile.am
index dc63271..fed65e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,8 +3,7 @@ AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
 AM_CFLAGS = $(WARN_CFLAGS) $(PTHREAD_CFLAGS)
 SUBDIRS = lib
 
-# slow.mk is auto-generated, it can be an empty file
--include $(top_srcdir)/test/slow.mk.gen
+# slow.mk is auto-generated by the maintainer (see GNUmakefile)
 include $(top_srcdir)/test/slow.mk
 
 mog_src =
@@ -86,8 +85,7 @@ cfg_parser.c: cfg_parser.rl listen_parser_common.rl
 listen_parser.c: listen_parser.rl listen_parser_common.rl
 http_parser.c: http_parser.rl http_common.rl
 chunk_parser.c: chunk_parser.rl http_common.rl
-
-%.c: %.rl
+.rl.c:
         $(AM_V_GEN)$(RAGEL) $< -C $(RLFLAGS) -o $@
 
 BUILT_SOURCES = $(top_srcdir)/.version
@@ -105,15 +103,7 @@ PERL_LOG_COMPILER = $(PERL)
 PERL_LOG_FLAGS = -w
 SLOWRB_LOG_COMPILER = RUBY="$(RUBY)"
 AM_SLOWRB_LOG_FLAGS = top_srcdir="$(top_srcdir)"
-RB_TESTS_FAST = test/cmogstored-cfg.rb test/http_dav.rb test/http_range.rb
-RB_TESTS_SLOW = test/mgmt-usage.rb test/mgmt.rb test/mgmt-iostat.rb \
- test/http.rb test/http_put.rb test/http_chunked_put.rb
-RB_TESTS = $(RB_TESTS_FAST) $(RB_TESTS_SLOW)
-
-test/slow.mk.gen: $(RB_TESTS_SLOW) test/gen-slow.sh
-        $(AM_V_GEN)test/gen-slow.sh $(RB_TESTS_SLOW) > test/slow.mk
-        @echo '# placeholder for test/slow.mk' > $@
-
+include $(top_srcdir)/test/ruby.mk
 check_PROGRAMS = test/valid-path-1 test/trywrite-1 \
   test/cfg-parser-1 test/fdmap-1 test/thrpool-1 test/queue-1 \
   test/queue-idle-1 \
@@ -139,15 +129,8 @@ test_chunk_parser_1_SOURCES = test/chunk-parser-1.c $(test_COMMON)
 HELP2MAN = help2man
 dist_man_MANS = cmogstored.1
 
-# manpage-hack.mk is intended for maintainers and _not_ distributed with
-# the tarball.  This hack is to avoid recursively calling make inside
-# the cmogstored.1 rule, as recursively building "cmogstored" breaks
-# parallel builds.  We also don't want to rely on users having help2man
-# installed, so we distribute the generated manpage from the tarball.
-# manpage-hack.mk is only in the git repo: git://bogomips.org/cmogstored
--include $(top_srcdir)/build-aux/manpage-hack.mk
-
 cmogstored.1: cmogstored.x $(cmogstored_SOURCES)
+.x.1:
         $(AM_V_GEN)$(HELP2MAN) -i $< -N $(top_builddir)/cmogstored \
           > $@.$$$$ && mv $@.$$$$ $@
 
@@ -173,16 +156,16 @@ publish: NEWS.atom.xml NEWS ChangeLog
 .PHONY: publish
 
 EXTRA_DIST = $(RB_TESTS) $(RL_CGEN) $(RL_ALL) $(PERL_TESTS) $(extra_doc) \
-  .gitignore Rakefile autogen.sh bsd/README doc m4 \
+  .gitignore Rakefile autogen.sh GNUmakefile bsd/README doc m4 \
   test/test_helper.rb test/iostat-mock.rb \
-  test/.gitignore test/gen-slow.sh test/slow.mk test/slow.mk.gen \
+  test/.gitignore test/gen-slow.sh test/slow.mk \
   cmogstored.x .ctags $(SLOW_RB_FILES) \
   build-aux/.gitignore build-aux/snippet/.gitignore \
   $(top_srcdir)/.version
 
 TESTS_ENVIRONMENT = PATH=$(top_builddir):$$PATH
 
-CLEANFILES = *.gcov *.gcda *.gcno test/*.gcov test/*.gcda test/*.gcno
+CLEANFILES =
 MAINTAINERCLEANFILES = $(dist_man_MANS)
 include $(top_srcdir)/build-aux/coverage.mk
 include $(top_srcdir)/build-aux/release.mk
diff --git a/build-aux/coverage.mk b/build-aux/coverage.mk
index c40b271..234b6f9 100644
--- a/build-aux/coverage.mk
+++ b/build-aux/coverage.mk
@@ -8,6 +8,12 @@ cov_src = cmogstored.c $(mog_src) $(RL_MAIN)
 
 # this doesn't work in out-of-tree builds, yet...
 cover_db = $(top_srcdir)/cover_db
+
+coverage_junk = *.gcov *.gcda *.gcno
+CLEANFILES += $(coverage_junk)
+CLEANFILES += $(addprefix test/, $(coverage_junk))
+CLEANFILES += $(addprefix lib/, $(coverage_junk))
+
 coverage-clean:
         $(MAKE) clean
         $(RM) -r $(cover_db)
diff --git a/test/.gitignore b/test/.gitignore
index f016890..95a7cf6 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,2 +1,2 @@
 /.*
-slow.mk*
+slow.mk
diff --git a/test/ruby.mk b/test/ruby.mk
new file mode 100644
index 0000000..9090e01
--- /dev/null
+++ b/test/ruby.mk
@@ -0,0 +1,4 @@
+RB_TESTS_FAST = test/cmogstored-cfg.rb test/http_dav.rb test/http_range.rb
+RB_TESTS_SLOW = test/mgmt-usage.rb test/mgmt.rb test/mgmt-iostat.rb \
+ test/http.rb test/http_put.rb test/http_chunked_put.rb
+RB_TESTS = $(RB_TESTS_FAST) $(RB_TESTS_SLOW)