2026-11-13 03:29:59 +08:00
|
|
|
#WARN: no incremental build supported yet (use 'all' target carefully)
|
|
|
|
|
|
2026-11-23 15:12:07 +08:00
|
|
|
.PHONY: clean all rebuild
|
|
|
|
|
.DEFAULT_GOAL := all
|
2026-11-13 03:29:59 +08:00
|
|
|
|
|
|
|
|
BIN_TARGET := $(BIN_DIR)/$(TARGET)
|
|
|
|
|
|
|
|
|
|
CC := clang
|
|
|
|
|
CXX := clang++
|
|
|
|
|
LINK := clang++
|
|
|
|
|
CFLAGS := $(CFLAGS) -pipe -fvisibility=hidden -DNDEBUG -O3 -gdwarf-2 -target $(ARCH) -Wall -W -fPIC $(DEFINES)
|
2026-11-23 17:19:16 +08:00
|
|
|
CXXFLAGS := $(CXXFLAGS) $(CFLAGS) -std=c++11 -fvisibility-inlines-hidden -fno-stack-protector -fno-builtin -Wno-reorder -Wno-switch -Wno-unused-parameter -Wno-unused-variable
|
|
|
|
|
# Linux 目标统一按 Ultimate 版编译:授权/序列号子系统(LicensingManager、-lf 授权参数文件、
|
|
|
|
|
# 密钥对与密钥库)只在 ULTIMATE 分支里编译,其余版本打包时会报
|
|
|
|
|
# "The licensing system not supported in this version"。追加而不是改 $(DEFINES),避免覆盖各目标的宏。
|
|
|
|
|
CFLAGS += -DULTIMATE
|
|
|
|
|
CXXFLAGS += -DULTIMATE
|
|
|
|
|
|
2026-11-13 03:29:59 +08:00
|
|
|
LFLAGS := $(LFLAGS) -Wl,--as-needed -std=c++11 -target $(ARCH)
|
|
|
|
|
SDK_LIBS :=
|
|
|
|
|
SLIBFLAGS := -crs
|
|
|
|
|
COPY_FILE := cp -f
|
|
|
|
|
COPY_DIR := cp -f -R
|
|
|
|
|
|
|
|
|
|
DEL_FILE := rm -f
|
|
|
|
|
DEL_DIR := rm -rf --
|
|
|
|
|
|
|
|
|
|
HPCH := precompiled.h
|
|
|
|
|
PCH_CPP := $(PCH_DIR)/$(HPCH).gch
|
|
|
|
|
INCFLAGS := -I ./ $(INCFLAGS)
|
|
|
|
|
|
|
|
|
|
.PRECIOUS: %/.sentinel
|
|
|
|
|
%/.sentinel:
|
|
|
|
|
test -e $(abspath $@) || (mkdir -p $(abspath ${@D}/) && touch $(abspath $@))
|
|
|
|
|
|
|
|
|
|
rebuild: clean all
|
|
|
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
|
|
all:: $(BIN_TARGET)
|
|
|
|
|
|
|
|
|
|
$(PCH_CPP): precompiled.h $(PCH_DIR)/.sentinel
|
|
|
|
|
$(CXX) $(CXXFLAGS) $(INCFLAGS) -x c++-header -c precompiled.cc -o $(PCH_CPP)
|