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]

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

Thanks for any help,

Harold


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