kuroko: add managed modules to filesystem

This commit is contained in:
K. Lange 2021-07-31 18:40:03 +09:00
parent f0de4abfb8
commit 5cdec2a98f
2 changed files with 6 additions and 0 deletions

1
.gitignore vendored
View File

@ -25,6 +25,7 @@
/base/bin/*
/base/usr/bin/*
/base/usr/lib/*
/base/lib/kuroko/*
/.make/
/cdrom
/fatbase

View File

@ -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))