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>
32 lines
766 B
Makefile
32 lines
766 B
Makefile
# Makefile da library png (categoria "PNG"); depende de libpng.
|
|
CC := gcc
|
|
BUILD := build
|
|
|
|
PNG_CFLAGS := $(shell pkg-config --cflags libpng 2>/dev/null)
|
|
PNG_LIBS := $(shell pkg-config --libs libpng 2>/dev/null)
|
|
|
|
CFLAGS := -std=c11 -O2 -Wall -Wextra -pedantic -fvisibility=hidden \
|
|
-D_POSIX_C_SOURCE=200809L -I../../include -Iinclude $(PNG_CFLAGS)
|
|
|
|
OBJ := $(BUILD)/tb_png.o
|
|
LIB_A := $(BUILD)/libtinyblocks-png.a
|
|
LIB_SO := $(BUILD)/libtinyblocks-png.so
|
|
|
|
.PHONY: all static shared clean
|
|
all: static shared
|
|
static: $(LIB_A)
|
|
shared: $(LIB_SO)
|
|
|
|
$(OBJ): src/tb_png.c include/tb_png.h
|
|
@mkdir -p $(BUILD)
|
|
$(CC) $(CFLAGS) -fPIC -c $< -o $@
|
|
|
|
$(LIB_A): $(OBJ)
|
|
ar rcs $@ $^
|
|
|
|
$(LIB_SO): $(OBJ)
|
|
$(CC) -shared -o $@ $^ $(PNG_LIBS)
|
|
|
|
clean:
|
|
$(RM) -r $(BUILD)
|