try fixing flake

This commit is contained in:
2026-07-26 18:29:13 +01:00
parent a9054b3be4
commit 1935be52ac
5 changed files with 161 additions and 54 deletions
+16 -17
View File
@@ -19,6 +19,11 @@ SDL_CFLAGS := $(shell pkg-config --cflags sdl3 sdl3-ttf sdl3-image)
SDL_LIBS_DEBUG := $(shell pkg-config --libs sdl3 sdl3-ttf sdl3-image)
SDL_LIBS_RELEASE := $(shell pkg-config --libs sdl3 sdl3-ttf sdl3-image)
# ----------------- MRUBY --------------
MRUBY_CFLAGS := -I$(MRUBY_INCLUDE)
MRUBY_LIBS := $(MRUBY_LIB)
# ---------------- FLAGS ----------------
CFLAGS_DEBUG := \
@@ -26,25 +31,19 @@ CFLAGS_DEBUG := \
-Og -g -fno-omit-frame-pointer \
-Wno-unused-command-line-argument \
-I./include -I./libs/mruby/build/host/include \
$(SDL_CFLAGS)
$(SDL_CFLAGS) $(MRUBY_CFLAGS)
CFLAGS_RELEASE := \
-std=c++20 -O3 -march=x86-64 -mtune=generic \
-std=c++20 -O3 -mtune=generic \
-flto=thin \
-fno-rtti -fomit-frame-pointer -DNDEBUG -s \
-Wno-unused-command-line-argument \
-I./include -I./libs/mruby/build/host/include \
$(SDL_CFLAGS)
$(SDL_CFLAGS) $(MRUBY_CFLAGS)
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header
# ---------------- LIBS ----------------
LIBS := ./libs/mruby/build/host/lib/libmruby.a
MGEM_DIR := ./libs/l_mgems
# ---------------- SOURCES ----------------
SRC := $(shell find $(SRC_DIR) -name "*.cc")
@@ -57,18 +56,18 @@ DEP_RELEASE := $(OBJ_RELEASE:.o=.d)
# ---------------- TARGETS ----------------
.PHONY: all debug release clean mgems
.PHONY: all debug release clean scripts
all: debug
debug: mgems $(TARGET_DEBUG)
debug: scripts $(TARGET_DEBUG)
release: mgems $(TARGET_RELEASE)
release: scripts $(TARGET_RELEASE)
# ---------------- MRB_MGEMS ----------------
mgems:
@$(MGEM_DIR)/compile.sh
scripts:
./scripts/compile.sh
# ---------------- PCH ----------------
@@ -86,12 +85,12 @@ $(PCH_RELEASE): $(INCLUDE_DIR)/pch.h
$(TARGET_DEBUG): $(PCH_DEBUG) $(OBJ_DEBUG)
@mkdir -p $(BIN_DIR)
@$(CXX) $(CFLAGS_DEBUG) -o $@ $(OBJ_DEBUG) $(SDL_LIBS_DEBUG) $(LIBS)
@$(CXX) $(CFLAGS_DEBUG) -o $@ $(OBJ_DEBUG) $(SDL_LIBS_DEBUG) $(MRUBY_LIBS)
@echo "Debug build complete: $@"
$(TARGET_RELEASE): $(PCH_RELEASE) $(OBJ_RELEASE)
@mkdir -p $(BIN_DIR)
@$(CXX) $(CFLAGS_RELEASE) -o $@ $(OBJ_RELEASE) $(SDL_LIBS_RELEASE) $(LIBS)
@$(CXX) $(CFLAGS_RELEASE) -o $@ $(OBJ_RELEASE) $(SDL_LIBS_RELEASE) $(MRUBY_LIBS)
@echo "Release build complete: $@"
# ---------------- COMPILE ----------------
@@ -115,5 +114,5 @@ $(OBJ_DIR)/release/%.o: $(SRC_DIR)/%.cc $(PCH_RELEASE)
clean:
@rm -rf $(OBJ_DIR) $(BIN_DIR)
@$(MGEM_DIR)/compile.sh clean
./compile.sh clean
@echo "Cleaned build artifacts."