[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] use none-recursive make
From: |
Sami Kerola |
Subject: |
[PATCH 3/6] use none-recursive make |
Date: |
Wed, 20 Nov 2013 00:59:39 +0000 |
* .gitignore: update paths
* Makefile.am: collect build rules to this file
* bootstrap.conf: use new module
* build-aux/.gitignore: ignore new module
* configure.ac: remove old Makefiles
* contrib/Makefile.am: remove
* doc/Makefile.am: remove
* doc/local.mk: add texi rules
* lib/local.mk: add phony target
* src/Makefile.am: remove
---
.gitignore | 6 ++++--
Makefile.am | 51 +++++++++++++++++++++++++++++++++++++++++++++++++--
bootstrap.conf | 10 ++++++++++
build-aux/.gitignore | 1 +
configure.ac | 15 +++++++--------
contrib/Makefile.am | 18 ------------------
doc/Makefile.am | 19 -------------------
doc/local.mk | 22 ++++++++++++++++++++++
lib/local.mk | 5 +++++
man/Makefile.am | 30 ------------------------------
src/Makefile.am | 27 ---------------------------
11 files changed, 98 insertions(+), 106 deletions(-)
delete mode 100644 contrib/Makefile.am
delete mode 100644 doc/Makefile.am
create mode 100644 doc/local.mk
create mode 100644 lib/local.mk
delete mode 100644 man/Makefile.am
delete mode 100644 src/Makefile.am
diff --git a/.gitignore b/.gitignore
index fcc5edf..2e1b097 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
+/ABOUT-NLS
*~
*.[oa]
+.dirstamp
ABOUT-NLS
INSTALL
Makefile
@@ -15,14 +17,14 @@ stamp.h*
*.cache
src/.libs
src/.deps
-src/hello
+hello
po/.reference
po/*.gmo
po/POTFILES
po/messages
po/stamp-po
po/*.pot
-man/hello.1
+hello.1
doc/*.aux
doc/*.dvi
doc/*.info*
diff --git a/Makefile.am b/Makefile.am
index 437384a..1588529 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,11 +21,55 @@
# Find gnulib headers.
ACLOCAL_AMFLAGS = -I m4
+AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
+
# Additional files to distribute.
-EXTRA_DIST = README-dev ChangeLog.O m4/gnulib-cache.m4
+EXTRA_DIST = \
+ README-dev \
+ ChangeLog.O \
+ m4/gnulib-cache.m4 \
+ contrib/de_franconian_po.txt \
+ contrib/evolution.txt
# Subdirectories to descend into.
-SUBDIRS = contrib lib po src doc man tests
+SUBDIRS = po
+
+bin_PROGRAMS = hello
+hello_SOURCES = src/hello.c src/system.h
+
+hello_LDADD = $(LIBINTL) $(top_builddir)/lib/lib$(PACKAGE).a
+
+localedir = $(datadir)/locale
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
+man_MANS = hello.1
+EXTRA_DIST += $(man_MANS)
+CLEANFILES = $(man_MANS)
+
+hello.1: hello
+ $(HELP2MAN) --name="friendly greeting program" $(top_builddir)/hello -o
$@
+
+TESTS = \
+ tests/greeting-1 \
+ tests/greeting-2 \
+ tests/hello-1 \
+ tests/last-1 \
+ tests/traditional-1
+
+EXTRA_DIST += $(TESTS)
+
+noinst_LIBRARIES =
+MOSTLYCLEANFILES =
+MOSTLYCLEANDIRS =
+BUILT_SOURCES =
+
+LOG_COMPILER = $(SHELL)
+
+AM_TESTS_ENVIRONMENT = \
+ top_srcdir=$(top_srcdir) \
+ PATH=.$(PATH_SEPARATOR)$(PATH_SEPARATOR)$$PATH \
+ HELLO=`echo hello | sed '$(transform)'`; \
+ export HELLO PATH top_srcdir;
# Verify that all source files using _() are listed in po/POTFILES.in.
# The idea is to run this before making pretests, as well as official
@@ -77,3 +121,6 @@ wwwdoc:
cp -arf $(doctemp)/manual/. $(www_target)
ls -ltu $(www_target)/html_node | tail # $VCS rm -f obsolete files
# followed by $VCS add of new files and cvs commit.
+
+include $(top_srcdir)/lib/local.mk
+include $(top_srcdir)/doc/local.mk
diff --git a/bootstrap.conf b/bootstrap.conf
index 92376b1..951ee3f 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -20,6 +20,7 @@
gnulib_modules="
announce-gen
closeout
+ configmake
do-release-commit-and-tag
fdl
gendocs
@@ -29,6 +30,7 @@ gnulib_modules="
gnupload
maintainer-makefile
mbsrtowcs
+ non-recursive-gnulib-prefix-hack
progname
readme-release
wchar
@@ -72,6 +74,8 @@ if test $gettext_external = 1; then
'
fi
+gnulib_tool_option_extras="--makefile-name=gnulib.mk"
+
# Build prerequisites
buildreq="\
autoconf 2.59
@@ -80,6 +84,12 @@ git 1.5.5
tar -
"
+bootstrap_post_import_hook ()
+{
+ # Massage lib/gnulib.mk before using it later in the bootstrapping process.
+ build-aux/prefix-gnulib-mk --lib-name=$gnulib_name lib/$gnulib_mk
+}
+
# File that should exist in the top directory of a checked out hierarchy,
# but not in a distribution tarball.
checkout_only_file=README-dev
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
index 95fd4b4..e69d000 100644
--- a/build-aux/.gitignore
+++ b/build-aux/.gitignore
@@ -19,3 +19,4 @@
/useless-if-before-free
/vc-list-files
/gnu-web-doc-update
+/prefix-gnulib-mk
diff --git a/configure.ac b/configure.ac
index 6180cc8..6b32fb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,12 @@ AC_INIT([GNU Hello],
dnl Must come before AM_INIT_AUTOMAKE.
AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([1.11.1 readme-alpha parallel-tests])
+AM_INIT_AUTOMAKE([
+ 1.11.1
+ readme-alpha
+ parallel-tests
+ subdir-objects
+])
dnl Minimum Autoconf version required.
AC_PREREQ([2.62])
@@ -54,11 +59,5 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT([external])
AC_CONFIG_FILES([Makefile
- contrib/Makefile
- doc/Makefile
- lib/Makefile
- man/Makefile
- po/Makefile.in
- src/Makefile
- tests/Makefile])
+ po/Makefile.in])
AC_OUTPUT
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index 922e0b5..0000000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-# Makefile.am for hello/contrib.
-#
-# Copyright 1999, 2005, 2006, 2007, 2008, 2010 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
-# the Free Software Foundation; either version 3, 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/>.
-
-EXTRA_DIST = de_franconian_po.txt evolution.txt
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index 84bcc58..0000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-# Makefile.am for hello/doc.
-#
-# Copyright 1996, 1997, 2005, 2007, 2008, 2010 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
-# the Free Software Foundation; either version 3, 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/>.
-
-info_TEXINFOS = hello.texi
-hello_TEXINFOS = fdl.texi
diff --git a/doc/local.mk b/doc/local.mk
new file mode 100644
index 0000000..a10e5a2
--- /dev/null
+++ b/doc/local.mk
@@ -0,0 +1,22 @@
+# Make hello documentation. -*-Makefile-*-
+# This is included by the top-level Makefile.am.
+
+# Copyright (C) 1995-2013 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
+# 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/>.
+
+info_TEXINFOS = doc/hello.texi
+
+doc_hello_TEXINFOS = \
+ doc/fdl.texi
diff --git a/lib/local.mk b/lib/local.mk
new file mode 100644
index 0000000..decbad6
--- /dev/null
+++ b/lib/local.mk
@@ -0,0 +1,5 @@
+include lib/gnulib.mk
+
+# Allow "make distdir" to succeed before "make all" has run.
+dist-hook: $(noinst_LIBRARIES)
+.PHONY: dist-hook
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644
index b59e945..0000000
--- a/man/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-# Makefile.am for hello/man.
-#
-# Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010
-# 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
-# the Free Software Foundation; either version 3, 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/>.
-
-man_MANS = hello.1
-EXTRA_DIST = $(man_MANS)
-MAINTAINERCLEANFILES = $(man_MANS)
-
-# The man pages depend on the --help strings and the version number.
-common_mandeps = $(top_srcdir)/configure.ac
-
-# Depend on the source, not the binary; we don't need to regenerate the
-# binary when any source file changes, only the main one.
-# Use -o so that the `missing' program can infer the output file.
-hello.1: $(top_srcdir)/src/hello.c $(common_mandeps)
- $(HELP2MAN) --name="friendly greeting program" ../src/hello -o $@
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 93e6f45..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Makefile.am for hello/src.
-#
-# Copyright 1996, 1997, 2001, 2005, 2006, 2007, 2008 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
-# the Free Software Foundation; either version 3, 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/>.
-
-bin_PROGRAMS = hello
-hello_SOURCES = hello.c system.h
-
-hello_LDADD = $(LIBINTL) $(top_builddir)/lib/lib$(PACKAGE).a
-
-localedir = $(datadir)/locale
-
-AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_builddir)/lib
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
--
1.8.4.2