ProjectBuilder and intermediate files
ProjectBuilder and intermediate files
- Subject: ProjectBuilder and intermediate files
- From: "Simson Garfinkel" <email@hidden>
- Date: Wed, 28 Nov 2001 10:44:34 -0500
Greetings. I have a target with Project Builder that is a "Tool." The target
is based on a lex input file called "rules.l" and a yacc input file called
"grammar.y. " (I would rather call the first file rules.lex, but Apple
chose.l instead of .lex.)
lex processes rules.l to create lex.yy.c. This file includes the file
y.tab.h, which is produced when yacc runs over grammar.y.
The problem here, of course, is that Project Builder doesn't know about this
dependence, and it is trying to compile lex.yy.c before it attempts to run
yacc over grammary.y.
This is a pretty simple dependency to code with Make. The Makefile looks
like this:
CFLAGS = -g
Evaluator: y.tab.c lex.yy.c
cc $(CFLAGS) -o Evaluator y.tab.c lex.yy.c -ly -ll -lm
install: Evaluator
strip Evaluator
cp Evaluator $(HOME)/Apps
clean:
/bin/rm -f Evaluator lex.yy.c y.tab.?
lex.yy.c: rules.lex y.tab.h
lex rules.lex
y.tab.h: grammar.y
yacc -d grammar.y
y.tab.c: grammar.y
yacc grammar.y
I haven't figured out how to code dependencies in ProjectBuilder, and I
haven't found it in the documentation.
Anybody know how to do this?