- tinyblocks-toml: lexer + parser TOML (include/lexeme.h, include/ast.h, src/lexer.c, src/parser.c) e bloco Toml.Get. - tinyblocks-fs: categoria "Arquivos" com FS.Open/Read/Write/Append/Tell/Close. - library.toml em cada library com metadados (categoria, cor, descricao) e receita de build, sem precisar embutir isso no .so. - Makefiles proprios por library com build/ local; Makefile raiz delega. - Palco (tb_stage) movido para o core; pen deixa de depender do editor, o que torna os .so arrastaveis. - Editor linka com -rdynamic para resolver simbolos do core em .so via dlopen. - Testes: test-toml (parser) e test-plugin (dlopen de .so standalone).
36 lines
1.1 KiB
Makefile
36 lines
1.1 KiB
Makefile
# Makefile da library mcp (cliente MCP; reusa tinyblocks-python)
|
|
# Constroi build/libtinyblocks-mcp.so
|
|
CC := gcc
|
|
BUILD := build
|
|
PYDIR := ../tinyblocks-python
|
|
PYBUILD:= $(PYDIR)/build
|
|
|
|
PYTHON_CFLAGS := $(shell python3-config --cflags --embed 2>/dev/null || python3-config --cflags)
|
|
PYTHON_LIBS := $(shell python3-config --ldflags --embed 2>/dev/null || python3-config --ldflags)
|
|
|
|
CFLAGS := -std=c11 -Wall -Wextra -pedantic -fvisibility=hidden \
|
|
-I../../include -Iinclude -Isrc -I$(PYDIR)/include $(PYTHON_CFLAGS)
|
|
|
|
OBJ := $(BUILD)/tb_mcp_lib.o
|
|
LIB_SO := $(BUILD)/libtinyblocks-mcp.so
|
|
PY_HDR := src/tb_mcp_py.h
|
|
|
|
.PHONY: all shared clean
|
|
all: shared
|
|
shared: $(LIB_SO)
|
|
|
|
$(PY_HDR): src/tb_mcp.py
|
|
xxd -i -n tb_mcp_py $< $@
|
|
|
|
$(OBJ): src/tb_mcp.c $(PY_HDR) $(PYDIR)/include/tinyblocks-python/tb_python.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
|
|
$(LIB_SO): $(OBJ) $(PYBUILD)/libtinyblocks-python.so
|
|
$(CC) -shared -Wl,-soname,libtinyblocks-mcp.so -o $@ $(OBJ) \
|
|
-L$(PYBUILD) -ltinyblocks-python $(PYTHON_LIBS) \
|
|
'-Wl,-rpath,$$ORIGIN/../../tinyblocks-python/build'
|
|
|
|
clean:
|
|
$(RM) -r $(BUILD) $(PY_HDR)
|