Re: How to add Makerules in xcode 2 ?
Re: How to add Makerules in xcode 2 ?
- Subject: Re: How to add Makerules in xcode 2 ?
- From: Chris Hanson <email@hidden>
- Date: Wed, 11 May 2005 18:38:11 -0700
On May 11, 2005, at 8:16 AM, Ronald Rood wrote:
I am trying to get my oracle pro*c project into xcode. Now I need
an extra
precompiler phase to convert the *.pc files to normal *.c files.
How can I
add such a rule in xcode ? (and select the proc pre compiler to do
this
task)
You can create a build rule for these files in your target that does
the work automatically.
First, Get Info on your target and choose the Rules tab. Click the +
at the bottom of the window to add a new rule. Configure the rule to
process source files with names matching "*.pc" (without quotes)
using a custom script. Type a /bin/sh shell script into this text
view to process a single input file into a single output file (see
below). Finally, click the round plus button underneath the "with
output files:" area to add an output file, and type "$
(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).c" (without quotes).
The shell script that you enter into the rule is run in your
project's directory with an environment similar to that of a shell
script build phase, with some additional environment variables.
Useful ones are:
INPUT_FILE_PATH is the path to your input file (e.g. /My/Project/
foo.pc)
INPUT_FILE_BASE is the base name of your input file (e.g. foo)
DERIVED_FILES_DIR is the directory derived source files should
wind up in
(You can see all of the environment variables set for your script by
running a full build, and then bringing up the Build Results window
and showing the Build Transcript.)
Then you just make sure your "*.pc" files are members of your
target's Compile Sources build phase, and Xcode should run your
script on them and then do whatever's appropriate with the derived
output (e.g. compile it using the compiler specified in the System C
rule).
This is all documented at <file:///Developer/ADC Reference%
20Library/documentation/DeveloperTools/Conceptual/XcodeUserGuide20/
Contents/Resources/en.lproj/bs_build_phases/
chapter_30_section_10.html>. You can also see this by clicking the
round question-mark help button in the lower-right corner of a
target's info window with the Rules tab chosen.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden