462
462
# Generate code to set up dependency tracking. -*- Autoconf -*-
464
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
464
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
465
465
# Free Software Foundation, Inc.
467
467
# This file is free software; the Free Software Foundation
468
468
# gives unlimited permission to copy and/or distribute it,
469
469
# with or without modifications, as long as this notice is preserved.
473
473
# _AM_OUTPUT_DEPENDENCY_COMMANDS
474
474
# ------------------------------
475
475
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
476
[for mf in $CONFIG_FILES; do
477
# Strip MF so we end up with the name of the file.
478
mf=`echo "$mf" | sed -e 's/:.*$//'`
479
# Check whether this is an Automake generated Makefile or not.
480
# We used to match only the files named `Makefile.in', but
481
# some people rename them; so instead we look at the file content.
482
# Grep'ing the first line is not enough: some people post-process
483
# each Makefile.in and add a new line on top of each file to say so.
484
# Grep'ing the whole file is not good either: AIX grep has a line
485
# limit of 2048, but all sed's we know have understand at least 4000.
486
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
487
dirpart=`AS_DIRNAME("$mf")`
491
# Extract the definition of DEPDIR, am__include, and am__quote
492
# from the Makefile without running `make'.
493
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
494
test -z "$DEPDIR" && continue
495
am__include=`sed -n 's/^am__include = //p' < "$mf"`
496
test -z "am__include" && continue
497
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
498
# When using ansi2knr, U may be empty or an underscore; expand it
499
U=`sed -n 's/^U = //p' < "$mf"`
500
# Find all dependency output files, they are included files with
501
# $(DEPDIR) in their names. We invoke sed twice because it is the
502
# simplest approach to changing $(DEPDIR) to its actual value in the
504
for file in `sed -n "
505
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
506
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
507
# Make sure the directory exists.
508
test -f "$dirpart/$file" && continue
509
fdir=`AS_DIRNAME(["$file"])`
510
AS_MKDIR_P([$dirpart/$fdir])
511
# echo "creating $dirpart/$file"
512
echo '# dummy' > "$dirpart/$file"
477
# Autoconf 2.62 quotes --file arguments for eval, but not when files
478
# are listed without --file. Let's play safe and only enable the eval
479
# if we detect the quoting.
480
case $CONFIG_FILES in
481
*\'*) eval set x "$CONFIG_FILES" ;;
482
*) set x $CONFIG_FILES ;;
487
# Strip MF so we end up with the name of the file.
488
mf=`echo "$mf" | sed -e 's/:.*$//'`
489
# Check whether this is an Automake generated Makefile or not.
490
# We used to match only the files named `Makefile.in', but
491
# some people rename them; so instead we look at the file content.
492
# Grep'ing the first line is not enough: some people post-process
493
# each Makefile.in and add a new line on top of each file to say so.
494
# Grep'ing the whole file is not good either: AIX grep has a line
495
# limit of 2048, but all sed's we know have understand at least 4000.
496
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
497
dirpart=`AS_DIRNAME("$mf")`
501
# Extract the definition of DEPDIR, am__include, and am__quote
502
# from the Makefile without running `make'.
503
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
504
test -z "$DEPDIR" && continue
505
am__include=`sed -n 's/^am__include = //p' < "$mf"`
506
test -z "am__include" && continue
507
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
508
# When using ansi2knr, U may be empty or an underscore; expand it
509
U=`sed -n 's/^U = //p' < "$mf"`
510
# Find all dependency output files, they are included files with
511
# $(DEPDIR) in their names. We invoke sed twice because it is the
512
# simplest approach to changing $(DEPDIR) to its actual value in the
514
for file in `sed -n "
515
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
516
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
517
# Make sure the directory exists.
518
test -f "$dirpart/$file" && continue
519
fdir=`AS_DIRNAME(["$file"])`
520
AS_MKDIR_P([$dirpart/$fdir])
521
# echo "creating $dirpart/$file"
522
echo '# dummy' > "$dirpart/$file"
515
526
])# _AM_OUTPUT_DEPENDENCY_COMMANDS