mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-02 19:00:47 +08:00
🚀 switch build script to new nasal
This commit is contained in:
154
makefile
154
makefile
@@ -1,79 +1,8 @@
|
||||
.PHONY:test clean
|
||||
|
||||
SRC=\
|
||||
main.cpp\
|
||||
nasal_ast.h\
|
||||
nasal_err.h\
|
||||
nasal_builtin.h\
|
||||
nasal_opcode.h\
|
||||
nasal_opt.h\
|
||||
nasal_codegen.h\
|
||||
nasal_gc.h\
|
||||
nasal_import.h\
|
||||
nasal_lexer.h\
|
||||
nasal_parse.h\
|
||||
nasal_vm.h\
|
||||
nasal_dbg.h\
|
||||
nasal.h
|
||||
|
||||
STD=c++17
|
||||
|
||||
nasal:$(SRC)
|
||||
$(CXX) -std=$(STD) -O3 main.cpp -o nasal -fno-exceptions -ldl -Wshadow -Wall
|
||||
|
||||
nasal.exe:$(SRC)
|
||||
$(CXX) -std=$(STD) -O3 main.cpp -o nasal.exe -fno-exceptions -Wshadow -Wall -static
|
||||
|
||||
stable-release:$(SRC)
|
||||
$(CXX) -std=$(STD) -O2 main.cpp -o nasal -fno-exceptions -ldl -Wshadow -Wall
|
||||
|
||||
stable-release-mingw:$(SRC)
|
||||
$(CXX) -std=$(STD) -O2 main.cpp -o nasal.exe -fno-exceptions -Wshadow -Wall -static
|
||||
|
||||
clean:
|
||||
@ echo "[clean] nasal" && if [ -e nasal ]; then rm nasal; fi
|
||||
@ echo "[clean] nasal.exe" && if [ -e nasal.exe ]; then rm nasal.exe; fi
|
||||
|
||||
test:nasal
|
||||
@ ./nasal -e test/ascii-art.nas
|
||||
@ ./nasal -t -d test/bfs.nas
|
||||
@ ./nasal -t test/bigloop.nas
|
||||
@ ./nasal -t test/bp.nas
|
||||
@ ./nasal -d test/calc.nas
|
||||
@ ./nasal -e test/choice.nas
|
||||
@ ./nasal -e test/class.nas
|
||||
@ ./nasal -t -d test/console3D.nas 20
|
||||
@ ./nasal -e test/coroutine.nas
|
||||
@ ./nasal -t -d test/datalog.nas
|
||||
@ ./nasal -e test/diff.nas
|
||||
@ ./nasal -e test/donuts.nas 15
|
||||
-@ ./nasal -d test/exception.nas
|
||||
@ ./nasal -t -d test/fib.nas
|
||||
@ ./nasal -e test/filesystem.nas
|
||||
@ ./nasal -d test/hexdump.nas
|
||||
@ ./nasal -e test/json.nas
|
||||
@ ./nasal -e test/leetcode1319.nas
|
||||
@ ./nasal -d test/lexer.nas
|
||||
@ ./nasal -d test/life.nas
|
||||
@ ./nasal -t test/loop.nas
|
||||
@ ./nasal -t test/mandelbrot.nas
|
||||
@ ./nasal -t test/md5.nas
|
||||
@ ./nasal -t -d test/md5compare.nas
|
||||
@ ./nasal -d test/module_test.nas
|
||||
@ ./nasal -e test/nasal_test.nas
|
||||
@ ./nasal -t -d test/occupation.nas 2
|
||||
@ ./nasal -t -d test/pi.nas
|
||||
@ ./nasal -t -d test/prime.nas
|
||||
@ ./nasal -e test/qrcode.nas
|
||||
@ ./nasal -t -d test/quick_sort.nas
|
||||
@ ./nasal -e test/scalar.nas hello world
|
||||
@ ./nasal -e test/trait.nas
|
||||
@ ./nasal -t -d test/turingmachine.nas
|
||||
@ ./nasal -d test/wavecollapse.nas
|
||||
@ ./nasal test/word_collector.nas test/md5compare.nas
|
||||
@ ./nasal -t -d test/ycombinator.nas
|
||||
|
||||
NASAL_NEW_AST=\
|
||||
NASAL_OBJECT=\
|
||||
nasal_new_err.o\
|
||||
nasal_new_ast.o\
|
||||
ast_visitor.o\
|
||||
@@ -93,11 +22,11 @@ NASAL_NEW_AST=\
|
||||
nasal_new_main.o
|
||||
|
||||
# for test
|
||||
nnew: $(NASAL_NEW_AST)
|
||||
$(CXX) $(NASAL_NEW_AST) -O3 -o nnew -ldl
|
||||
nasal: $(NASAL_OBJECT)
|
||||
$(CXX) $(NASAL_OBJECT) -O3 -o nasal -ldl
|
||||
|
||||
nnew.exe: $(NASAL_NEW_AST)
|
||||
$(CXX) $(NASAL_NEW_AST) -O3 -o nnew.exe
|
||||
nasal.exe: $(NASAL_OBJECT)
|
||||
$(CXX) $(NASAL_OBJECT) -O3 -o nasal.exe
|
||||
|
||||
nasal_new_main.o: src/nasal_new_main.cpp
|
||||
$(CXX) -std=$(STD) -c -O3 src/nasal_new_main.cpp -fno-exceptions -fPIC -o nasal_new_main.o -I .
|
||||
@@ -152,4 +81,75 @@ nasal_new_dbg.o: src/nasal_new_dbg.h src/nasal_new_dbg.cpp
|
||||
|
||||
.PHONY: nasal_new_clean
|
||||
nasal_new_clean:
|
||||
rm $(NASAL_NEW_AST)
|
||||
rm $(NASAL_OBJECT)
|
||||
|
||||
SRC=\
|
||||
main.cpp\
|
||||
nasal_ast.h\
|
||||
nasal_err.h\
|
||||
nasal_builtin.h\
|
||||
nasal_opcode.h\
|
||||
nasal_opt.h\
|
||||
nasal_codegen.h\
|
||||
nasal_gc.h\
|
||||
nasal_import.h\
|
||||
nasal_lexer.h\
|
||||
nasal_parse.h\
|
||||
nasal_vm.h\
|
||||
nasal_dbg.h\
|
||||
nasal.h
|
||||
|
||||
nasal_old:$(SRC)
|
||||
$(CXX) -std=$(STD) -O3 main.cpp -o nasal_old -fno-exceptions -ldl -Wshadow -Wall
|
||||
|
||||
nasal_old.exe:$(SRC)
|
||||
$(CXX) -std=$(STD) -O3 main.cpp -o nasal_old.exe -fno-exceptions -Wshadow -Wall -static
|
||||
|
||||
stable-release:$(SRC)
|
||||
$(CXX) -std=$(STD) -O2 main.cpp -o nasal_old -fno-exceptions -ldl -Wshadow -Wall
|
||||
|
||||
stable-release-mingw:$(SRC)
|
||||
$(CXX) -std=$(STD) -O2 main.cpp -o nasal_old.exe -fno-exceptions -Wshadow -Wall -static
|
||||
|
||||
clean:
|
||||
@ echo "[clean] nasal" && if [ -e nasal ]; then rm nasal; fi
|
||||
@ echo "[clean] nasal.exe" && if [ -e nasal.exe ]; then rm nasal.exe; fi
|
||||
|
||||
test:nasal
|
||||
@ ./nasal -e test/ascii-art.nas
|
||||
@ ./nasal -t -d test/bfs.nas
|
||||
@ ./nasal -t test/bigloop.nas
|
||||
@ ./nasal -t test/bp.nas
|
||||
@ ./nasal -d test/calc.nas
|
||||
@ ./nasal -e test/choice.nas
|
||||
@ ./nasal -e test/class.nas
|
||||
@ ./nasal -t -d test/console3D.nas 20
|
||||
@ ./nasal -e test/coroutine.nas
|
||||
@ ./nasal -t -d test/datalog.nas
|
||||
@ ./nasal -e test/diff.nas
|
||||
@ ./nasal -e test/donuts.nas 15
|
||||
-@ ./nasal -d test/exception.nas
|
||||
@ ./nasal -t -d test/fib.nas
|
||||
@ ./nasal -e test/filesystem.nas
|
||||
@ ./nasal -d test/hexdump.nas
|
||||
@ ./nasal -e test/json.nas
|
||||
@ ./nasal -e test/leetcode1319.nas
|
||||
@ ./nasal -d test/lexer.nas
|
||||
@ ./nasal -d test/life.nas
|
||||
@ ./nasal -t test/loop.nas
|
||||
@ ./nasal -t test/mandelbrot.nas
|
||||
@ ./nasal -t test/md5.nas
|
||||
@ ./nasal -t -d test/md5compare.nas
|
||||
@ ./nasal -d test/module_test.nas
|
||||
@ ./nasal -e test/nasal_test.nas
|
||||
@ ./nasal -t -d test/occupation.nas 2
|
||||
@ ./nasal -t -d test/pi.nas
|
||||
@ ./nasal -t -d test/prime.nas
|
||||
@ ./nasal -e test/qrcode.nas
|
||||
@ ./nasal -t -d test/quick_sort.nas
|
||||
@ ./nasal -e test/scalar.nas hello world
|
||||
@ ./nasal -e test/trait.nas
|
||||
@ ./nasal -t -d test/turingmachine.nas
|
||||
@ ./nasal -d test/wavecollapse.nas
|
||||
@ ./nasal test/word_collector.nas test/md5compare.nas
|
||||
@ ./nasal -t -d test/ycombinator.nas
|
||||
Reference in New Issue
Block a user