2021-03-07 21:26:57 +00:00
|
|
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
|
|
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
|
|
|
|
|
|
|
PKGS += THIRD_PARTY_LUA
|
|
|
|
|
|
|
|
THIRD_PARTY_LUA_FILES := $(wildcard third_party/lua/*)
|
|
|
|
THIRD_PARTY_LUA_SRCS = $(filter %.c,$(THIRD_PARTY_LUA_FILES))
|
|
|
|
THIRD_PARTY_LUA_HDRS = $(filter %.h,$(THIRD_PARTY_LUA_FILES))
|
|
|
|
THIRD_PARTY_LUA_BINS = $(THIRD_PARTY_LUA_COMS) $(THIRD_PARTY_LUA_COMS:%=%.dbg)
|
2021-03-08 22:13:40 +00:00
|
|
|
THIRD_PARTY_LUA = $(THIRD_PARTY_LUA_DEPS) $(THIRD_PARTY_LUA_A)
|
|
|
|
THIRD_PARTY_LUA_A = o/$(MODE)/third_party/lua/lua.a
|
2021-03-07 21:26:57 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_LUA_OBJS = \
|
|
|
|
$(THIRD_PARTY_LUA_SRCS:%.c=o/$(MODE)/%.o)
|
|
|
|
|
|
|
|
THIRD_PARTY_LUA_COMS = \
|
2021-08-09 20:09:14 +00:00
|
|
|
o/$(MODE)/third_party/lua/lua.com \
|
|
|
|
o/$(MODE)/third_party/lua/luac.com
|
2021-03-07 21:26:57 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_LUA_CHECKS = \
|
2021-03-09 01:51:26 +00:00
|
|
|
$(THIRD_PARTY_LUA_A).pkg \
|
2021-03-07 21:26:57 +00:00
|
|
|
$(THIRD_PARTY_LUA_HDRS:%=o/$(MODE)/%.ok)
|
|
|
|
|
|
|
|
THIRD_PARTY_LUA_DIRECTDEPS = \
|
|
|
|
LIBC_CALLS \
|
|
|
|
LIBC_FMT \
|
|
|
|
LIBC_INTRIN \
|
|
|
|
LIBC_MEM \
|
|
|
|
LIBC_NEXGEN32E \
|
|
|
|
LIBC_RUNTIME \
|
|
|
|
LIBC_STDIO \
|
|
|
|
LIBC_STR \
|
|
|
|
LIBC_SYSV \
|
|
|
|
LIBC_TIME \
|
|
|
|
LIBC_TINYMATH \
|
|
|
|
LIBC_UNICODE \
|
2021-08-14 18:26:23 +00:00
|
|
|
THIRD_PARTY_LINENOISE \
|
2021-03-07 21:26:57 +00:00
|
|
|
THIRD_PARTY_GDTOA
|
|
|
|
|
|
|
|
THIRD_PARTY_LUA_DEPS := \
|
|
|
|
$(call uniq,$(foreach x,$(THIRD_PARTY_LUA_DIRECTDEPS),$($(x))))
|
|
|
|
|
2021-03-08 22:13:40 +00:00
|
|
|
$(THIRD_PARTY_LUA_A): \
|
|
|
|
third_party/lua/ \
|
|
|
|
$(THIRD_PARTY_LUA_A).pkg \
|
2021-08-09 20:09:14 +00:00
|
|
|
$(filter-out %.main.o,$(THIRD_PARTY_LUA_OBJS))
|
2021-03-08 22:13:40 +00:00
|
|
|
|
|
|
|
$(THIRD_PARTY_LUA_A).pkg: \
|
2021-03-07 21:26:57 +00:00
|
|
|
$(THIRD_PARTY_LUA_OBJS) \
|
|
|
|
$(foreach x,$(THIRD_PARTY_LUA_DIRECTDEPS),$($(x)_A).pkg)
|
|
|
|
|
2021-03-08 22:13:40 +00:00
|
|
|
o/$(MODE)/third_party/lua/lua.com.dbg: \
|
2021-03-07 21:26:57 +00:00
|
|
|
$(THIRD_PARTY_LUA_DEPS) \
|
2021-03-08 22:13:40 +00:00
|
|
|
$(THIRD_PARTY_LUA_A) \
|
|
|
|
$(THIRD_PARTY_LUA_A).pkg \
|
2021-08-10 17:26:13 +00:00
|
|
|
o/$(MODE)/third_party/lua/lua.main.o \
|
2021-03-07 21:26:57 +00:00
|
|
|
$(CRT) \
|
|
|
|
$(APE)
|
|
|
|
-@$(APELINK)
|
|
|
|
|
2021-08-09 20:09:14 +00:00
|
|
|
o/$(MODE)/third_party/lua/luac.com.dbg: \
|
|
|
|
$(THIRD_PARTY_LUA_DEPS) \
|
|
|
|
$(THIRD_PARTY_LUA_A) \
|
|
|
|
$(THIRD_PARTY_LUA_A).pkg \
|
2021-08-10 17:26:13 +00:00
|
|
|
o/$(MODE)/third_party/lua/luac.main.o \
|
2021-08-09 20:09:14 +00:00
|
|
|
$(CRT) \
|
|
|
|
$(APE)
|
|
|
|
-@$(APELINK)
|
|
|
|
|
2021-03-07 21:26:57 +00:00
|
|
|
o/$(MODE)/third_party/lua/lauxlib.o: \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-DSTACK_FRAME_UNLIMITED
|
|
|
|
|
2021-08-06 21:12:11 +00:00
|
|
|
$(THIRD_PARTY_LUA_OBJS): \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-ffunction-sections \
|
|
|
|
-fdata-sections
|
|
|
|
|
2021-03-07 21:26:57 +00:00
|
|
|
.PHONY: o/$(MODE)/third_party/lua
|
|
|
|
o/$(MODE)/third_party/lua: \
|
|
|
|
$(THIRD_PARTY_LUA_BINS) \
|
|
|
|
$(THIRD_PARTY_LUA_CHECKS)
|