From f6e603cc5bef133e5e368a81f677bea92bc405b5 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Thu, 22 Oct 2020 00:09:09 +0800 Subject: fix makefile. --- makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index 38738e2..307053b 100644 --- a/makefile +++ b/makefile @@ -16,9 +16,9 @@ RCOMPILE_FLAGS = -D NDEBUG -O3 # Additional debug-specific flags DCOMPILE_FLAGS = -D DEBUG # Add additional include paths -INCLUDES = -I $(SRC_PATH) -I ./src/lua +INCLUDES = -I $(SRC_PATH) # General linker settings -LINK_FLAGS = -L ./src/lua -lpthread -llua -ldl +LINK_FLAGS = -lpthread # Additional release-specific linker settings RLINK_FLAGS = # Additional debug-specific linker settings @@ -42,12 +42,13 @@ TEST_OUTPUT = ./spec/outputs UNAME_S:=$(shell uname -s) ifeq ($(NO_LUA),true) - COMPILE_FLAGS += -DMOONP_NO_MACRO - COMPILE_FLAGS += -DMOONP_COMPILER_ONLY + COMPILE_FLAGS += -DMOONP_NO_MACRO -DMOONP_COMPILER_ONLY else ifeq ($(NO_MACRO),true) COMPILE_FLAGS += -DMOONP_NO_MACRO endif + INCLUDES += -I ./src/lua + LINK_FLAGS += -L ./src/lua -llua -ldl endif # Add platform related linker flag @@ -115,6 +116,10 @@ ifeq ($(SOURCES),) SOURCES := $(call rwildcard, $(SRC_PATH), *.$(SRC_EXT)) endif +ifeq ($(NO_LUA),true) + SOURCES := $(filter-out ./src/MoonP/moonplus.cpp, $(SOURCES)) +endif + # Set the object file names, with the source directory stripped # from the path, and the build path prepended in its place OBJECTS = $(SOURCES:$(SRC_PATH)/%.$(SRC_EXT)=$(BUILD_PATH)/%.o) @@ -170,7 +175,9 @@ ifeq ($(USE_VERSION), true) else @echo "Beginning release build" endif +ifneq ($(NO_LUA),true) @$(MAKE) -C ./src/lua +endif @$(START_TIME) @$(MAKE) all --no-print-directory @echo -n "Total build time: " @@ -184,7 +191,9 @@ ifeq ($(USE_VERSION), true) else @echo "Beginning debug build" endif +ifneq ($(NO_LUA),true) @$(MAKE) -C ./src/lua +endif @$(START_TIME) @$(MAKE) all --no-print-directory @echo -n "Total build time: " -- cgit v1.2.3-55-g6feb