help-make
[Top][All Lists]
Advanced

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

Re: shell functions from env not available in make?


From: gk
Subject: Re: shell functions from env not available in make?
Date: Fri, 25 Oct 2002 00:33:23 -0700

I have just found the answer to the problem:
export -f function_name

The confusing thing is that 'set' command shows the function as a 'shell variable' in subshells, even without the export command.
But 'env' command does not show the function name until you use export -f
That is what make requires apparently.
My /bin/sh is a link to /bin/bash

At 09:01 AM 10/25/2002 +0200, Johan Bezem wrote:
possible, make can spawn many commands directly, without the overhead of an
intermediate shell, but of course not bash-shell-functions...

Well now it can :-)
goo :
        @echo $$(xmsubdirs)
address@hidden test]$ make goo
foo.html.xm goo junkme moo.xm project


> address@hidden test]$ make foo
>

Here you're calling the shell without anything (Mind: $(xmsubdirs) is
empty!!), so it produces an empty line, and exits.

Now it isn't empty. It is a variable that bash tries to evaluate after expanding.

address@hidden test]$ make foo
XMLMAKE_BUILD_EXCLUDE_DIRS_RE='(^CVS)|(^trash)';: -c: line 1: syntax error near unexpected token `()' XMLMAKE_BUILD_EXCLUDE_DIRS_RE='(^CVS)|(^trash)';: -c: line 1: `() { [ -z "" ] && set .;'

Cheers,
Greg Keraunen





reply via email to

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