aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile22
1 files changed, 11 insertions, 11 deletions
diff --git a/makefile b/makefile
index 1a6f2f1..e1d43cc 100644
--- a/makefile
+++ b/makefile
@@ -1,6 +1,6 @@
1#### PROJECT SETTINGS #### 1#### PROJECT SETTINGS ####
2# The name of the executable to be created 2# The name of the executable to be created
3BIN_NAME := moonp 3BIN_NAME := yue
4# Compiler used 4# Compiler used
5CXX ?= g++ 5CXX ?= g++
6# Extension of source files used in the project 6# Extension of source files used in the project
@@ -42,10 +42,10 @@ TEST_OUTPUT = ./spec/outputs
42UNAME_S:=$(shell uname -s) 42UNAME_S:=$(shell uname -s)
43 43
44ifeq ($(NO_LUA),true) 44ifeq ($(NO_LUA),true)
45 COMPILE_FLAGS += -DMOONP_NO_MACRO -DMOONP_COMPILER_ONLY 45 COMPILE_FLAGS += -DYUE_NO_MACRO -DYUE_COMPILER_ONLY
46else 46else
47ifeq ($(NO_MACRO),true) 47ifeq ($(NO_MACRO),true)
48 COMPILE_FLAGS += -DMOONP_NO_MACRO 48 COMPILE_FLAGS += -DYUE_NO_MACRO
49endif 49endif
50 INCLUDES += -I ./src/lua 50 INCLUDES += -I ./src/lua
51 LINK_FLAGS += -L ./src/lua -llua -ldl 51 LINK_FLAGS += -L ./src/lua -llua -ldl
@@ -117,7 +117,7 @@ ifeq ($(SOURCES),)
117endif 117endif
118 118
119ifeq ($(NO_LUA),true) 119ifeq ($(NO_LUA),true)
120 SOURCES := $(filter-out ./src/MoonP/moonplus.cpp, $(SOURCES)) 120 SOURCES := $(filter-out ./src/yuescript/yue.cpp, $(SOURCES))
121endif 121endif
122 122
123# Set the object file names, with the source directory stripped 123# Set the object file names, with the source directory stripped
@@ -199,7 +199,7 @@ endif
199 @echo -n "Total build time: " 199 @echo -n "Total build time: "
200 @$(END_TIME) 200 @$(END_TIME)
201 201
202$(BUILD_PATH)/moonp.so: src/MoonP/ast.cpp src/MoonP/moon_compiler.cpp src/MoonP/moon_parser.cpp src/MoonP/moonplus.cpp src/MoonP/parser.cpp 202$(BUILD_PATH)/yue.so: src/yuescript/ast.cpp src/yuescript/yue_compiler.cpp src/yuescript/yue_parser.cpp src/yuescript/yue.cpp src/yuescript/parser.cpp
203 $(CMD_PREFIX)$(CXX) $(CXXFLAGS) -I $(SRC_PATH) -I $(LUAI) -L $(LUAL) -llua -o $@ -fPIC -shared $? 203 $(CMD_PREFIX)$(CXX) $(CXXFLAGS) -I $(SRC_PATH) -I $(LUAI) -L $(LUAL) -llua -o $@ -fPIC -shared $?
204 204
205# Standard, non-optimized release build 205# Standard, non-optimized release build
@@ -211,10 +211,10 @@ else
211 @echo "Beginning release build" 211 @echo "Beginning release build"
212endif 212endif
213 @$(START_TIME) 213 @$(START_TIME)
214 @$(MAKE) $(BUILD_PATH)/moonp.so --no-print-directory 214 @$(MAKE) $(BUILD_PATH)/yue.so --no-print-directory
215 @echo -n "Total build time: " 215 @echo -n "Total build time: "
216 @$(END_TIME) 216 @$(END_TIME)
217 @mv $(BUILD_PATH)/moonp.so $(BIN_PATH)/moonp.so 217 @mv $(BUILD_PATH)/yue.so $(BIN_PATH)/yue.so
218 218
219# Create the directories used in the build 219# Create the directories used in the build
220.PHONY: dirs 220.PHONY: dirs
@@ -248,13 +248,13 @@ clean:
248 @echo "Deleting generated Lua codes" 248 @echo "Deleting generated Lua codes"
249 @$(RM) -r $(TEST_OUTPUT) 249 @$(RM) -r $(TEST_OUTPUT)
250 250
251# Test Moonscript compiler 251# Test Yuescript compiler
252.PHONY: test 252.PHONY: test
253test: debug 253test: release
254 @echo "Compiling Moonscript codes..." 254 @echo "Compiling Yuescript codes..."
255 @$(START_TIME) 255 @$(START_TIME)
256 @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) -tl_enabled=true 256 @./$(BIN_NAME) $(TEST_INPUT) -t $(TEST_OUTPUT) -tl_enabled=true
257 @./$(BIN_NAME) $(TEST_INPUT)/teal-lang.mp -o $(TEST_OUTPUT)/teal-lang.lua 257 @./$(BIN_NAME) $(TEST_INPUT)/teal-lang.yue -o $(TEST_OUTPUT)/teal-lang.lua
258 @echo -en "Compile time: " 258 @echo -en "Compile time: "
259 @$(END_TIME) 259 @$(END_TIME)
260 260