Makefile: For building Flex/Bison template
Posted 08-19-2017 at 03:16 AM by astrogeek
Flex / Bison Project Template, project Makefile.
Save this make source to a file named Makefile in the same directory with lexer and parser source files. The build targets are described in the template project README file.
To build a working parser simply run make in the project directory.
To generate a graph of the parser and display it in an X11 window, run make dotx11.
Save this make source to a file named Makefile in the same directory with lexer and parser source files. The build targets are described in the template project README file.
To build a working parser simply run make in the project directory.
To generate a graph of the parser and display it in an X11 window, run make dotx11.
Code:
#A simple makefile for building Flex / Bison template fbproject: fbproject.y fbproject.l fbproject.tab.h lex.yy.c gcc -g -Wall -o fbproject lex.yy.c fbproject.tab.c -lfl lex.yy.c: fbproject.l fbproject.tab.h flex fbproject.l fbproject.tab.h: fbproject.y bison -vd fbproject.y #The dot target creates fbproject.dot graphviz graph #To generate PNG run dot -Tpng fbproject.dot dotx11: dot dot -Tx11 fbproject.dot & dotpng: dot dot -Tpng fbproject.dot >fbproject.png dot: fbproject.y bison -vd fbproject.y --graph clean: rm -f fbproject fbproject.lex.h fbproject.tab.* fbproject.dot fbproject.png lex.yy.c fbproject.output
Total Comments 0