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).
This commit is contained in:
1 parent
90d47bf8a0
commit
dc23b92d15
48 files changed
+2405
-744
No files matched your search
@@ -1,30 +1,34 @@
|
||||
CC := gcc
|
||||
CFLAGS := -std=c11 -Wall -Wextra -pedantic -fvisibility=hidden \
|
||||
-I../../include \
|
||||
$(shell sdl2-config --cflags)
|
||||
LDFLAGS := $(shell sdl2-config --libs)
|
||||
# Makefile da library sdl2 (backend grafico SDL2)
|
||||
# Constroi build/libtinyblocks-sdl2.a e build/libtinyblocks-sdl2.so
|
||||
CC := gcc
|
||||
BUILD := build
|
||||
|
||||
BUILD := ../../build
|
||||
LIB_SO := $(BUILD)/libtinyblocks-sdl2.so
|
||||
LIB_A := $(BUILD)/libtinyblocks-sdl2.a
|
||||
OBJ := $(BUILD)/tb_sdl2.o
|
||||
SDL2_CFLAGS := $(shell sdl2-config --cflags)
|
||||
SDL2_LIBS := $(shell sdl2-config --libs)
|
||||
|
||||
.PHONY: all clean shared static
|
||||
CFLAGS := -std=c11 -Wall -Wextra -pedantic -fvisibility=hidden \
|
||||
-I../../include -I../tinyblocks-graphics/include -Iinclude \
|
||||
$(SDL2_CFLAGS)
|
||||
LDFLAGS := $(SDL2_LIBS) -lm
|
||||
|
||||
all: shared static
|
||||
OBJ := $(BUILD)/tb_sdl2.o
|
||||
LIB_A := $(BUILD)/libtinyblocks-sdl2.a
|
||||
LIB_SO := $(BUILD)/libtinyblocks-sdl2.so
|
||||
|
||||
shared: $(LIB_SO)
|
||||
.PHONY: all static shared clean
|
||||
all: static shared
|
||||
static: $(LIB_A)
|
||||
shared: $(LIB_SO)
|
||||
|
||||
$(OBJ): src/tb_sdl2.c include/tb_sdl2.h
|
||||
$(OBJ): src/tb_sdl2.c include/tb_sdl2.h ../tinyblocks-graphics/include/tb_graphics.h
|
||||
@mkdir -p $(BUILD)
|
||||
$(CC) $(CFLAGS) -fPIC -c src/tb_sdl2.c -o $@
|
||||
|
||||
$(LIB_SO): $(OBJ)
|
||||
$(CC) -shared -o $@ $^ $(LDFLAGS)
|
||||
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
||||
|
||||
$(LIB_A): $(OBJ)
|
||||
ar rcs $@ $^
|
||||
|
||||
$(LIB_SO): $(OBJ)
|
||||
$(CC) -shared -o $@ $^ $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJ) $(LIB_SO) $(LIB_A)
|
||||
$(RM) -r $(BUILD)
|
||||
Reference in new issue
Block a user