summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile66
1 files changed, 66 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..f4a1e88
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,66 @@
+# This makefile is used only if you run GNU Make.
+# This provides a convenience of automatically running configure
+# if it has not previously been run.
+
+# Systems where /bin/sh is not the default shell need this. The $(shell)
+# command below won't work with e.g. stock DOS/Windows shells.
+SHELL = /bin/sh
+
+have-Makefile := $(shell test -f Makefile && echo yes)
+have-configure := $(shell test -f configure && echo yes)
+have-Makefile-maint := $(shell test -f Makefile.maint && echo yes)
+
+# If the user runs GNU make but has not yet run ./configure,
+# give them a diagnostic.
+ifeq ($(have-Makefile),yes)
+
+include Makefile
+
+else
+
+ifeq ($(have-configure),yes)
+
+all:
+ @echo "There seems to be no Makefile in this directory."
+ @echo "Running ./configure before running 'make'."
+ sh ./configure
+ @$(MAKE)
+
+else
+
+all:
+ @echo "There seems to be no Makefile in this directory."
+ @echo "There seems to be no configure script in this directory."
+ @echo "Running 'autoreconf' to generate the configure script."
+ autoreconf --install
+ @$(MAKE)
+
+endif
+
+endif
+
+ifeq ($(have-Makefile-maint),yes)
+
+include Makefile.maint
+
+endif
+
+# Tell version 3.79 and up of GNU make to not build goals in this
+# directory in parallel. This is necessary in case someone tries to
+# build multiple targets on one command line.
+.NOTPARALLEL:
+
+# Copyright 2011 Bob Proulx
+#
+# 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.