• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: pre processing problem xcode 2.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pre processing problem xcode 2.1


  • Subject: Re: pre processing problem xcode 2.1
  • From: David Ewing <email@hidden>
  • Date: Tue, 21 Jun 2005 17:09:25 -0600

On Jun 15, 2005, at 1:49 PM, Ronald Rood wrote:

Currently you have two choices:



1) create a build rule that acts on *.pc files using a shell script
2) add a custom shell script to process the *.pc files and then add
the resulting .c files to your target so they get picked up.


Hi Scott,
1) in xcode 2.1 create a standard tools project (commandline tool)
2) in finder copy main.c to main.pc
3) in xcode create an aggregate target main.c
4) create a new rule for source files matching .pc with output files .c
with shell script cat ${INPUT_FILE_NAME} >${INPUT_FILE_BASE).c
5) make the main target depend from main.c

There's a better way to do this:

1) in Xcode 2.1, create a standard tools project (commandline tool)
2) in Xcode, open main.c and do a "Save As" to main.pc
3) Edit the active target, and switch to the "Rules" tab.
4) create a new rule:
Source files with names matching: "*.pc"
Custom script:
cat ${INPUT_FILE_NAME} > ${DERIVED_SOURCES_DIR}/$ {INPUT_FILE_BASE}.c
with output files:
$(DERIVED_SOURCES_DIR)/$(INPUT_FILE_BASE).c
5) build


(Make sure the you use parens/braces as above.)

Doing it all this way means that you don't have to add the generated .c files to your project. Note that this works because files listed in the output get passed back to the build rules. If you output something that Xcode knows how to compile, it'll compile it. Unfortunately, this doesn't work for generated object (.o) files in Xcode 2.1.

Dave


_______________________________________________ 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
References: 
 >Re: pre processing problem xcode 2.1 (From: Ronald Rood <email@hidden>)

  • Prev by Date: Re: Opening "sdef" files as XML
  • Next by Date: Re: Inline assember interferes with #pragma options align
  • Previous by thread: Re: pre processing problem xcode 2.1
  • Next by thread: Re: pre processing problem xcode 2.1
  • Index(es):
    • Date
    • Thread