Adiciona tinyblocks-bmp e tinyblocks-png (libpng)

This commit is contained in:
mguinhos committed 2026-10-20 21:05:47 -03:00
1 parent 959a4027c3
commit fca7aa2f63
11 files changed
+574 -6

No files matched your search

+36 -6
View File
@@ -27,6 +27,8 @@ BP_DIR := $(LIBDIR)/tinyblocks-blueprint
B64_DIR := $(LIBDIR)/tinyblocks-base64
CV_DIR := $(LIBDIR)/tinyblocks-curves
PPM_DIR := $(LIBDIR)/tinyblocks-ppm
BMP_DIR := $(LIBDIR)/tinyblocks-bmp
PNG_DIR := $(LIBDIR)/tinyblocks-png
API_DIR := $(LIBDIR)/tinyblocks-api
LIBM_DIR := $(LIBDIR)/tinyblocks-libman
ED_DIR := $(LIBDIR)/tinyblocks-editor
@@ -82,12 +84,12 @@ LIB_LDFLAGS := -L$(ED_DIR)/build -L$(GX_DIR)/build -L$(SD_DIR)/build \
.PHONY: all help debug release static shared example sdl2 clean run python-lib mcp-lib json \
editor run-editor run-sdl2 mylib vector customappearance graphics sdl2-backend test-editor \
appdir appimage run-appimage icon \
test-toml test-plugin test-blueprint test-base64 test-curves test-ppm \
test-toml test-plugin test-blueprint test-base64 test-curves test-ppm test-bmp test-png \
category-libs category-sos libs \
lib-events lib-control lib-operators lib-variables lib-appearance lib-pen lib-fs \
lib-environ \
lib-editor lib-graphics lib-sdl2 lib-python lib-mcp lib-toml \
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-api lib-libman \
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-api lib-libman \
test-libman test-environ
all: static example ## Compila a biblioteca estática e o exemplo hello (padrão)
@@ -172,6 +174,12 @@ lib-curves:
lib-ppm:
$(MAKE) -C $(PPM_DIR)
lib-bmp:
$(MAKE) -C $(BMP_DIR)
lib-png:
$(MAKE) -C $(PNG_DIR)
lib-api:
$(MAKE) -C $(API_DIR)
@@ -192,8 +200,8 @@ lib-mcp:
libs: static lib-events lib-control lib-operators lib-variables \
lib-appearance lib-pen lib-fs lib-environ lib-graphics lib-sdl2 lib-toml \
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-api lib-libman lib-editor
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + api + libman + editor"
lib-json lib-xml lib-csv lib-blueprint lib-base64 lib-curves lib-ppm lib-bmp lib-png lib-api lib-libman lib-editor
@echo "Libraries OK: category + graphics + sdl2 + toml + json + xml + csv + blueprint + base64 + curves + ppm + bmp + png + api + libman + editor"
category-libs: static $(foreach l,$(CAT_LIBS),lib-$(l)) ## Compila as libraries de categoria (.a/.so)
@echo "Build category libs OK"
@@ -244,7 +252,7 @@ run-editor: editor ## Compila e abre o editor visual
# ── Empacotamento AppImage ──────────────────────────────────────────────
# Libraries com blocos (categoria) que vao empacotadas como extensoes.
APPIMAGE_LIBS := $(CAT_LIBS) toml json xml csv blueprint base64 curves ppm
APPIMAGE_LIBS := $(CAT_LIBS) toml json xml csv blueprint base64 curves ppm bmp png
APP_NAME := TinyBlocks
APP_VER := 0.1.0
@@ -467,6 +475,28 @@ $(BUILD)/ppm_test: tests/ppm_test.c $(PPM_DIR)/src/tb_ppm.c static
test-ppm: $(BUILD)/ppm_test ## Roda o teste da ppm (ASan/UBSan)
./$(BUILD)/ppm_test
# -- Teste da library bmp ---
$(BUILD)/bmp_test: tests/bmp_test.c $(BMP_DIR)/src/tb_bmp.c static
@mkdir -p $(BUILD)
$(CC) $(CFLAGS_DBG) -I$(BMP_DIR)/include $(BMP_DIR)/src/tb_bmp.c \
tests/bmp_test.c -o $@ \
-Wl,--start-group $(LIB_A) -Wl,--end-group
test-bmp: $(BUILD)/bmp_test ## Roda o teste da bmp (ASan/UBSan)
./$(BUILD)/bmp_test
# -- Teste da library png (libpng) ---
PNG_CFLAGS := $(shell pkg-config --cflags libpng 2>/dev/null)
PNG_LIBS := $(shell pkg-config --libs libpng 2>/dev/null)
$(BUILD)/png_test: tests/png_test.c $(PNG_DIR)/src/tb_png.c static
@mkdir -p $(BUILD)
$(CC) $(CFLAGS_DBG) $(PNG_CFLAGS) -I$(PNG_DIR)/include $(PNG_DIR)/src/tb_png.c \
tests/png_test.c -o $@ \
-Wl,--start-group $(LIB_A) -Wl,--end-group $(PNG_LIBS)
test-png: $(BUILD)/png_test ## Roda o teste da png (ASan/UBSan)
./$(BUILD)/png_test
# -- Teste de plugin .so standalone ---
FS_SO := $(FS_DIR)/build/libtinyblocks-fs.so
@@ -483,7 +513,7 @@ clean: ## Remove os diretórios build/ (raiz e libraries)
$(RM) -r $(BUILD)
@for d in $(EV_DIR) $(CT_DIR) $(OP_DIR) $(VR_DIR) $(AP_DIR) $(PN_DIR) $(FS_DIR) \
$(TOML_DIR) $(JSON_DIR) $(XML_DIR) $(CSV_DIR) $(BP_DIR) \
$(B64_DIR) $(CV_DIR) $(PPM_DIR) \
$(B64_DIR) $(CV_DIR) $(PPM_DIR) $(BMP_DIR) $(PNG_DIR) \
$(API_DIR) $(LIBM_DIR) \
$(ED_DIR) $(GX_DIR) $(SD_DIR) $(PY_DIR) $(MC_DIR); do \
$(MAKE) -C $$d clean >/dev/null 2>&1 || true; \