From 84d20dfee4af531c7e5c77335cc48778cf3f24e3 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 17 Nov 2022 00:00:52 +0200 Subject: [IPL/HW02] Replaced lexer.sh script with a Makefile --- .../Homework 02/Makefile | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Year 2/Implementation of Programming Languages/Homework 02/Makefile (limited to 'Year 2/Implementation of Programming Languages/Homework 02/Makefile') diff --git a/Year 2/Implementation of Programming Languages/Homework 02/Makefile b/Year 2/Implementation of Programming Languages/Homework 02/Makefile new file mode 100644 index 0000000..91f0182 --- /dev/null +++ b/Year 2/Implementation of Programming Languages/Homework 02/Makefile @@ -0,0 +1,31 @@ +in="example.lisp" +out="highlighted.html" + +CC=gcc +CFLAGS=-lfl -g +LEX=flex +YACC=bison -t -d + +.PHONY: all +all: build-all webpage + +.PHONY: webpage +webpage: + cat ./page_top.html > $(out) + ./a.out < $(in) >> $(out) + cat ./page_bottom.html >> $(out) + +build-all: build-bison build-flex + $(CC) lex.yy.c commonlisp2html.tab.c $(CFLAGS) + +.PHONY: build-flex +build-flex: commonlisp2html.l + $(LEX) commonlisp2html.l + +.PHONY: build-bison +build-bison: commonlisp2html.y + $(YACC) commonlisp2html.y + +.PHONY: clean +clean: + rm -f a.out *.tab.* lex.yy.c -- cgit v1.3.1-26-gb76a