mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-08 14:56:12 -04:00
Redo xbox makefile
This commit is contained in:
parent
3f9627b776
commit
5d0c9295ca
1
.github/workflows/build_xbox.yml
vendored
1
.github/workflows/build_xbox.yml
vendored
@ -25,7 +25,6 @@ jobs:
|
||||
apk add curl curl-dev
|
||||
eval $(/usr/src/nxdk/bin/activate -s)
|
||||
make xbox
|
||||
cp bin/default.xbe ClassiCube-xbox.xbe
|
||||
|
||||
|
||||
- uses: ./.github/actions/notify_failure
|
||||
|
@ -35,7 +35,7 @@ INCLUDES := third_party/bearssl/inc
|
||||
|
||||
APP_TITLE := ClassiCube
|
||||
APP_AUTHOR := ClassiCube team
|
||||
APP_ICON := misc/switch/icon.jpg
|
||||
APP_ICON := $(TOPDIR)/misc/switch/icon.jpg
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
|
@ -2,12 +2,120 @@ ifeq ($(strip $(NXDK_DIR)),)
|
||||
$(error "Please set NXDK_DIR in your environment")
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Configurable options
|
||||
#---------------------------------------------------------------------------------
|
||||
TARGET = ClassiCube-xbox
|
||||
XBE_TITLE = ClassiCube
|
||||
GEN_XISO = ClassiCube-xbox.iso
|
||||
SRCS = $(wildcard src/*.c) $(wildcard third_party/bearssl/src/*.c)
|
||||
SOURCE_DIRS = src third_party/bearssl/src
|
||||
SHADER_OBJS = misc/xbox/vs_coloured.inl misc/xbox/vs_textured.inl misc/xbox/ps_coloured.inl misc/xbox/ps_textured.inl
|
||||
NXDK_NET = y
|
||||
NXDK_CFLAGS = -Ithird_party/bearssl/inc -O1
|
||||
NXDK_LDFLAGS = -stack:196608
|
||||
BUILD_DIR = build/xbox
|
||||
|
||||
include $(NXDK_DIR)/Makefile
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
S_FILES = $(foreach dir,$(SOURCE_DIRS),$(wildcard $(dir)/*.S))
|
||||
C_FILES = $(foreach dir,$(SOURCE_DIRS),$(wildcard $(dir)/*.c))
|
||||
OBJS = $(addprefix $(BUILD_DIR)/, $(notdir $(C_FILES:%.c=%.o) $(S_FILES:%.S=%.o)))
|
||||
|
||||
CFLAGS = -Ithird_party/bearssl/inc -O1 \
|
||||
-I$(NXDK_DIR)/lib/net/lwip/src/include \
|
||||
-I$(NXDK_DIR)/lib/net/nforceif/include \
|
||||
-I$(NXDK_DIR)/lib/net/nvnetdrv \
|
||||
-I$(NXDK_DIR)/lib/usb/libusbohci/inc \
|
||||
-I$(NXDK_DIR)/lib/usb/libusbohci_xbox/ \
|
||||
-DUSBH_USE_EXTERNAL_CONFIG=\"usbh_config_xbox.h\"
|
||||
|
||||
LDFLAGS = -stack:196608 \
|
||||
$(NXDK_DIR)/lib/libnxdk.lib \
|
||||
$(NXDK_DIR)/lib/libnxdk_hal.lib \
|
||||
$(NXDK_DIR)/lib/libnxdk_net.lib \
|
||||
$(NXDK_DIR)/lib/libpbkit.lib \
|
||||
$(NXDK_DIR)/lib/libpdclib.lib \
|
||||
$(NXDK_DIR)/lib/libxboxrt.lib \
|
||||
$(NXDK_DIR)/lib/libwinapi.lib \
|
||||
$(NXDK_DIR)/lib/nxdk_usb.lib \
|
||||
$(NXDK_DIR)/lib/xboxkrnl/libxboxkrnl.lib
|
||||
|
||||
# Dependency tracking
|
||||
DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILD_DIR)/$*.d
|
||||
DEPFILES := $(OBJS:%.o=%.d)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Tools finder
|
||||
#---------------------------------------------------------------------------------
|
||||
UNAME_M := $(shell uname -m)
|
||||
|
||||
ifneq ($(UNAME_M),x86_64)
|
||||
CGC = $(NXDK_DIR)/tools/cg/linux/cgc.i386
|
||||
else
|
||||
CGC = $(NXDK_DIR)/tools/cg/linux/cgc
|
||||
endif
|
||||
# NOTE: Linux only. Will need to modify for other platforms
|
||||
|
||||
CXBE = $(NXDK_DIR)/tools/cxbe/cxbe
|
||||
VP20COMPILER = $(NXDK_DIR)/tools/vp20compiler/vp20compiler
|
||||
FP20COMPILER = $(NXDK_DIR)/tools/fp20compiler/fp20compiler
|
||||
EXTRACT_XISO = $(NXDK_DIR)/tools/extract-xiso/build/extract-xiso
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Main targets
|
||||
#---------------------------------------------------------------------------------
|
||||
default: $(BUILD_DIR) $(TARGET).iso
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET).iso $(TARGET).xbe $(TARGET).exe $(OBJS) $(SHADER_OBJS) $(DEPFILES)
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir -p $(BUILD_DIR)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Executable generation
|
||||
#---------------------------------------------------------------------------------
|
||||
$(OBJS) : $(SHADER_OBJS)
|
||||
|
||||
$(TARGET).iso: $(TARGET).xbe
|
||||
mkdir -p $(BUILD_DIR)/cd
|
||||
cp $(TARGET).xbe $(BUILD_DIR)/cd/default.xbe
|
||||
$(EXTRACT_XISO) -c $(BUILD_DIR)/cd $(XISO_FLAGS) $@
|
||||
|
||||
$(TARGET).xbe: $(TARGET).exe
|
||||
$(CXBE) -OUT:$@ -TITLE:$(XBE_TITLE) $<
|
||||
|
||||
$(TARGET).exe : $(OBJS)
|
||||
nxdk-link $(NXDK_LDFLAGS) $(LDFLAGS) -out:$@ $^
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Object generation
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BUILD_DIR)/%.o: src/%.c
|
||||
nxdk-cc $(NXDK_CFLAGS) $(CFLAGS) $(DEPFLAGS) -c $< -o $@
|
||||
|
||||
$(BUILD_DIR)/%.o: src/%.S
|
||||
nxdk-as $(NXDK_ASFLAGS) $(ASFLAGS) $(DEPFLAGS) -c $< -o $@
|
||||
|
||||
$(BUILD_DIR)/%.o: third_party/bearssl/src/%.c
|
||||
nxdk-cc $(NXDK_CFLAGS) $(CFLAGS) -c $< -o $@
|
||||
|
||||
%.inl: %.vs.cg
|
||||
$(CGC) -profile vp20 -o $@.$$$$ $< && \
|
||||
$(VP20COMPILER) $@.$$$$ > $@ && \
|
||||
rm -rf $@.$$$$
|
||||
|
||||
%.inl: %.ps.cg
|
||||
$(CGC) -profile fp20 -o $@.$$$$ $< && \
|
||||
$(FP20COMPILER) $@.$$$$ > $@ && \
|
||||
rm -rf $@.$$$$
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Dependency tracking
|
||||
#---------------------------------------------------------------------------------
|
||||
$(DEPFILES):
|
||||
|
||||
include $(wildcard $(DEPFILES))
|
||||
|
Loading…
x
Reference in New Issue
Block a user