Comment.
[gnulib.git] / top / maint.mk
index 3756ee8..3177d57 100644 (file)
@@ -2,7 +2,7 @@
 # This Makefile fragment is intended to be useful by any GNU-like project.
 # This file originate from coreutils, CPPI, Bison, and Autoconf.
 
-# Copyright (C) 2001-2008 Free Software Foundation, Inc.
+# Copyright (C) 2001-2009 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ME := maint.mk
+MYSELF := $(srcdir)/$(ME)
 
 # List of all C-like source code files that will be tested for
 # stylistic "errors".  You may want to define this to something
@@ -100,7 +101,8 @@ sc_changelog:
            exit 1; } || :
 
 # Collect the names of rules starting with `sc_'.
-syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(ME))
+syntax-check-rules := \
+  $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(MYSELF))
 .PHONY: $(syntax-check-rules)
 
 syntax-check: $(syntax-check-rules)
@@ -108,15 +110,15 @@ syntax-check: $(syntax-check-rules)
 # Code Coverage
 
 init-coverage:
-       make clean
+       $(MAKE) $(AM_MAKEFLAGS) clean
        lcov --directory . --zerocounters
 
 COVERAGE_CCOPTS ?= "-g --coverage"
 COVERAGE_OUT ?= doc/coverage
 
 build-coverage:
-       make CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS)
-       make CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) check
+       $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS)
+       $(MAKE) $(AM_MAKEFLAGS) CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) check
        mkdir -p $(COVERAGE_OUT)
        lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \
                --capture