• 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: Groups, shell scripts, yacc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Groups, shell scripts, yacc


  • Subject: Re: Groups, shell scripts, yacc
  • From: Glen Low <email@hidden>
  • Date: Sun, 23 Nov 2003 06:26:22 +0800

Olger:

The following works for me:
Open the info panel for your target and (rules tab):
Under rules add a new rule (the + button down in the screen)
As file type you choose Yacc source files
using: Custom Script
The custom script is as follows:
cd "$(DERIVED_FILE_DIR)/Yacc" && /usr/bin/bison -y -p eval -l -d -v "$(INPUT_FILE_PATH)" -o yourCfileName.c


The output files should contain:
$(DERIVED_FILE_DIR)/Yacc/yourCfileName.h
$(DERIVED_FILE_DIR)/Yacc/yourCfileName.c

Now the build tab:

HEADER_SEARCH_PATHS = " $(DERIVED_FILES_DIR)/Yacc" (this is the Header search paths item)

Yes I've done something similar, the only real difference is that I use $(INPUT_FILE_BASE) to derive the output file so that it's flexible enough to work with different yacc files, and the header search path doesn't need to be amended if I send the results to just $(DERIVED_FILE_DIR). Strangely enough, both $(DERIVED_FILE_DIR) and $(DERIVED_FILES_DIR) work.


The build rules has the potential to be a kind of simple makefile replacement. You can also match on a regular expression on your sources to run script, the only thing I can't quite figure out is whether Xcode does a proper dependency analysis for the generated files -- e.g. if yacc generates a header that is later used by some other source, does it know to generate yacc first and then compile the other source? I can't quite tell yet, but it doesn't seem to work with the regular expression match.


Cheers, Glen Low


--- pixelglow software | simply brilliant stuff www.pixelglow.com _______________________________________________ xcode-users mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Groups, shell scripts, yacc
      • From: Glen Low <email@hidden>
References: 
 >Groups, shell scripts, yacc (From: Glen Low <email@hidden>)
 >Re: Groups, shell scripts, yacc (From: Scott Tooker <email@hidden>)
 >Re: Groups, shell scripts, yacc (From: Glen Low <email@hidden>)
 >Re: Groups, shell scripts, yacc (From: Olger Warnier <email@hidden>)

  • Prev by Date: New Custom executables crash
  • Next by Date: Re: Turning off spurious C warning in XCode ?
  • Previous by thread: Re: Groups, shell scripts, yacc
  • Next by thread: Re: Groups, shell scripts, yacc
  • Index(es):
    • Date
    • Thread