Files
mguinhosandClaude Opus 5.5 bf6c59f80e Libraries compiladas com -O2
Os Makefiles das libraries não passavam -O: tudo menos o core
(editor, operators, number, variables, vector, graphics...) saía em
-O0, inclusive no AppImage. Agora todas usam -O2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:08:05 -03:00

28 lines
852 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 -O2 -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)