# generate parse executable from parse.y and scan.l CC = gcc -std=c11 -pedantic -Wall -g -lm OBJS = scan.o parse.o # comment out parse.o for standalone scan.l parse: $(OBJS) @rm -f parse $(CC) -o parse $(OBJS) $(LIBS) $(OBJS): Makefile parse.h # comment out parse.h for standalone scan.l LIBS = # -lfl # uncomment for standalone scan.l parse.c parse.h: parse.y Makefile bison -v -d -o parse.c parse.y # -t to enable debug scan.c: scan.l Makefile flex -t scan.l >scan.c # -d to enable debug TMPS = scan.c parse.c parse.h parse.output clean: rm -f a.out core .class $(OBJS) $(TMPS) parse