autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: make -s, how to make it quiet?


From: Joakim Tjernlund
Subject: RE: make -s, how to make it quiet?
Date: Sat, 13 Sep 2008 11:40:46 +0200

> -----Original Message-----
> From: Ralf Wildenhues [mailto:address@hidden
> Sent: den 13 september 2008 10:54
> To: Joakim Tjernlund
> Cc: address@hidden
> Subject: Re: make -s, how to make it quiet?
> 
> * Joakim Tjernlund wrote on Sat, Sep 13, 2008 at 10:37:37AM CEST:
> > > > Anyhow, I am upgrading to newer automake but I get a ton of:
> > > > ecn_ss/ecn_ppp_bl/Makefile.am:52: pppd_LDADD must be set with `=' 
> > > > before using `+='
> > > > ne/ecn_ss/ecn_ppp_bl/Makefile.am:57: relayd_LDADD must be set with `=' 
> > > > before using `+='
> > > >
> > > > Is there any way make newer automake accept those?
> > >
> > > Well, these errors were added to help find typos in Makefile.am files.
> > > You have to initialize the variables before adding to them:
> > >   pppd_LDADD =
> > >   pppd_LDADD += ...
> 
> > I know, but there are too many of those to be fixed manually. I guess
> > I need to write a script(perhaps someone already has?, please send it
> > my way :)
> 
> Here's a quick, completely untested stab.  Please backup your tree
> before using it, any data loss is completely yours to handle.  Esp.
> you might want to omit the 'rm' at the end for testing.
> 
> #! /bin/sh
> set -e
> LC_ALL=C
> export LC_ALL
> adds=adds.$$
> inits=inits.$$
> tmp=tmp.$$
> for file in `find . -name Makefile.am`; do
>   sed -n 's/^\([a-zA-Z_][a-zA-Z_0-9]*\) *+=.*/\1/p' "$file" | sort -u > $adds
>   sed -n 's/^\([a-zA-Z_][a-zA-Z_0-9]*\) *=.*/\1/p' "$file" | sort -u > $inits
>   needed=`join -v 1 $adds $inits`
>   mv "$file" $tmp
>   { echo "$needed" | sed 's/$/ =/'; cat $tmp; } > "$file"
> done
> rm $tmp $adds $inits

Thanks!

Works fairly well, just one thing:
It turns already correct assignmenst like:
 SUBDIRS = xxxx
 SUBDIRS += yyyy
into
 =
 SUBDIRS = xxxx
 SUBDIRS += yyyy

Is there a simple fix for that?

 Jocke





reply via email to

[Prev in Thread] Current Thread [Next in Thread]