I am currently working on a simple compiler using flex and bison. folder structure : MainFolder --> src --> Compiler which has the following files add_inp.flex, bison.y main.c and a stack.c Basically when I run individually they compile fine and produce the following files flex produce lex.yy.c and bison produces add_inp.tab.c & add_inp.tab.h the following is my GNUmake file
lex.yy.c: src/dplc/add_inp.flex bison.tab.c src/dplc/bison.tab.h
flex src/dplc/add_inp.flex
bison.tab.c: src/dplc/bison.y
bison -d -t src/dplc/bison.y
a.exe: src/dplc/main.c lex.yy.c bison.tab.c
gcc src/dplc/main.c
clean:
rm src/dplc/bison.tab.c src/dplc/bison.tab.h src/dplc/lex.yy.c src/dplc/a.exe
I get this error
make: *** No rule to make target `src/dplc/bison.y', needed by `bison.tab.c'. Stop.
if I have not compiled the the flex and bison programs individually :
make: *** No rule to make target `src/dplc/bison.y', needed by `bison.tab.c'. Stop.
I appreciate any help on this Also I need to do Build as well for these programs to run along with the Executor written in Java can someone please give in some suggeston on how I could get that done?
src/dplc/bison.y
present from the directory you are trying to runmake
? – another.anon.cowardmake
can't findsrc/dplc/bison.y
, which is needed to createbison.tab.c
– Chris Dodd