From: Tom Tromey Date: Fri, 13 Feb 1998 05:19:33 +0000 (+0000) Subject: added --generate-deps from paul d smith X-Git-Tag: pre-depend-change~2 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=39fa69525a17e4fae82504abdf005c7ef4605202;p=automake.git added --generate-deps from paul d smith --- diff --git a/ChangeLog b/ChangeLog index 16ed5cdd..2cf34d7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Sep 16 14:13:15 1997 Paul D. Smith + + * automake.in: Create new option --generate-deps. This option has + automake generate a .dep_segment file containing just the + dependencies created from the .P list. This is needed to maintain + other makefiles that automake doesn't deal with (Makefile.DOS, + SMakefile, etc.) + * automake.texi (Invoking Automake): Document it. + Thu Feb 12 19:45:16 1998 Tom Tromey * aclocal.in (scan_configure): Tightened regexp a bit. Test diff --git a/automake.in b/automake.in index d7b06ce5..2f1b8d3a 100755 --- a/automake.in +++ b/automake.in @@ -83,6 +83,10 @@ $default_strictness_name = 'gnu'; # code should be included in generated Makefile.in. $cmdline_use_dependencies = 1; +# This is the name of a dependency makefile bit (usually for inclusion in a +# SMakefile or similar); empty if not set. +$generate_deps = ''; + # TRUE if in verbose mode. $verbose = 0; @@ -280,6 +284,27 @@ $obsolete_rx = '(' . join ('|', keys %obsolete_macros) . ')'; die "automake: no \`Makefile.am' found or specified\n" if ! @input_files; +# If --generate-deps was given, we don't do anything else +# +if ($generate_deps) +{ + die "automake: Must specify --include-deps (or -i) when generating\n" + if ($use_dependencies); + die "automake: Must provide --build-dir when generating\n" + if (!$build_directory); + die "automake: Must provide --srcdir-name when generating\n" + if (!$srcdir_name); + + open(GDEP, ">$output_directory/.dep_segment") + || die "automake: Could not open `$output_directory/.dep_segment': $!\n"; + + &handle_dependencies; + print GDEP $output_rules; + + close(GDEP); + exit $exit_status; +} + # Now do all the work on each file. foreach $am_file (@input_files) { @@ -382,6 +407,10 @@ sub parse_arguments { $cmdline_use_dependencies = 0; } + elsif ($arglist[0] eq '--generate-deps') + { + $generate_deps = $1; + } elsif ($arglist[0] eq '--no-force') { $force_generation = 0; @@ -1179,7 +1208,7 @@ sub handle_single_transform_list elsif (s/\.[cly]$//) { # .c is C. .l is lex. .y is yacc. - + # Note: first we rewrite (eg) foo.c to foo and push # the file onto the list of deansified files. Then we add # $obj, which can either be `_.o', or simply `.o' if diff --git a/automake.texi b/automake.texi index 47a5cc3b..f5f0d12e 100644 --- a/automake.texi +++ b/automake.texi @@ -741,6 +741,16 @@ Include all automatically generated dependency information @file{Makefile.in}. This is generally done when making a distribution; see @ref{Dist}. +@item --generate-deps +Generate a file concatenating all automatically generated dependency +information (@pxref{Dependencies}) into one file, @file{.dep_segment}. +This is generally done when making a distribution; see @ref{Dist}. It +is useful when maintaining a @file{SMakefile} or makefiles for other +platforms (@file{Makefile.DOS}, etc.) It can only be used in +conjunction with @code{--include-deps}, @code{--srcdir-name}, and +@code{--build-dir}. Note that if this option is given, no other +processing is done. + @item --no-force Ordinarily @code{automake} creates all @file{Makefile.in}s mentioned in @file{configure.in}. This option causes it to only update those