Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Implementation of Programming Languages / Homework 02 / Makefile
diff options
context:
space:
mode:
Commit84d20dfee4af531c7e5c77335cc48778cf3f24e3 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-11-17 00:00:52 +0200
Committer
 Syndamia <kamen@syndamia.com>
2022-11-17 00:00:52 +0200
Filesc10205aea9e2b57eaaf6a6e32cf9f0fd1a2a57bd /Year 2/Implementation of Programming Languages/Homework 02/Makefile
uni-projects-84d20dfee4af531c7e5c77335cc48778cf3f24e3.tar
uni-projects-84d20dfee4af531c7e5c77335cc48778cf3f24e3.tar.gz
uni-projects-84d20dfee4af531c7e5c77335cc48778cf3f24e3.zip
Parent7f7d0d4676813a52bf69b807d8b8189d16f64ac0 (diff)
[IPL/HW02] Replaced lexer.sh script with a Makefile
1 files changed, 31 insertions, 0 deletions
-rw-r--r--Year 2/Implementation of Programming Languages/Homework 02/Makefile31
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