D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Makefiles

 

On Nov 8, 2007 11:35 PM, Neil Williams <linux@xxxxxxxxxxxxxx> wrote:
> On Thu, 8 Nov 2007 13:15:54 +0000
> "Robin Cornelius" <robin.cornelius@xxxxxxxxx> wrote:
>
> > Arrg, having another braindead day
> >
> > How can i do a conditional make file as such :-
> >
> > distclean:
> > if [ -f Makefile.qmake ]
> >       ${MAKE} -f Makefile.qmake distclean
> >       rm -f Makefile
> > endif
>
> That's a shell construct.

Yea i know but i though it was the easiest way to explain :-)

>
> Drop the 'if' (from a Debian package):
> [ ! -f ${stdbuilddir}/Makefile ] || make -C ${stdbuilddir} distclean
>
> If no Makefile exists, ignore. Else use the Makefile for a distclean.
>

Oooh, thanks!, for the life of me i could not find an example of this
on google. I found the manual for make and the conditional parts but i
could not see how it related to checking for a file. I found lots of
attempts at doing this but none worked.

ty to everyone who responded.

Robin

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html