[Top][All Lists]

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

Re: How to handle data/script files in a VPATH build ?

From: Ralf Wildenhues
Subject: Re: How to handle data/script files in a VPATH build ?
Date: Wed, 10 Feb 2010 21:29:26 +0100
User-agent: Mutt/1.5.20 (2009-10-28)


* Steffen Dettmer wrote on Wed, Feb 10, 2010 at 11:01:34AM CET:
> module=xyz
> _mak=${module}.mak
> echo "# Autogenerated by $0"  > ${_mak}
> echo "${module}files = \\"         >> ${_mak}
> find directoty1 directory2 directory3 -type f \
>    -not -path '*/CVS*' \

With find, -not is not portable, but ! is (suitably escaped when used in
an interactive shell); -path is not portable either.

>    -not -path '*/*.sw?' \
>    -exec echo "{} \\" \; \

POSIX find only allows you to use {} as a single argument IIRC; you can
just pass arguments to echo separately here: `-exec echo "{}" \\ \;'.

>                   | sort    >> ${_mak}

With sort, you should always normalize the locale, i.e.,
  LC_ALL=C sort

> echo "${_mak}"              >> ${_mak}
> Also find and friends could be used in Makefile rules but we made less
> good experiences with it; at least errors can be hard to find because
> may turn out much later and it feels "less defined" I think.

Well, don't look at the GNU find(1) manpage if you're looking for
portable options only.  That's what POSIX/SUSv3 is for; the findutils
info pages are more verbose about portability, too.


reply via email to

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