This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
RE: xc/config/cf/cygwin.rules - ComplexProgramTarget_1
- To: "'Harold Hunt'" <huntharo at msu dot edu>, "'cygx'" <cygwin-xfree at cygwin dot com>
- Subject: RE: xc/config/cf/cygwin.rules - ComplexProgramTarget_1
- From: Suhaib Siddiqi <ssiddiqi at inspirepharm dot com>
- Date: Thu, 16 Aug 2001 07:28:55 -0400
> -----Original Message-----
> From: Harold Hunt [mailto:huntharo@msu.edu]
> Sent: Wednesday, August 15, 2001 9:58 PM
> To: cygx
> Subject: xc/config/cf/cygwin.rules - ComplexProgramTarget_1
>
>
> ComplexProgramTarget_1 is supposed to generate an all::
> dependency for each program being built from
> ComplexProgramTarget_1 through ComplexProgramTarget_10
> (actually, the current Cygwin rules only do 1 through 3).
> Currently, ComplexProgramTarget_1 does this with:
> AllTarget($(PROGRAM1) $(PROGRAM2) $(PROGRAM3))
>
> PROGRAM2 and PROGRAM3 are defined by ComplexProgramTarget_2
> and _3 as ProgramTargetName(program), which appends .exe to
> the program target name. However, PROGRAM2 and PROGRAM3 are
> not defined until the ComplexProgramTarget_2 and _3 rules are
> processed;
I do not understand.... what do you mean by PROGRAM2 and PROGRAM3 are not
defined?
>the end effect is that program 2 and program 3 are
> not built until the 'install' phase of make, rather than
> during the 'World' phase, as on all other platforms.
>
> I'd like to fix the ComplexProgramTarget rules, if for no
> other reason than to learn a little about Imake and awk. The
> approach I see to fixing the problem goes like this:
>
> 1) Break up the PROGRAMS variable (e.g. 'xclipboard, xcutsel')
> 2) Append .exe to each program name in the PROGRAMS variable
> (e.g. 'xclipboard.exe xcutsel.exe')
> 3) Store the doctored program names in a PROGRAMS_EXE variable
> 4) Change the all:: dependency to AllTarget($(PROGRAMS_EXE))
>
>
> I can do steps 1, 2, and 4, but I do not know how to get the
> output of awk back into an Imake variable. Here's the
> command I've got in ComplexProgramTarget_1 to output the
> doctored PROGRAM data to the console during the build:
>
> all:: @@\
> echo $(PROGRAMS) | awk '{i = 1; while ($$i != "")
> {printf ("%s.exe ", $$i);
> ++i;}}' @@\
>
>
> I'm stuck at that point. I'm open to an entirely different
> approach, but I'd also like to know how to get the output of
> that command into an Imake variable, for future reference.
You cannot do that. Imake is a wrapper to cpp and you cannot shell out of
cpp.
Suhaib
>
> Thanks for any help,
>
> Harold
>