- tinyblocks-editor agora e um bundle: libraries privadas em
libraries/tinyblocks-editor-{widgets,image} (.a + .so), com library.toml
(bundle = tinyblocks-editor, private = true -> nao aparecem no libman).
- O editor carrega os modulos por dlopen via tinyblocks-api e chama tudo por
tabelas de ponteiros (tb_ed_w, tb_ed_img): da para recompilar so a parte que
mudou e o editor recarrega ao vivo (make ed-modules), sem reiniciar.
- tinyblocks-api ganhou modulos de codigo (tb_api_code_*) e watcher de
arquivos (inotify, com mtime como reserva).
- libman: entradas com bundle/private nao sao listadas como extensao.
- Aba de imagem: layout estilo Krita - ferramentas na esquerda, tela no meio,
roda de cores + paleta + camadas na coluna da direita; miniatura por camada
(como as fantasias do Scratch); rodape enxuto (Desfazer/Limpar/zoom).
- Ferramenta selecionar (mover/redimensionar/excluir pixels) e consertada a
geometria da folha (doc = area de desenho, zoom puro).
- Makefile: alvo ed-modules; AppImage empacota os .so do bundle.
- harness: testes de imagem atualizados + testes de cores na lateral.
77 lines
2.8 KiB
Makefile
77 lines
2.8 KiB
Makefile
# Makefile da library editor (editor visual estilo Scratch)
|
|
# Constroi build/libtinyblocks-editor.a e build/libtinyblocks-editor.so
|
|
# Inclui o widget Editor.Stage (tb_stage.c).
|
|
CC := gcc
|
|
BUILD := build
|
|
CORE := ../../build
|
|
|
|
CFLAGS := -std=c11 -Wall -Wextra -pedantic -fvisibility=hidden \
|
|
-D_POSIX_C_SOURCE=200809L \
|
|
-I../../include -Iinclude -Isrc \
|
|
-I../tinyblocks-graphics/include \
|
|
-I../tinyblocks-variables/include \
|
|
-I../tinyblocks-blueprint/include \
|
|
-I../tinyblocks-environ/include \
|
|
-I../tinyblocks-api/include \
|
|
-I../tinyblocks-libman/include \
|
|
-I../tinyblocks-syntax/include \
|
|
-Ilibraries/tinyblocks-editor-widgets/include \
|
|
-Ilibraries/tinyblocks-editor-image/include
|
|
|
|
WIDGETS_DIR := libraries/tinyblocks-editor-widgets
|
|
WIDGETS_A := $(WIDGETS_DIR)/build/libtinyblocks-editor-widgets.a
|
|
IMG_DIR := libraries/tinyblocks-editor-image
|
|
IMG_A := $(IMG_DIR)/build/libtinyblocks-editor-image.a
|
|
|
|
OBJ := $(BUILD)/tb_editor.o $(BUILD)/tb_stage_widget.o $(BUILD)/tb_editor_modules.o
|
|
LIB_A := $(BUILD)/libtinyblocks-editor.a
|
|
LIB_SO := $(BUILD)/libtinyblocks-editor.so
|
|
|
|
.PHONY: all static shared clean
|
|
all: static shared
|
|
static: $(LIB_A)
|
|
shared: $(LIB_SO)
|
|
|
|
$(BUILD)/tb_editor.o: src/tb_editor.c include/tb_editor.h internal/tb_editor_internal.h \
|
|
src/tb_stage_widget.h \
|
|
$(WIDGETS_DIR)/include/tb_editor_widgets.h \
|
|
$(IMG_DIR)/include/tb_editor_image.h \
|
|
../tinyblocks-graphics/include/tb_graphics.h \
|
|
../tinyblocks-variables/include/tb_variables.h \
|
|
../tinyblocks-blueprint/include/tb_blueprint.h \
|
|
../tinyblocks-environ/include/tb_environ.h \
|
|
../tinyblocks-api/include/tb_api.h \
|
|
../tinyblocks-libman/include/tb_libman.h \
|
|
../tinyblocks-syntax/include/tb_syntax.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
|
|
$(BUILD)/tb_stage_widget.o: src/tb_stage_widget.c src/tb_stage_widget.h \
|
|
../tinyblocks-graphics/include/tb_graphics.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
|
|
$(BUILD)/tb_editor_modules.o: src/tb_editor_modules.c internal/tb_editor_modules.h \
|
|
internal/tb_editor_internal.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
|
|
# Sempre delega para o make das libraries privadas (elas sabem o que mudou):
|
|
# assim o editor nunca fica com um modulo velho.
|
|
.PHONY: FORCE
|
|
FORCE:
|
|
|
|
$(WIDGETS_A): FORCE
|
|
$(MAKE) -C $(WIDGETS_DIR)
|
|
$(IMG_A): FORCE
|
|
$(MAKE) -C $(IMG_DIR)
|
|
|
|
$(LIB_A): $(OBJ) $(WIDGETS_A) $(IMG_A)
|
|
ar rcs $@ $(OBJ)
|
|
|
|
$(LIB_SO): $(OBJ)
|
|
$(CC) -shared -o $@ $^ -ldl
|
|
|
|
clean:
|
|
$(RM) -r $(BUILD)
|