This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xc/config/cf/cygwin.rules - ComplexProgramTarget_1


On Wed, 15 Aug 2001, Harold Hunt wrote:

> 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; 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've noticed this problem. 

What do you mean with PROGRAM2 and PROGRAM3 are not defined. 
ComplexProgramTarget_2 is an imake rule and will be substituted by the
programname. If you have ComplexProgramTarget_2 still in the Makefile (not
the Imakefile) than it's more worse, since ComplexProgramTarget_2 is not 
defined. 

> 
> 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

for gnumake:
	PROGRAMS_EXE=$(foreach prog,$(PROGRAMS),$(prog).exe)


> 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.

I don't think this is possible. Imake is just a wrapper to cpp and afaik,
you can't shell out of cpp.

Tonight I will take a look on the Imakefiles.

bye
	ago
-- 
 Alexander.Gottwald@informatik.tu-chemnitz.de 
 http://www.gotti.org           ICQ: 126018723
 phone: +49 3725 349 80 80	mobile: +49 172 7854017


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]