Re: Custom build rule always rebuilding
Re: Custom build rule always rebuilding
- Subject: Re: Custom build rule always rebuilding
- From: James Bucanek <email@hidden>
- Date: Tue, 7 Mar 2006 09:48:14 -0700
Mark Lentczner wrote on Tuesday, March 7, 2006:
>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
If I remember how yacc works (and it's been awhile, let me tell you), the -d option combined with the -o option will cause yacc to produce
$(INPUT_FILE_BASE).y.h
not
$(INPUT_FILE_BASE).h
Since no $(INPUT_FILE_BASE).h file ever exists, the rule gets triggered every time. Try changing the output file to $(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).y.h and see if that fixes it.
Since you don't actually process the .y.h file that get produced (i.e. the .h file is processed by any subsequent rules or build phases), you could probably get away with simply omitting the .h file from the list of output files.
James Bucanek
____________________________________________________________________
Author of Beginning Xcode ISBN: 047175479X
<http://www.beginningxcode.com/> Available April 3rd, 2006
_______________________________________________
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