[Top][All Lists]

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

Re: Automake Digest, Vol 175, Issue 3

From: Nick Bowler
Subject: Re: Automake Digest, Vol 175, Issue 3
Date: Tue, 5 Sep 2017 18:57:55 -0400

On 2017-09-05, Kip Warner <address@hidden> wrote:
> Hey Thomas. Good question. It could well be that no hackery at all is
> required with this. Here is my
> See parser_clobbered_source_full_paths as an example. This variant
> containing the full path is used in BUILT_SOURCES, nodist_..._SOURCES,
> CLEANFILES, and as a target.
> The parser_clobbered_source_files_only variant containing the file
> names only is used on line 150 as a workaround for where bisonc++(1)
> emits its files.
> If you can see a more elegant way of solving the same problem I'm
> trying to, I'm all ears.

If your only uses of the directoryless-filenames are in rules, then
just write the names including directories in the make variables,
then strip off the directory components inside the rule.  In rules
you can use the much more powerful shell constructs.


  % cat >Makefile <<'EOF'
  FOO = a b/c d/e/f

        for i in $(FOO); do \
          case $$i in */*) i=`expr "$$i" : '.*/\(.*\)'`; esac; \
          printf '%s\n' "$$i"; \
  % make my_rule

If you assume a reasonably-POSIXish shell, you can use something like
$${i##*/} to strip directory parts instead (I think this form will fail
on at least Solaris /bin/sh).


reply via email to

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