From 4cf13ced6dcadc8a0483e79966a023b5cf9f2b9b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 22 Jun 1996 00:29:14 +0000 Subject: [PATCH] Added --no-force. Bug fix --- ChangeLog | 9 +++++++++ Makefile.in | 5 +++-- NEWS | 1 + TODO | 6 ++++++ automake.in | 27 ++++++++++++++++++++++++--- lib/am/texinfos.am | 5 +++-- tests/Makefile.in | 2 +- texinfos.am | 5 +++-- 8 files changed, 50 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48033a25..5bd9eded 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ Fri Jun 21 10:42:06 1996 Tom Tromey + * texinfos.am (install-info): Use "if", not "&&", to avoid + install problem when glob doesn't match. + + * automake.in (initialize_global_constants): [USAGE] Added + --no-force. + (force_generation): New global. + (parse_arguments): Handle --no-force. + (generate_makefile): Handle --no-force. + * Makefile.am (maintainer-check): Ensure all invocations of mkinstalldirs are correct. diff --git a/Makefile.in b/Makefile.in index 34b02333..7f65aa60 100644 --- a/Makefile.in +++ b/Makefile.in @@ -182,8 +182,9 @@ install-info: $(INFO_DEPS) $(mkinstalldirs) $(infodir) for file in $(INFO_DEPS); do \ for ifile in `cd $(srcdir) && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - test -f $(srcdir)/$$ifile \ - && $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \ + if test -f $(srcdir)/$$ifile; then \ + $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \ + else : ; fi; \ done; \ done diff --git a/NEWS b/NEWS index dfa090f5..f7f0fab7 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ New in 1.1: * Better DejaGNU support * Added no-installinfo option * Added Emacs Lisp support +* Added --no-force option New in 1.0: * Bug fixes diff --git a/TODO b/TODO index e40153f7..9780c12a 100644 --- a/TODO +++ b/TODO @@ -4,6 +4,12 @@ Priorities for release: ** Consider using implicit .y.c and .l.c rules instead of current lex/yacc trickery +add new flag to only remake Makefile.in's that are old. use this in +autoreconf. + +add support for Makefile.tmpl that is auto-included in every +Makefile.am. That makes it easier to do some non-std thing in every +subdirectory. consider printing full file name of Makefile.am or configure.in when giving error. This would help for very large trees with many diff --git a/automake.in b/automake.in index c5b89651..c320d155 100755 --- a/automake.in +++ b/automake.in @@ -50,6 +50,9 @@ $GNITS = 2; # Variables global to entire run. +# TRUE if we should always generate Makefile.in. +$force_generation = 1; + # Strictness level as set on command line. $default_strictness = $GNU; @@ -272,6 +275,10 @@ sub parse_arguments { $cmdline_use_dependencies = 0; } + elsif ($arglist[0] eq '--no-force') + { + $force_generation = 0; + } elsif ($arglist[0] =~ /^--output-dir=(.*)$/) { # Set output directory. @@ -334,8 +341,6 @@ sub generate_makefile $in_file_name = $am_file_name . '.in'; $am_file_name .= '.am'; - print "automake: creating ", $makefile, ".in\n" if $verbose; - &initialize_per_input; $relative_dir = &dirname ($makefile); @@ -405,12 +410,27 @@ sub generate_makefile { &mkdir ($output_directory . '/' . $relative_dir); } - if (! open (GM_FILE, "> " . $output_directory . '/' . $makefile . ".in")) + + local ($out_file) = $output_directory . '/' . $makefile . ".in"; + if (! $force_generation && -e $out_file) + { + local ($am_time) = (stat ($makefile . '.am'))[9]; + local ($in_time) = (stat ($out_file))[9]; + # FIXME how to do unsigned comparison? + if ($am_time < $in_time) + { + # No need to update. + return; + } + } + + if (! open (GM_FILE, "> " . $out_file)) { warn "automake: ${am_file}.in: cannot open: $!\n"; $exit_status = 1; return; } + print "automake: creating ", $makefile, ".in\n" if $verbose; print GM_FILE $output_vars; print GM_FILE $output_rules; @@ -2597,6 +2617,7 @@ sub initialize_global_constants --help print this help, then exit -i, --include-deps include generated dependencies in Makefile.in -a, --add-missing add missing standard files to package + --no-force only update Makefile.in's that are out of date -o DIR, --output-dir=DIR put generated Makefile.in's into DIR -s LEVEL, --strictness=LEVEL diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am index bcf2791c..a4d60c95 100644 --- a/lib/am/texinfos.am +++ b/lib/am/texinfos.am @@ -31,8 +31,9 @@ install-info: $(INFO_DEPS) ## We use these strange circumlocutions because we want the "ifile" to ## be relative, for the install. for ifile in `cd $(srcdir) && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - test -f $(srcdir)/$$ifile \ - && $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \ + if test -f $(srcdir)/$$ifile; then \ + $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \ + else : ; fi; \ done; \ ## We need the 'else' because in some broken versions of sh 'if' will ## return false if the test fails. We use ':' because the GNU diff --git a/tests/Makefile.in b/tests/Makefile.in index 289ec762..506e2a0d 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -90,7 +90,7 @@ check-TESTS: $(TESTS) all=`expr $$all + 1`; \ if test -f $$tst; then dir=.; \ else dir="$(srcdir)"; fi; \ - if $$dir/$$tst; then \ + if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ echo "PASS: $$tst"; \ else \ failed=`expr $$failed + 1`; \ diff --git a/texinfos.am b/texinfos.am index bcf2791c..a4d60c95 100644 --- a/texinfos.am +++ b/texinfos.am @@ -31,8 +31,9 @@ install-info: $(INFO_DEPS) ## We use these strange circumlocutions because we want the "ifile" to ## be relative, for the install. for ifile in `cd $(srcdir) && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - test -f $(srcdir)/$$ifile \ - && $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \ + if test -f $(srcdir)/$$ifile; then \ + $(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \ + else : ; fi; \ done; \ ## We need the 'else' because in some broken versions of sh 'if' will ## return false if the test fails. We use ':' because the GNU -- 2.43.5