• 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
Custom build rule always rebuilding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom build rule always rebuilding


  • Subject: Custom build rule always rebuilding
  • From: Mark Lentczner <email@hidden>
  • Date: Tue, 7 Mar 2006 07:34:32 -0800

We have a target that builds a static library with custom build rules for yacc and lex files. These are script based build rules with specified output files.

The problem is that they are always triggered on every build, rerunning yacc and lex, even when the .y and .l files are older than either the intermediates or the resulting object files. Alas, this triggered recompilation, and the relinking of the library, which in turn causes the relinking of three applications. Bah!

The rules are:

-- Yacc source files using Script --

Process: Yacc source files
using: Custom script:
/usr/bin/yacc -d -o "${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.y.cpp" "${INPUT_FILE_PATH}"
with output files:
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).y.cpp
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).h


-- Lex source files using Script --

Process: Lex source files
using: Custom script:
/usr/bin/lex -o"${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.l.cpp" "$ {INPUT_FILE_PATH}"
with output files:
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).l.cpp


--------

If I change the scripts to let me know if the inputs are really older, and not touch the outputs if so:

if [ "${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.y.cpp" -ot "$ {INPUT_FILE_PATH}" ]
then
echo yup, the .y file is newer
/usr/bin/yacc -d -o "${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.y.cpp" "${INPUT_FILE_PATH}"
else
echo nope, the .y file is older
fi


Then indeed, I see "nope, the .y file is older" on every run. What is even more odd is that the yacc rule is triggered twice during a universal build (once for each arch), while the lex rule is only triggered once.

Any help on getting this to not trigger and recompile (the application links can be big!) would be a great help.

	- Mark

Mark Lentczner
http://www.ozonehouse.com/mark/
email@hidden


_______________________________________________ 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
  • Follow-Ups:
    • Re: Custom build rule always rebuilding
      • From: James Bucanek <email@hidden>
  • Prev by Date: Re: XCode auto-creates Japanese.lproj?
  • Next by Date: How to add resource files to "Build Resource Manager Resources" phase ?
  • Previous by thread: Re: XCode auto-creates Japanese.lproj?
  • Next by thread: Re: Custom build rule always rebuilding
  • Index(es):
    • Date
    • Thread