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>
33 lines
928 B
Makefile
33 lines
928 B
Makefile
# Makefile da library xml (lexer + parser + emissor sobre a AST JSON do core)
|
|
CC := gcc
|
|
BUILD := build
|
|
CFLAGS := -std=c11 -O2 -Wall -Wextra -pedantic -fvisibility=hidden \
|
|
-D_POSIX_C_SOURCE=200809L -I../../include -Iinclude
|
|
|
|
OBJS := $(BUILD)/lexer.o $(BUILD)/parser.o $(BUILD)/tb_xml.o
|
|
LIB_A := $(BUILD)/libtinyblocks-xml.a
|
|
LIB_SO := $(BUILD)/libtinyblocks-xml.so
|
|
|
|
.PHONY: all static shared clean
|
|
all: static shared
|
|
static: $(LIB_A)
|
|
shared: $(LIB_SO)
|
|
|
|
$(BUILD)/lexer.o: src/lexer.c include/lexeme.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
$(BUILD)/parser.o: src/parser.c include/ast.h include/lexeme.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
$(BUILD)/tb_xml.o: src/tb_xml.c include/tb_xml.h include/ast.h include/lexeme.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
|
|
$(LIB_A): $(OBJS)
|
|
ar rcs $@ $^
|
|
$(LIB_SO): $(OBJS)
|
|
$(CC) -shared -o $@ $^
|
|
|
|
clean:
|
|
$(RM) -r $(BUILD)
|