From 5cdec2a98fe0b8b77c46037ff1c635ec041cabf9 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sat, 31 Jul 2021 18:40:03 +0900 Subject: [PATCH] kuroko: add managed modules to filesystem --- .gitignore | 1 + Makefile | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index c9031798..a7d1041f 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ /base/bin/* /base/usr/bin/* /base/usr/lib/* +/base/lib/kuroko/* /.make/ /cdrom /fatbase diff --git a/Makefile b/Makefile index cebfcfeb..7b209b1b 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ LIBS_X=$(foreach lib,$(LIBS),$(BASE)/lib/libtoaru_$(lib).so) LIBS_Y=$(foreach lib,$(LIBS),.make/$(lib).lmak) KRK_MODS = $(patsubst kuroko/src/modules/module_%.c,$(BASE)/lib/kuroko/%.so,$(wildcard kuroko/src/modules/module_*.c)) +KRK_MODS = $(patsubst kuroko/modules/%,$(BASE)/lib/kuroko/%,$(wildcard kuroko/modules/*.krk kuroko/modules/*/*/.krk kuroko/modules/*/*/*.krk)) KRK_MODS_X = $(patsubst lib/kuroko/%.c,$(BASE)/lib/kuroko/%.so,$(wildcard lib/kuroko/*.c)) KRK_MODS_Y = $(patsubst lib/kuroko/%.c,.make/%.kmak,$(wildcard lib/kuroko/*.c)) @@ -101,6 +102,10 @@ $(BASE)/bin/kuroko: $(KRK_SRC) $(CRTS) lib/rline.c | $(LC) $(BASE)/lib/kuroko/%.so: kuroko/src/modules/module_%.c| dirs $(LC) $(CC) -O2 -shared -fPIC -Ikuroko/src -o $@ $< +$(BASE)/lib/kuroko/%.krk: kuroko/modules/%.krk | dirs + mkdir -p $(dir $@) + cp $< $@ + $(BASE)/lib/libkuroko.so: $(KRK_SRC) | $(LC) $(CC) -O2 -shared -fPIC -Ikuroko/src -o $@ $(filter-out kuroko/src/kuroko.c,$(KRK_SRC))