Re: export not working...

2004-01-21 Thread Paul D. Smith
%% Christopher J Bottaro <[EMAIL PROTECTED]> writes: cjb> ok, now i'm confused. i'm looking at some pretty popular linux cjb> projects (KDE) and in their makefiles (generated by cjb> automake/autoconf) That's your answer right there. Automake generates makefiles that work with the least c

Re: export not working...

2004-01-21 Thread Christopher J Bottaro
ok, now i'm confused. i'm looking at some pretty popular linux projects (KDE) and in their makefiles (generated by automake/autoconf) the command lines of the rules are pretty big shell scripts (complete with for loops to do recursive makes). this seems to be pretty much the standard way to do

Re: export not working...

2004-01-21 Thread Steve Byan
On Jan 21, 2004, at 11:14 AM, Christopher J Bottaro wrote: on another note, how would one do a recursive make clean without using a shell for loop? right now i have it like this: clean: @for d in $(SUBDIRS); do \ cd $dd && $(MAKE) clean || exit 1; \ done but what

Re: export not working...

2004-01-21 Thread Paul D. Smith
%% Christopher J Bottaro <[EMAIL PROTECTED]> writes: cjb> hmm, how about if i do this then... cjb> $(SUBDIRS): cjb> ifeq($(ARCH),LINUX) cjb> export MYVAR = DEBUG cjb> endif cjb> cd $@ && $(MAKE) cjb> that doesn't work either. make says "commands commence before cjb> first target

Re: export not working...

2004-01-21 Thread Greg Chicares
Christopher J Bottaro wrote: > > hmm, how about if i do this then... > > $(SUBDIRS): > ifeq($(ARCH),LINUX) > export MYVAR = DEBUG > endif > cd $@ && $(MAKE) Try this instead: ifeq ($(ARCH),LINUX) export MYVAR = DEBUG endif $(SUBDIRS): cd $@ && $(MAKE) > that doesn't work eit

Re: export not working...

2004-01-21 Thread Noel Yap
Christopher J Bottaro wrote: > on another note, how would one do a recursive make clean without using a shell > for loop? right now i have it like this: > > clean: > @for d in $(SUBDIRS); do \ > cd $dd && $(MAKE) clean || exit 1; \ > done > > but what is the "corr

Re: export not working...

2004-01-21 Thread Christopher J Bottaro
hmm, how about if i do this then... $(SUBDIRS): ifeq($(ARCH),LINUX) export MYVAR = DEBUG endif cd $@ && $(MAKE) that doesn't work either. make says "commands commence before first target". what am i doing wrong? the make syntax is not tabbed, only the command is... on another note, h

Re: export not working...

2004-01-21 Thread Noel Yap
Yakov Lerner wrote: > You need to rewrite it so that export is within same shell command > as $(MAKE). Then it will work: > > $(SUBDIRS): > @if [ $(ARCH) = LINUX ]; then \ > export MYVAR=DEBUG; \ > fi; \ > cd $@ && $(MAKE) I think having the if logic perfor

Re: export not working...

2004-01-21 Thread Yakov Lerner
Christopher J Bottaro wrote: i'm trying to do a recursive make, but the variables i export are not being seen by the sub makes. SUBDIRS = blah... $(SUBDIRS): @if [ $(ARCH) = LINUX ]; then \ export MYVAR = DEBUG; \ fi cd $@ && $(MAKE) when the sub make runs

Re: export not working...

2004-01-20 Thread Paul D. Smith
%% Christopher J Bottaro <[EMAIL PROTECTED]> writes: cjb> i'm trying to do a recursive make, but the variables i export are cjb> not being seen by the sub makes. cjb> SUBDIRS = blah... cjb> $(SUBDIRS): cjb> @if [ $(ARCH) = LINUX ]; then \ cjb> export MYVAR = DEBUG; \ cjb>

export not working...

2004-01-20 Thread Christopher J Bottaro
i'm trying to do a recursive make, but the variables i export are not being seen by the sub makes. SUBDIRS = blah... $(SUBDIRS): @if [ $(ARCH) = LINUX ]; then \ export MYVAR = DEBUG; \ fi cd $@ && $(MAKE) when the sub make runs, MYVAR is not defined. wha