Files
tinyblocks/libraries/tinyblocks-python/Makefile
T
mguinhos dc23b92d15 Adiciona libraries toml/fs, metadados .toml e build por library
- 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).
2026-10-20 19:38:58 -03:00

28 lines
848 B
Makefile

# Makefile da library python (embedding CPython)
# Constroi build/libtinyblocks-python.so (soname unico p/ um so interpretador)
CC := gcc
BUILD := 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 $(PYTHON_CFLAGS)
OBJ := $(BUILD)/tb_python_lib.o
LIB_SO := $(BUILD)/libtinyblocks-python.so
.PHONY: all shared clean
all: shared
shared: $(LIB_SO)
$(OBJ): src/tb_python.c include/tinyblocks-python/tb_python.h
@mkdir -p $(BUILD)
$(CC) $(CFLAGS) -fPIC -c $< -o $@
$(LIB_SO): $(OBJ)
$(CC) -shared -Wl,-soname,libtinyblocks-python.so -o $@ $^ $(PYTHON_LIBS)
clean:
$(RM) -r $(BUILD)