From b6725202f4a8cac5f829dac9a72a81f3ff73e787 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 21 Oct 2020 23:44:50 +0800 Subject: extend macro feature to support compiling Moonscript to other Lua dialect like teal. add examples for how to write MoonPlus codes that compile to teal. fix C++ macro to build without MoonPlus macro feature or built-in Lua. add support for passing arguments from command line to compiler that can be accessed or altered by "require('moonp').options". --- makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'makefile') diff --git a/makefile b/makefile index 70d6c97..38738e2 100644 --- a/makefile +++ b/makefile @@ -41,6 +41,15 @@ TEST_OUTPUT = ./spec/outputs # Obtains the OS type, either 'Darwin' (OS X) or 'Linux' UNAME_S:=$(shell uname -s) +ifeq ($(NO_LUA),true) + COMPILE_FLAGS += -DMOONP_NO_MACRO + COMPILE_FLAGS += -DMOONP_COMPILER_ONLY +else +ifeq ($(NO_MACRO),true) + COMPILE_FLAGS += -DMOONP_NO_MACRO +endif +endif + # Add platform related linker flag ifneq ($(UNAME_S),Darwin) LINK_FLAGS += -lstdc++fs @@ -235,7 +244,8 @@ clean: test: debug @echo "Compiling Moonscript codes..." @$(START_TIME) - @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) + @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) -tl_enabled=true + @./$(BIN_NAME) $(TEST_INPUT)/teal-lang.mp -o $(TEST_OUTPUT)/teal-lang.lua @echo -en "Compile time: " @$(END_TIME) -- cgit v1.2.3-55-g6feb