Fix nix flake and use gcc as compiler
This commit is contained in:
@@ -4,15 +4,14 @@ OBJ_DIR := build
|
||||
INCLUDE_DIR := include
|
||||
SCRIPT_DIR := scripts
|
||||
|
||||
TARGET_DEBUG := $(BIN_DIR)/game-dbg
|
||||
TARGET_RELEASE := $(BIN_DIR)/game
|
||||
TARGET_DEBUG := $(BIN_DIR)/misth-dbg
|
||||
TARGET_RELEASE := $(BIN_DIR)/misth
|
||||
|
||||
PCH_DEBUG := $(OBJ_DIR)/debug/pch.h.gch
|
||||
PCH_RELEASE := $(OBJ_DIR)/release/pch.h.gch
|
||||
|
||||
CCACHE := ccache
|
||||
CXX := $(CCACHE) $(shell which clang++)
|
||||
CC := $(CCACHE) $(shell which clang)
|
||||
CC ?= gcc
|
||||
CXX ?= g++
|
||||
|
||||
# ---------------- SDL3 ----------------
|
||||
|
||||
@@ -36,7 +35,6 @@ CFLAGS_DEBUG := \
|
||||
|
||||
CFLAGS_RELEASE := \
|
||||
-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 \
|
||||
@@ -59,7 +57,7 @@ DEP_RELEASE := $(OBJ_RELEASE:.o=.d)
|
||||
|
||||
.PHONY: all debug release clean scripts
|
||||
|
||||
all: debug
|
||||
all: release
|
||||
|
||||
debug: scripts $(TARGET_DEBUG)
|
||||
|
||||
@@ -68,7 +66,7 @@ release: scripts $(TARGET_RELEASE)
|
||||
# ---------------- MRB_MGEMS ----------------
|
||||
|
||||
scripts:
|
||||
$(SCRIPT_DIR)/compile.sh
|
||||
bash $(SCRIPT_DIR)/compile.sh
|
||||
|
||||
# ---------------- PCH ----------------
|
||||
|
||||
@@ -115,5 +113,5 @@ $(OBJ_DIR)/release/%.o: $(SRC_DIR)/%.cc $(PCH_RELEASE)
|
||||
|
||||
clean:
|
||||
@rm -rf $(OBJ_DIR) $(BIN_DIR)
|
||||
$(SCRIPT_DIR)/compile.sh clean
|
||||
bash $(SCRIPT_DIR)/compile.sh clean
|
||||
@echo "Cleaned build artifacts."
|
||||
|
||||
Reference in New Issue
Block a user