summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-18 00:44:52 +0800
committerruki <[email protected]>2021-09-18 00:44:52 +0800
commitb58700f83ee4e40582b03f5fdfe337788b9f2c6f (patch)
tree2c0fd405e959913d53436299f509e8c05cda57b5 /core/src
parent4d8c00eecd99b0f65f40befd36bb2945df9996a7 (diff)
update makefile
Diffstat (limited to 'core/src')
-rw-r--r--core/src/lcurses/makefile7
-rw-r--r--core/src/lua/makefile58
-rw-r--r--core/src/makefile10
-rw-r--r--core/src/xmake/makefile7
4 files changed, 78 insertions, 4 deletions
diff --git a/core/src/lcurses/makefile b/core/src/lcurses/makefile
index 25752ab47..b981765a7 100644
--- a/core/src/lcurses/makefile
+++ b/core/src/lcurses/makefile
@@ -17,7 +17,12 @@ lcurses_C_FILES += lcurses
lcurses_CXFLAGS += $(if $(findstring curses,$(base_LIBNAMES)),-DXM_CONFIG_API_HAVE_CURSES,)
# includes
-lcurses_INC_DIRS += ../luajit/luajit/src
+ifeq ($(BACKEND),luajit)
+lcurses_INC_DIRS += ../luajit/luajit/src
+endif
+ifeq ($(BACKEND),lua)
+lcurses_INC_DIRS += ../lua/lua
+endif
# suffix
include $(PRO_DIR)/suffix.mak
diff --git a/core/src/lua/makefile b/core/src/lua/makefile
new file mode 100644
index 000000000..d2314c846
--- /dev/null
+++ b/core/src/lua/makefile
@@ -0,0 +1,58 @@
+# prefix
+include $(PRO_DIR)/prefix.mak
+
+# module name
+NAMES = lua
+
+# module type
+lua_TYPE = LIB
+
+# config
+lua_CONFIG = n
+
+# core files
+lua_C_FILES += \
+ lua/lauxlib \
+ lua/liolib \
+ lua/lopcodes \
+ lua/lstate \
+ lua/lobject \
+ lua/lmathlib \
+ lua/loadlib \
+ lua/lvm \
+ lua/lfunc \
+ lua/lstrlib \
+ lua/linit \
+ lua/lstring \
+ lua/lundump \
+ lua/lctype \
+ lua/ltable \
+ lua/ldump \
+ lua/loslib \
+ lua/lgc \
+ lua/lzio \
+ lua/ldblib \
+ lua/lutf8lib \
+ lua/lmem \
+ lua/lcorolib \
+ lua/lcode \
+ lua/ltablib \
+ lua/lbitlib \
+ lua/lapi \
+ lua/lbaselib \
+ lua/ldebug \
+ lua/lparser \
+ lua/llex \
+ lua/ltm \
+ lua/ltests \
+ lua/ldo
+
+# use given system library?
+lua_C_FILES := $(if $(findstring lua,$(base_LIBNAMES)),,$(lua_C_FILES))
+lua_ASM_FILES := $(if $(findstring lua,$(base_LIBNAMES)),,$(lua_ASM_FILES))
+lua_INC_FILES := $(if $(findstring lua,$(base_LIBNAMES)),,$(lua_INC_FILES))
+lua_OBJ_FILES := $(if $(findstring lua,$(base_LIBNAMES)),,$(lua_OBJ_FILES))
+
+# suffix
+include $(PRO_DIR)/suffix.mak
+
diff --git a/core/src/makefile b/core/src/makefile
index 21a06ed5a..47151258e 100644
--- a/core/src/makefile
+++ b/core/src/makefile
@@ -2,8 +2,14 @@
include $(PRO_DIR)/prefix.mak
# projects
-SUB_PROS += demo
-DEP_PROS += lcurses sv luajit lua-cjson tbox xmake
+SUB_PROS += demo
+ifeq ($(BACKEND),luajit)
+DEP_PROS += luajit
+endif
+ifeq ($(BACKEND),lua)
+DEP_PROS += lua
+endif
+DEP_PROS += lcurses sv lua-cjson tbox xmake
# suffix
include $(PRO_DIR)/suffix.mak
diff --git a/core/src/xmake/makefile b/core/src/xmake/makefile
index 2c45588b4..84f3044b2 100644
--- a/core/src/xmake/makefile
+++ b/core/src/xmake/makefile
@@ -149,8 +149,13 @@ xmake_CXFLAGS += $(if $(findstring curses,$(base_LIBNAMES)),-DXM_CONFIG
xmake_INC_DIRS += \
../tbox/tbox/src \
../tbox/inc/$(PLAT) \
- ../luajit/luajit/src \
../sv/sv/include
+ifeq ($(BACKEND),luajit)
+xmake_INC_DIRS += ../luajit/luajit/src
+endif
+ifeq ($(BACKEND),lua)
+xmake_INC_DIRS += ../lua/lua
+endif
# suffix