srcdir := @srcdir@
VPATH := @srcdir@
-cvs_controlled := @cvs_controlled@
+revctrl := @revctrl@
EMPIREHOST := @EMPIREHOST@
EMPIREPORT := @EMPIREPORT@
#
# ---
#
-# Make.mk:
+# Make.mk: The real Makefile, included by GNUmakefile
#
# Known contributors to this file:
# Markus Armbruster, 2005-2007
.DELETE_ON_ERROR:
# Source files
--include sources.mk
+ifeq ($(revctrl),git)
+src := $(shell cd $(srcdir) && git-ls-files)
+else
+include $(srcdir)/sources.mk
+endif
dirs := $(sort $(dir $(src)))
csrc := $(filter %.c, $(src))
tsrc := $(filter %.t, $(src))
man6 := $(filter man/%.6, $(src))
builtins := $(filter src/lib/global/%.config, $(src))
-# Info topics and subjects
+# Info subjects (automatically generated)
-include subjects.mk
# Abbreviations
# Info formatting
-subjects.mk: $(tsrc) info/findsubj.pl sources.mk
- perl $(srcdir)/info/findsubj.pl
-# If sources.mk is out of date, $(tsrc) is. If it contains files that
-# went away, make can't remake subjects.mk. Tell it to ignore such
-# missing files:
-$(tsrc):
+# FIXME Remaking subjects doesn't work correctly when info sources get
+# removed or subjects get dropped.
+
+subjects.mk: info/findsubj.pl $(tsrc)
+ perl $(srcdir)/info/findsubj.pl $(filter %.t, $^)
$(tsubj): info/mksubj.pl
perl $(srcdir)/info/mksubj.pl $@ $(filter %.t, $^)
# List of source files
-ifeq ($(cvs_controlled),yes)
-# Find files and directories under CVS control
-sources.mk: $(scripts)/cvsfiles.awk $(addprefix $(srcdir)/, $(addsuffix CVS/Entries, $(dirs)))
- echo 'src := ' `cd $(srcdir) && $(AWK) -f src/scripts/cvsfiles.awk | LC_ALL=C sort` >$@
+# Note: $(srcdir)/sources.mk is only used when the source tree came
+# from a tarball rather than git. The following rules create a
+# sources.mk to put into the tarball. It is not used in this build.
+
+ifeq ($(revctrl),git)
+sources.mk:
+ echo "src := $(src)" >sources.mk
else
ifneq ($(srcdir),.)
sources.mk: $(srcdir)/sources.mk
AC_CHECK_PROG(NROFF, groff, [GROFF_NO_SGR= groff -Tascii -U], nroff)
# not really a check for a program, but close enough
-if test -d $srcdir/CVS; then cvs_controlled=yes; else cvs_controlled=no; fi
-AC_SUBST(cvs_controlled,$cvs_controlled)
+if test -d $srcdir/.git; then revctrl=git
+else revctrl=
+fi
+AC_SUBST(revctrl,$revctrl)
### Checks for libraries
AC_CONFIG_FILES([GNUmakefile])
AC_CONFIG_COMMANDS([stamp-h],
- [if test $cvs_controlled = yes; then
- mkdir -p `cd $srcdir && $AWK -f src/scripts/cvsfiles.awk \
- | sed -n '/\//s,/@<:@^/@:>@*$,,gp'| uniq`
- else
+ [case $revctrl in
+ git)
+ mkdir -p `cd $srcdir && git-ls-files \
+ | sed -n 's,/@<:@^/@:>@*$,,gp' | uniq`
+ ;;
+ *)
mkdir -p `sed s/.*=// <$srcdir/sources.mk | tr ' ' '\012' \
| sed -n '/\//s,/@<:@^/@:>@*$,,gp'| uniq`
- fi
+ esac
mkdir -p info.html info.nr lib
touch stamp-h],
- [cvs_controlled=$cvs_controlled; AWK=$AWK])
+ [revctrl=$revctrl])
AC_OUTPUT
# Markus Armbruster, 2006
#
+# Usage: findsubj.pl INFO-FILE...
# Run it at the root of the build tree. This updates the make include
# file subjects.mk, which guides the remaking of info index files.
#
our @Subjects = split(' ', read_make_var("subjects", "subjects.mk", ""));
# Get source directory
my $srcdir = read_make_var("srcdir", "GNUmakefile");
-# Get info sources
-my @tsrc = grep(/\.t$/, split(' ' , read_make_var("src", "sources.mk")));
# Parse the .t files
-for my $t (@tsrc) {
- parse_file("$srcdir/$t");
+for my $f (@ARGV) {
+ parse_file("$f");
}
# Create %subjfil from %see_also
+++ /dev/null
-#!/usr/bin/awk -f
-# Find files under CVS control
-# FIXME Ignores CVS/Entries.log
-
-BEGIN {
- FS="/";
- if (ARGC == 1)
- ARGV[ARGC++] = "CVS/Entries";
- else {
- for (i = 1; i < ARGC; i++)
- ARGV[i] = ARGV[i] "/CVS/Entries";
- }
-}
-
-{ cwd = FILENAME; sub(/CVS\/Entries$/, "", cwd); }
-
-/^\// {
- if ($3 !~ /^-/)
- print cwd $2;
-}
-
-/^D/ && NF > 1 {
- ARGV[ARGC++] = cwd $2 "/CVS/Entries";
-}