Le 10 août 2012 à 13:10, Stefano Lattarini a écrit : > -## ------------------- ## > -## Building site.exp. ## > -## ------------------- ## > - > -## Note that in the rule we don't directly generate site.exp to avoid > -## the possibility of a corrupted site.exp if make is interrupted. > -## Jim Meyering has some useful text on this topic. > +# Note that in the rule we don't directly generate site.exp to avoid > +# the possibility of a corrupted site.exp if make is interrupted. > +# Jim Meyering has some useful text on this topic. > site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
The comment is, IMHO, superfluous today (who would write such rules now?), and I would use $@ and $@-t for consistency. > @echo 'Making a new site.exp file ...' > @echo '## these variables are automatically generated by make ##' > >site.tmp > @@ -54,14 +55,20 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) > @echo '# edit the last section' >>site.tmp > @echo 'set srcdir "$(srcdir)"' >>site.tmp > @echo "set objdir `pwd`" >>site.tmp > -## Quote the *_alias variables because they might be empty. > - $(if $(am.conf.build-triplet),@echo 'set build_triplet $(build)' > >>site.tmp) > - $(if $(am.conf.build-triplet),@echo 'set build_alias "$(build_alias)"' > >>site.tmp) > - $(if $(am.conf.host-triplet),@echo 'set host_triplet $(host)' > >>site.tmp) > - $(if $(am.conf.host-triplet),@echo 'set host_alias "$(host_alias)"' > >>site.tmp) > - $(if $(am.conf.target-triplet),@echo 'set target_alias > "$(target_alias)"' >>site.tmp) > - $(if $(am.conf.target-triplet),@echo 'set target_triplet $(target)' > >>site.tmp) > -## Allow the package author to extend site.exp. > + @# Quote the *_alias variables because they might be empty. > +ifdef am.conf.build-triplet > + @echo 'set build_triplet $(build)' >>site.tmp > + @echo 'set build_alias "$(build_alias)"' >>site.tmp > +endif > +ifdef am.conf.host-triplet > + @echo 'set host_triplet $(host)' >>site.tmp > + @echo 'set host_alias "$(host_alias)"' >>site.tmp > +endif > +ifdef am.conf.target-triplet > + @echo 'set target_triplet $(target)' >>site.tmp > + @echo 'set target_alias "$(target_alias)"' >>site.tmp > +endif > + @# Allow the package author to extend site.exp. > @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ > echo "## Begin content included from file $$f. Do not modify. ##" \ > && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ > @@ -76,13 +83,8 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) > @test ! -f site.exp || mv site.exp site.bak > @mv site.tmp site.exp > > -## ---------- ## > -## Cleaning. ## > -## ---------- ## > - > -## Any other cleaning must be done by the user or by the test suite > -## itself. We can't predict what dejagnu or the test suite might > -## generate. > +# Any other cleaning must be done by the user or by the test suite itself. > +# We can't predict what dejagnu or the test suite might generate. > ## FIXME: we clean these on "make distclean" only for better compatibility > ## FIXME: with mainline Automake, but wouldn't be more correct to clean > ## FIXME: them on "make clean" instead? > diff --git a/t/dejagnu2.sh b/t/dejagnu2.sh > index 5b75bb6..51f23fb 100755 > --- a/t/dejagnu2.sh > +++ b/t/dejagnu2.sh > @@ -31,16 +31,10 @@ END > > $ACLOCAL > $AUTOCONF > -$AUTOMAKE -Wno-override > - > -grep 'site\.exp' Makefile.in > -test $(grep -c '^site\.exp:' Makefile.in) -eq 1 > +$AUTOMAKE > > ./configure > $MAKE site.exp > grep ':GREP:ME:' site.exp > > -AUTOMAKE_fails > -grep '^Makefile\.am:3:.*site\.exp' stderr > - > : > -- > 1.7.12.rc0 > >
