diff options
[IPL/T] Added unfinished makefile and frontend
1 files changed, 37 insertions, 0 deletions
| -rw-r--r-- | Year 2/Implementation of Programming Languages/Transpiler/Makefile | 37 |
diff --git a/Year 2/Implementation of Programming Languages/Transpiler/Makefile b/Year 2/Implementation of Programming Languages/Transpiler/Makefile new file mode 100644 index 0000000..52c45ab --- /dev/null +++ b/Year 2/Implementation of Programming Languages/Transpiler/Makefile @@ -0,0 +1,37 @@ +CC=gcc +CFLAGS= +CXX=g++ +CXXFLAGS= +LEX=flex +YACC=bison + +.PHONY: all +all: build-frontend run-frontend build-transpiler run-transpiler + +.PHONY: build-frontend +build-frontend: build-parser build-lexer + cd build && $(CC) lex.yy.c commonlisp2transpilerstr.tab.c $(CFLAGS) -o frontend.out + +.PHONY: build-lexer +build-lexer: + cd frontend && $(LEX) commonlisp2transpilerstr.l && mkdir -p ../build/ && mv lex.yy.c ../build/ + +.PHONY: build-parser +build-parser: + cd frontend && $(YACC) commonlisp2transpilerstr.y && mkdir -p ../build/ && mv commonlisp2transpilerstr.tab.c ../build/ + +.PHONY: run-frontend +run-frontend: + cd build/ && frontend.out < ../src.cl >> CLtree.h + +.PHONY: build-transpiler +build-transpiler: + cd src/ && $(CXX) *.cpp */*.cpp $(CXXFLAGS) -o cltranspiler.out && mkdir -p ../build/ && mv cltranspiler.out ../build/ + +.PHONY: run-transpiler +run-transpiler: + cd build/ && ./cltranspiler.out && mv transpiled.ll .. + +.PHONY: tests +tests: + cd tests && $(CXX) 'Tests_ALL.cpp' ../src/*/*.cpp $(CXXFLAGS) && ./a.out |
