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 +++++++++++++++++ .../Homework 02/lexer.sh | 40 ---------------------- 2 files changed, 31 insertions(+), 40 deletions(-) create mode 100644 Year 2/Implementation of Programming Languages/Homework 02/Makefile delete mode 100755 Year 2/Implementation of Programming Languages/Homework 02/lexer.sh (limited to 'Year 2/Implementation of Programming Languages/Homework 02') 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 diff --git a/Year 2/Implementation of Programming Languages/Homework 02/lexer.sh b/Year 2/Implementation of Programming Languages/Homework 02/lexer.sh deleted file mode 100755 index 5a07c15..0000000 --- a/Year 2/Implementation of Programming Languages/Homework 02/lexer.sh +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/bash - -if [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "--help" ]; then - cat << EOF -lexer.sh [-h|-?|--help|-b|-r|-p]