diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-10-21 23:44:50 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-10-21 23:44:50 +0800 |
| commit | b6725202f4a8cac5f829dac9a72a81f3ff73e787 (patch) | |
| tree | c173accb869b60cba14babc7685284864bc80426 /makefile | |
| parent | 0777356cbe599b3f88bdfa476e3ffa64bb3a3a8c (diff) | |
| download | yuescript-b6725202f4a8cac5f829dac9a72a81f3ff73e787.tar.gz yuescript-b6725202f4a8cac5f829dac9a72a81f3ff73e787.tar.bz2 yuescript-b6725202f4a8cac5f829dac9a72a81f3ff73e787.zip | |
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".
Diffstat (limited to 'makefile')
| -rw-r--r-- | makefile | 12 |
1 files changed, 11 insertions, 1 deletions
| @@ -41,6 +41,15 @@ TEST_OUTPUT = ./spec/outputs | |||
| 41 | # Obtains the OS type, either 'Darwin' (OS X) or 'Linux' | 41 | # Obtains the OS type, either 'Darwin' (OS X) or 'Linux' |
| 42 | UNAME_S:=$(shell uname -s) | 42 | UNAME_S:=$(shell uname -s) |
| 43 | 43 | ||
| 44 | ifeq ($(NO_LUA),true) | ||
| 45 | COMPILE_FLAGS += -DMOONP_NO_MACRO | ||
| 46 | COMPILE_FLAGS += -DMOONP_COMPILER_ONLY | ||
| 47 | else | ||
| 48 | ifeq ($(NO_MACRO),true) | ||
| 49 | COMPILE_FLAGS += -DMOONP_NO_MACRO | ||
| 50 | endif | ||
| 51 | endif | ||
| 52 | |||
| 44 | # Add platform related linker flag | 53 | # Add platform related linker flag |
| 45 | ifneq ($(UNAME_S),Darwin) | 54 | ifneq ($(UNAME_S),Darwin) |
| 46 | LINK_FLAGS += -lstdc++fs | 55 | LINK_FLAGS += -lstdc++fs |
| @@ -235,7 +244,8 @@ clean: | |||
| 235 | test: debug | 244 | test: debug |
| 236 | @echo "Compiling Moonscript codes..." | 245 | @echo "Compiling Moonscript codes..." |
| 237 | @$(START_TIME) | 246 | @$(START_TIME) |
| 238 | @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) | 247 | @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) -tl_enabled=true |
| 248 | @./$(BIN_NAME) $(TEST_INPUT)/teal-lang.mp -o $(TEST_OUTPUT)/teal-lang.lua | ||
| 239 | @echo -en "Compile time: " | 249 | @echo -en "Compile time: " |
| 240 | @$(END_TIME) | 250 | @$(END_TIME) |
| 241 | 251 | ||
