2024-03-28 16:46:43 +08:00
|
|
|
|
|
|
|
.SILENT:
|
|
|
|
|
|
|
|
|
|
|
|
FLAGS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
|
|
|
SELF_DIR = $(dir $@)
|
|
|
|
|
|
|
|
export RM = rm
|
|
|
|
export CP = cp
|
|
|
|
|
|
|
|
export AR1 := $(AR)
|
|
|
|
export AS1 := $(AS)
|
|
|
|
export CC1 := $(CC)
|
|
|
|
export CXX1 := $(CXX)
|
|
|
|
export LD1 := $(CC)
|
|
|
|
|
|
|
|
export AR = echo " AR $<" && $(AR1)
|
|
|
|
export AS = echo " AS $^" && $(AS1)
|
|
|
|
export CC = echo " CC $^" && $(CC1)
|
|
|
|
export CXX = echo " CXX $^" && $(CXX1)
|
|
|
|
export LD = echo " LD $@" && $(LD1)
|
|
|
|
export FASM = echo " FASM $^" && fasm >/dev/null
|
|
|
|
|
|
|
|
|
|
|
|
# halt&cache fire if windows
|
|
|
|
ifneq (, $(findstring mingw,$(shell $(CC1) -dumpmachine)))
|
|
|
|
export Platform_CXXFLAGS := -DSFML_STATIC
|
|
|
|
export Platform_LDFLAGS :=
|
|
|
|
export Platform_LDLIBS := -lgdi32 -limm32 -lwinmm
|
|
|
|
export Platform_INCLUDEFLAGS :=
|
|
|
|
else
|
|
|
|
export Platform_CXXFLAGS :=
|
|
|
|
export Platform_LDFLAGS :=
|
|
|
|
export Platform_LDLIBS := -lGL
|
|
|
|
export Platform_INCLUDEFLAGS :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
export INCLUDEFLAGS := $(Platform_INCLUDEFLAGS)
|
|
|
|
|
|
|
|
export CPPFLAGS = -DIMGUI_USER_CONFIG=\"../imgui-sfml/imconfig-SFML.h\"
|
2024-03-30 17:19:32 +08:00
|
|
|
export CFLAGS = $(INCLUDEFLAGS) $(BUILD_OPTIONS) -Wno-attributes -g
|
|
|
|
export CXXFLAGS = $(INCLUDEFLAGS) -DHELOS $(BUILD_OPTIONS) $(Platform_CXXFLAGS) -Wno-unused-result -std=c++17 -g
|
|
|
|
export LDFLAGS = $(Platform_LDFLAGS) -g
|
2024-03-28 16:46:43 +08:00
|
|
|
export LDLIBS = $(Platform_LDLIBS) -lsfml-graphics -lsfml-window -lsfml-system -lm -lstdc++
|
|
|
|
|
|
|
|
# Pattern rule for FASM assembly
|
|
|
|
%.o: %.S
|
|
|
|
$(FASM) $^ $@
|
|
|
|
|