kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

lib_srcs.mk (15676B)


      1 # mk/lib_srcs.mk
      2 # ===========================================================================
      3 # libkit source selection -> LIB_OBJS / LIB_DEPS.
      4 #
      5 # Consumes the KIT_*_ENABLED flags (mk/config.mk) and BUILD_DIR; mirrors the
      6 # `#if` gates in the corresponding sources so the build drops exactly what the
      7 # compile drops. The matching frontend `#if`s live in src/api/lang_registry.c.
      8 
      9 # Flattened, archive-unique object path. libkit.a is built with `ar`, which
     10 # stores each member under its basename only — so two sources sharing a
     11 # basename (the eight link.c, or src/{abi,arch,obj,os}/registry.c, …) would
     12 # collide as members even though their build/ paths differ. We keep the
     13 # mirrored build/ subdirs but fold the full sub-path into the basename, making
     14 # every member name unique. An immediate-parent prefix is not enough on its
     15 # own: src/obj/wasm/emit.c and src/arch/wasm/emit.c would both be wasm_emit.o.
     16 #   $(1)=sources  $(2)=tree root to strip  $(3)=dest subdir under BUILD_DIR
     17 # e.g. src/arch/aa64/native.c -> $(BUILD_DIR)/lib/arch/aa64/arch_aa64_native.o
     18 flatobjs = $(foreach s,$(1),$(BUILD_DIR)/$(3)/$(dir $(patsubst $(2)/%,%,$(s)))$(subst /,_,$(basename $(patsubst $(2)/%,%,$(s)))).o)
     19 
     20 # When a native feature is disabled, drop its per-arch TU from all three
     21 # native backends and, where one exists, compile a stub in its place.
     22 #   $(1) = TU basename (e.g. disasm.c)   $(2) = stub source, or empty
     23 define arch-feature-off
     24 LIB_SRCS_ARCH_AA64 := $$(filter-out %/$(1),$$(LIB_SRCS_ARCH_AA64))
     25 LIB_SRCS_ARCH_X64  := $$(filter-out %/$(1),$$(LIB_SRCS_ARCH_X64))
     26 LIB_SRCS_ARCH_ARM32 := $$(filter-out %/$(1),$$(LIB_SRCS_ARCH_ARM32))
     27 LIB_SRCS_ARCH_RISCV := $$(filter-out %/$(1),$$(LIB_SRCS_ARCH_RISCV))
     28 LIB_SRCS_NONARCH   += $(2)
     29 endef
     30 
     31 # Core lib sources. Optional subsystems, backend directories, object format
     32 # directories, and ABI implementations are added below from their own groups.
     33 LIB_SRCS_ABI_CORE = src/abi/abi.c src/abi/registry.c
     34 LIB_SRCS_API_CORE = $(filter-out src/api/archive.c src/api/disasm.c \
     35                        src/api/link.c src/api/build.c src/api/cas.c \
     36                        src/api/build_coord.c src/api/package.c \
     37                        src/api/compress.c src/api/image.c src/api/make.c \
     38                        src/api/stubs.c, \
     39                        $(wildcard src/api/*.c))
     40 LIB_SRCS_ARCH_CORE = $(filter-out src/arch/%_stubs.c,$(wildcard src/arch/*.c))
     41 LIB_SRCS_ASM_CORE = $(wildcard src/asm/*.c)
     42 LIB_SRCS_CG_CORE = $(wildcard src/cg/*.c)
     43 LIB_SRCS_CORE = $(wildcard src/core/*.c)
     44 LIB_SRCS_OBJ_CORE = $(filter-out src/obj/%_stubs.c src/obj/image.c,$(wildcard src/obj/*.c))
     45 LIB_SRCS_OS_CORE = src/os/registry.c
     46 LIB_SRCS_OS_HOSTED_CORE = src/os/hosted.c
     47 LIB_SRCS_NONARCH = $(LIB_SRCS_ABI_CORE) \
     48                    $(LIB_SRCS_API_CORE) \
     49                    $(LIB_SRCS_ARCH_CORE) \
     50                    $(LIB_SRCS_ASM_CORE) \
     51                    $(LIB_SRCS_CG_CORE) \
     52                    $(LIB_SRCS_CORE) \
     53                    $(LIB_SRCS_OBJ_CORE) \
     54                    $(LIB_SRCS_OS_CORE)
     55 
     56 # These source lists use `:=` (not `=`) so each `find` runs exactly once at
     57 # parse time. With recursive `=`, every reference below (LIB_SRCS is rebuilt
     58 # and re-expanded many times) would re-spawn the `find`, turning ~20 finds into
     59 # hundreds on every `make` invocation.
     60 LIB_SRCS_ARCH_AA64     := $(shell find src/arch/aa64     -name '*.c' 2>/dev/null)
     61 LIB_SRCS_ARCH_X64      := $(shell find src/arch/x64      -name '*.c' 2>/dev/null)
     62 LIB_SRCS_ARCH_ARM32    := $(shell find src/arch/arm32    -name '*.c' 2>/dev/null)
     63 LIB_SRCS_ARCH_RISCV     := $(shell find src/arch/riscv     -name '*.c' 2>/dev/null)
     64 LIB_SRCS_ARCH_WASM     := $(shell find src/arch/wasm     -name '*.c' 2>/dev/null)
     65 LIB_SRCS_ARCH_C_TARGET := $(shell find src/arch/c_target -name '*.c' 2>/dev/null)
     66 ifneq ($(KIT_OPT_ENABLED),1)
     67 $(eval $(call arch-feature-off,opt_coord.c,))
     68 endif
     69 ifneq ($(KIT_DISASM_ENABLED),1)
     70 $(eval $(call arch-feature-off,disasm.c,src/arch/disasm_stubs.c))
     71 endif
     72 ifneq ($(KIT_LINK_ENABLED),1)
     73 $(eval $(call arch-feature-off,link.c,src/arch/link_stubs.c))
     74 endif
     75 ifneq ($(KIT_DBG_ENABLED),1)
     76 $(eval $(call arch-feature-off,dbg.c,src/arch/dbg_stubs.c))
     77 endif
     78 ifneq ($(KIT_EMU_ENABLED),1)
     79 LIB_SRCS_ARCH_RISCV := $(filter-out %/emu.c,$(LIB_SRCS_ARCH_RISCV))
     80 LIB_SRCS_NONARCH += src/arch/emu_stubs.c
     81 endif
     82 ifneq ($(KIT_INTERP_ENABLED),1)
     83 LIB_SRCS_NONARCH += src/interp/interp_stubs.c
     84 endif
     85 
     86 LIB_SRCS_OBJ_ELF   := $(shell find src/obj/elf   -name '*.c' 2>/dev/null)
     87 LIB_SRCS_OBJ_MACHO := $(shell find src/obj/macho -name '*.c' 2>/dev/null)
     88 LIB_SRCS_OBJ_COFF  := $(shell find src/obj/coff  -name '*.c' 2>/dev/null)
     89 LIB_SRCS_OBJ_WASM  := $(shell find src/obj/wasm  -name '*.c' 2>/dev/null)
     90 
     91 # Per-arch object-format relocation TUs. Each backend's reloc_*.c is dropped
     92 # from the formats it appears in when that machine arch is disabled, mirroring
     93 # the `#if KIT_ARCH_*_ENABLED` gate inside the sources. Adding an arch means
     94 # adding one descriptor row, not four hand-written `filter-out` blocks. The
     95 # gate is a `$(if ...)` function (not an `ifneq` directive) so it composes with
     96 # the inner `$(eval)` regardless of macro-expansion order.
     97 #   $(1) = 1 when the arch is enabled, anything else (incl. empty) means off
     98 #   $(2) = reloc basename pattern(s) to drop, e.g. %/reloc_aarch64.c
     99 #   $(3) = object formats the reloc lives in (a subset of ELF MACHO COFF)
    100 # Drop unless $(1) is exactly `1` — matching the original `ifneq ($(flag),1)`,
    101 # which also dropped on an empty/unset flag.
    102 define arch-reloc-off
    103 $(if $(filter 1,$(1)),,$(foreach fmt,$(3),$(eval LIB_SRCS_OBJ_$(fmt) := $$(filter-out $(2),$$(LIB_SRCS_OBJ_$(fmt))))))
    104 endef
    105 
    106 $(eval $(call arch-reloc-off,$(KIT_ARCH_AA64_ENABLED),%/reloc_aarch64.c,ELF MACHO COFF))
    107 $(eval $(call arch-reloc-off,$(KIT_ARCH_X64_ENABLED),%/reloc_x86_64.c,ELF MACHO COFF))
    108 $(eval $(call arch-reloc-off,$(if $(filter 1,$(KIT_ARCH_RV32_ENABLED) $(KIT_ARCH_RV64_ENABLED)),1,0),%/reloc_riscv32.c %/reloc_riscv64.c,ELF))
    109 $(eval $(call arch-reloc-off,$(KIT_ARCH_ARM32_ENABLED),%/reloc_arm.c,ELF))
    110 ifneq ($(KIT_LINK_ENABLED),1)
    111 LIB_SRCS_OBJ_ELF := $(filter-out %/link.c %/link_dyn.c,$(LIB_SRCS_OBJ_ELF))
    112 LIB_SRCS_OBJ_MACHO := $(filter-out %/link.c,$(LIB_SRCS_OBJ_MACHO))
    113 LIB_SRCS_OBJ_COFF := $(filter-out %/link.c,$(LIB_SRCS_OBJ_COFF))
    114 LIB_SRCS_NONARCH += src/obj/link_stubs.c
    115 endif
    116 ifneq ($(KIT_EMU_ENABLED),1)
    117 LIB_SRCS_OBJ_ELF := $(filter-out %/emu_load.c,$(LIB_SRCS_OBJ_ELF))
    118 LIB_SRCS_NONARCH += src/obj/emu_stubs.c
    119 endif
    120 ifneq ($(KIT_AR_ENABLED),1)
    121 LIB_SRCS_OBJ_COFF := $(filter-out %/archive.c,$(LIB_SRCS_OBJ_COFF))
    122 LIB_SRCS_NONARCH += src/obj/archive_stubs.c
    123 endif
    124 
    125 LIB_SRCS_OPT := $(filter-out src/opt/pass_o2.c,$(shell find src/opt -name '*.c' 2>/dev/null))
    126 LIB_SRCS_INTERP := $(filter-out %/interp_stubs.c,$(shell find src/interp -name '*.c' 2>/dev/null))
    127 LIB_SRCS_WASM_CORE := $(shell find src/wasm -name '*.c' 2>/dev/null)
    128 LIB_SRCS_API_AR = src/api/archive.c
    129 LIB_SRCS_API_DISASM = src/api/disasm.c
    130 LIB_SRCS_API_LINK = src/api/link.c
    131 LIB_SRCS_API_IMAGE = src/api/image.c
    132 LIB_SRCS_OBJ_IMAGE = src/obj/image.c
    133 # Build orchestration tier (batch compile + ordered link). It uses the linker
    134 # (kit_link_session_*), so it compiles only when KIT_LINK_ENABLED.
    135 LIB_SRCS_API_BUILD = src/api/build.c
    136 LIB_SRCS_BUILD_COORD = $(shell find src/build -name '*.c' 2>/dev/null)
    137 # Distribution subsystem (content store + signed packages). The cas layer
    138 # needs blake2b (-> monocypher); the pkg layer adds the crypto/container shims
    139 # and the second monocypher TU. The compression codecs (deflate + lz4 block)
    140 # are shared by pkg and the standalone compress API, so they live in their own
    141 # CODEC group pulled in once if either is enabled. The lz4 frame layer
    142 # (LIB_SRCS_DIST_COMPRESS) is needed only by the compress API. All vendored .c
    143 # (lz4.c, lz4frame.c's xxhash/lz4hc/lz4frame) are #included by their src/dist
    144 # shim (amalgamation), so they are NOT compiled standalone.
    145 LIB_SRCS_API_CAS = src/api/cas.c
    146 LIB_SRCS_API_BUILD_COORD = src/api/build_coord.c
    147 LIB_SRCS_API_PKG = src/api/package.c
    148 LIB_SRCS_API_COMPRESS = src/api/compress.c
    149 LIB_SRCS_DIST_CAS = src/dist/dist.c src/dist/blake2b.c src/dist/blob.c \
    150                     src/dist/tree.c src/dist/cas.c
    151 LIB_SRCS_VENDOR_CAS = vendor/monocypher/monocypher.c
    152 LIB_SRCS_DIST_CODEC = src/dist/deflate.c src/dist/lz4.c
    153 LIB_SRCS_DIST_COMPRESS = src/dist/lz4frame.c
    154 LIB_SRCS_DIST_PKG = src/dist/b64.c src/dist/ed25519.c src/dist/minisig.c \
    155                     src/dist/tar.c src/dist/kpkg.c src/dist/manifest.c \
    156                     src/dist/release.c \
    157                     src/dist/trust.c
    158 LIB_SRCS_VENDOR_PKG = vendor/monocypher/monocypher-ed25519.c
    159 LIB_SRCS_DEBUG := $(shell find src/debug -name '*.c' 2>/dev/null)
    160 LIB_SRCS_DBG := $(shell find src/dbg -name '*.c' 2>/dev/null)
    161 LIB_SRCS_EMU := $(shell find src/emu -name '*.c' 2>/dev/null) \
    162                 src/os/linux/linux.c
    163 LIB_SRCS_LINK := $(shell find src/link -name '*.c' 2>/dev/null)
    164 ifneq ($(KIT_JIT_ENABLED),1)
    165 LIB_SRCS_LINK := $(filter-out %/link_jit.c,$(LIB_SRCS_LINK))
    166 endif
    167 # Parser/lexer-generator subsystem (runtime + generator gated together).
    168 LIB_SRCS_GRAM := $(shell find src/gram -name '*.c' 2>/dev/null)
    169 # POSIX make subsystem. The engine (src/make/*.c) is an amalgamation: those
    170 # fragments are #included by src/api/make.c and are NOT compiled standalone
    171 # (same pattern as the vendored lz4/monocypher shims), so only the API shim is
    172 # added to the build.
    173 LIB_SRCS_API_MAKE = src/api/make.c
    174 
    175 LIB_SRC_ABI_AAPCS64         = src/abi/abi_aapcs64.c
    176 LIB_SRC_ABI_APPLE_ARM64     = src/abi/abi_apple_arm64.c
    177 LIB_SRC_ABI_AAPCS64_WINDOWS = src/abi/abi_aapcs64_windows.c
    178 LIB_SRC_ABI_SYSV_X64        = src/abi/abi_sysv_x64.c
    179 LIB_SRC_ABI_APPLE_X64       = src/abi/abi_apple_x64.c
    180 LIB_SRC_ABI_WIN64_X64       = src/abi/abi_win64_x64.c
    181 LIB_SRC_ABI_RV64            = src/abi/abi_rv64.c
    182 LIB_SRC_ABI_AAPCS32         = src/abi/abi_aapcs32.c
    183 
    184 LIB_SRCS = $(LIB_SRCS_NONARCH)
    185 ifeq ($(KIT_OPT_ENABLED),1)
    186 LIB_SRCS += $(LIB_SRCS_OPT)
    187 endif
    188 ifeq ($(KIT_INTERP_ENABLED),1)
    189 LIB_SRCS += $(LIB_SRCS_INTERP)
    190 endif
    191 ifeq ($(KIT_AR_ENABLED),1)
    192 LIB_SRCS += $(LIB_SRCS_API_AR)
    193 endif
    194 ifeq ($(KIT_DISASM_ENABLED),1)
    195 LIB_SRCS += $(LIB_SRCS_API_DISASM)
    196 endif
    197 ifeq ($(KIT_DWARF_ENABLED),1)
    198 LIB_SRCS += $(LIB_SRCS_DEBUG)
    199 endif
    200 ifeq ($(KIT_LINK_ENABLED),1)
    201 LIB_SRCS += $(LIB_SRCS_API_LINK) $(LIB_SRCS_API_BUILD) $(LIB_SRCS_LINK)
    202 endif
    203 ifeq ($(KIT_BUILD_ENABLED),1)
    204 LIB_SRCS += $(LIB_SRCS_BUILD_COORD)
    205 endif
    206 ifeq ($(KIT_IMAGE_ENABLED),1)
    207 LIB_SRCS += $(LIB_SRCS_API_IMAGE) $(LIB_SRCS_OBJ_IMAGE)
    208 endif
    209 ifeq ($(KIT_DBG_ENABLED),1)
    210 LIB_SRCS += $(LIB_SRCS_DBG)
    211 endif
    212 ifeq ($(KIT_EMU_ENABLED),1)
    213 LIB_SRCS += $(LIB_SRCS_EMU)
    214 endif
    215 ifeq ($(KIT_GRAM_ENABLED),1)
    216 LIB_SRCS += $(LIB_SRCS_GRAM)
    217 endif
    218 ifeq ($(KIT_MAKE_ENABLED),1)
    219 LIB_SRCS += $(LIB_SRCS_API_MAKE)
    220 endif
    221 ifeq ($(KIT_CAS_ENABLED),1)
    222 LIB_SRCS += $(LIB_SRCS_API_CAS) $(LIB_SRCS_DIST_CAS) $(LIB_SRCS_VENDOR_CAS)
    223 endif
    224 ifeq ($(KIT_BUILD_ENABLED),1)
    225 LIB_SRCS += $(LIB_SRCS_API_BUILD_COORD)
    226 endif
    227 # Shared compression codecs (deflate + lz4 block): pulled in once if either the
    228 # compress API or the pkg layer needs them.
    229 KIT_NEED_CODEC :=
    230 ifeq ($(KIT_COMPRESS_ENABLED),1)
    231 LIB_SRCS += $(LIB_SRCS_API_COMPRESS) $(LIB_SRCS_DIST_COMPRESS)
    232 KIT_NEED_CODEC := 1
    233 endif
    234 ifeq ($(KIT_PKG_ENABLED),1)
    235 LIB_SRCS += $(LIB_SRCS_API_PKG) $(LIB_SRCS_DIST_PKG) $(LIB_SRCS_VENDOR_PKG)
    236 KIT_NEED_CODEC := 1
    237 endif
    238 ifeq ($(KIT_NEED_CODEC),1)
    239 LIB_SRCS += $(LIB_SRCS_DIST_CODEC)
    240 endif
    241 ifeq ($(KIT_ARCH_AA64_ENABLED),1)
    242 LIB_SRCS += $(LIB_SRCS_ARCH_AA64)
    243 endif
    244 ifeq ($(KIT_ARCH_X64_ENABLED),1)
    245 LIB_SRCS += $(LIB_SRCS_ARCH_X64)
    246 endif
    247 ifeq ($(KIT_ARCH_ARM32_ENABLED),1)
    248 LIB_SRCS += $(LIB_SRCS_ARCH_ARM32)
    249 endif
    250 ifneq ($(filter 1,$(KIT_ARCH_RV32_ENABLED) $(KIT_ARCH_RV64_ENABLED)),)
    251 LIB_SRCS += $(LIB_SRCS_ARCH_RISCV)
    252 endif
    253 ifeq ($(KIT_ARCH_WASM_ENABLED),1)
    254 LIB_SRCS += $(LIB_SRCS_ARCH_WASM)
    255 endif
    256 ifeq ($(KIT_ARCH_C_TARGET_ENABLED),1)
    257 LIB_SRCS += $(LIB_SRCS_ARCH_C_TARGET)
    258 endif
    259 ifneq ($(filter 1,$(KIT_ARCH_WASM_ENABLED) $(KIT_OBJ_WASM_ENABLED) $(KIT_LANG_WASM_ENABLED)),)
    260 LIB_SRCS += $(LIB_SRCS_WASM_CORE)
    261 LIB_SRCS += $(LIB_SRCS_OBJ_WASM)
    262 endif
    263 ifeq ($(KIT_OBJ_ELF_ENABLED),1)
    264 LIB_SRCS += $(LIB_SRCS_OBJ_ELF)
    265 endif
    266 ifeq ($(KIT_OBJ_MACHO_ENABLED),1)
    267 LIB_SRCS += $(LIB_SRCS_OBJ_MACHO)
    268 endif
    269 ifeq ($(KIT_OBJ_COFF_ENABLED),1)
    270 LIB_SRCS += $(LIB_SRCS_OBJ_COFF)
    271 endif
    272 ifneq ($(filter 1,$(KIT_OBJ_ELF_ENABLED) $(KIT_OBJ_MACHO_ENABLED) $(KIT_OBJ_COFF_ENABLED)),)
    273 LIB_SRCS += $(LIB_SRCS_OS_HOSTED_CORE)
    274 endif
    275 ifneq ($(filter 1,$(KIT_OBJ_ELF_ENABLED) $(KIT_EMU_ENABLED)),)
    276 LIB_SRCS += src/os/linux/os.c
    277 endif
    278 ifeq ($(KIT_OBJ_ELF_ENABLED),1)
    279 LIB_SRCS += src/os/linux/hosted.c src/os/freebsd/os.c src/os/freebsd/hosted.c \
    280             src/os/android/os.c src/os/android/hosted.c
    281 endif
    282 ifeq ($(KIT_OBJ_MACHO_ENABLED),1)
    283 LIB_SRCS += src/os/macos/os.c src/os/macos/hosted.c
    284 endif
    285 ifeq ($(KIT_OBJ_COFF_ENABLED),1)
    286 LIB_SRCS += src/os/windows/os.c src/os/windows/hosted.c
    287 endif
    288 ifneq ($(filter 1,$(KIT_ARCH_AA64_ENABLED) $(KIT_ARCH_C_TARGET_ENABLED)),)
    289 ifneq ($(filter 1,$(KIT_OBJ_ELF_ENABLED) $(KIT_OBJ_MACHO_ENABLED) $(KIT_OBJ_COFF_ENABLED)),)
    290 LIB_SRCS += $(LIB_SRC_ABI_AAPCS64)
    291 endif
    292 ifeq ($(KIT_OBJ_MACHO_ENABLED),1)
    293 LIB_SRCS += $(LIB_SRC_ABI_APPLE_ARM64)
    294 endif
    295 ifeq ($(KIT_OBJ_COFF_ENABLED),1)
    296 LIB_SRCS += $(LIB_SRC_ABI_AAPCS64_WINDOWS)
    297 endif
    298 endif
    299 ifneq ($(filter 1,$(KIT_ARCH_X64_ENABLED) $(KIT_ARCH_C_TARGET_ENABLED)),)
    300 ifneq ($(filter 1,$(KIT_OBJ_ELF_ENABLED) $(KIT_OBJ_MACHO_ENABLED)),)
    301 LIB_SRCS += $(LIB_SRC_ABI_SYSV_X64)
    302 endif
    303 ifeq ($(KIT_OBJ_MACHO_ENABLED),1)
    304 LIB_SRCS += $(LIB_SRC_ABI_APPLE_X64)
    305 endif
    306 ifeq ($(KIT_OBJ_COFF_ENABLED),1)
    307 LIB_SRCS += $(LIB_SRC_ABI_WIN64_X64)
    308 endif
    309 endif
    310 ifneq ($(filter 1,$(KIT_ARCH_RV32_ENABLED) $(KIT_ARCH_RV64_ENABLED) $(KIT_ARCH_C_TARGET_ENABLED)),)
    311 ifeq ($(KIT_OBJ_ELF_ENABLED),1)
    312 LIB_SRCS += $(LIB_SRC_ABI_RV64)
    313 endif
    314 endif
    315 ifneq ($(filter 1,$(KIT_ARCH_ARM32_ENABLED) $(KIT_ARCH_C_TARGET_ENABLED)),)
    316 ifeq ($(KIT_OBJ_ELF_ENABLED),1)
    317 LIB_SRCS += $(LIB_SRC_ABI_AAPCS32)
    318 endif
    319 endif
    320 
    321 # Per-frontend source sets. Each is gated by its KIT_LANG_*_ENABLED flag
    322 # from mk/config.mk so the matching `#if` in src/api/lang_registry.c and
    323 # the build agree on which frontends are compiled in.
    324 LANG_CPP_SRCS  := $(shell find lang/cpp  -name '*.c' 2>/dev/null)
    325 LANG_C_SRCS    := $(shell find lang/c    -name '*.c' 2>/dev/null)
    326 LANG_WASM_SRCS := $(shell find lang/wasm -name '*.c' 2>/dev/null)
    327 LANG_TOY_SRCS  = $(wildcard lang/toy/*.c)
    328 
    329 LANG_OBJS =
    330 ifeq ($(KIT_LANG_CPP_ENABLED),1)
    331 LANG_OBJS += $(call flatobjs,$(LANG_CPP_SRCS),lang,lang)
    332 endif
    333 ifeq ($(KIT_LANG_C_ENABLED),1)
    334 LANG_OBJS += $(call flatobjs,$(LANG_C_SRCS),lang,lang)
    335 endif
    336 ifeq ($(KIT_LANG_WASM_ENABLED),1)
    337 LANG_OBJS += $(call flatobjs,$(LANG_WASM_SRCS),lang,lang)
    338 endif
    339 ifeq ($(KIT_LANG_TOY_ENABLED),1)
    340 LANG_OBJS += $(call flatobjs,$(LANG_TOY_SRCS),lang,lang)
    341 endif
    342 
    343 # Library assembly sources (currently none). The compile rules in the Makefile
    344 # consume LIB_ASMS, so keep it defined even when empty.
    345 LIB_ASMS =
    346 
    347 # Compile-rule source groups (each shares one compile-flag profile; the rules
    348 # that consume these live in the Makefile). lang_registry.c is split out: it is
    349 # a libkit TU but compiles with frontend includes (-Ilang), not the library set.
    350 LIB_SRCS_LANGREG   := $(filter src/api/lang_registry.c,$(LIB_SRCS))
    351 LIB_SRCS_C_GENERAL := $(filter-out $(LIB_SRCS_LANGREG),$(filter src/%.c,$(LIB_SRCS)))
    352 LIB_SRCS_VENDOR    := $(filter vendor/%.c,$(LIB_SRCS))
    353 
    354 LIB_OBJS    = $(call flatobjs,$(LIB_SRCS_C_GENERAL),src,lib) \
    355               $(call flatobjs,$(LIB_SRCS_LANGREG),src,lib) \
    356               $(call flatobjs,$(LIB_SRCS_VENDOR),vendor,vendor) \
    357               $(LANG_OBJS) \
    358               $(call flatobjs,$(LIB_ASMS),src,lib)
    359 LIB_DEPS    = $(LIB_OBJS:.o=.d)