Files
T
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

33 lines
928 B
Makefile

# Makefile da library csv (divisor + 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_csv.o
LIB_A := $(BUILD)/libtinyblocks-csv.a
LIB_SO := $(BUILD)/libtinyblocks-csv.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_csv.o: src/tb_csv.c include/tb_csv.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)