Support Nugget and Jaby for make
This commit is contained in:
parent
61340f66c6
commit
0cadc7ff99
|
@ -42,7 +42,11 @@ LDFLAGS += -ltap
|
||||||
LDFLAGS += -lcd
|
LDFLAGS += -lcd
|
||||||
LDFLAGS += -Wl,--end-group
|
LDFLAGS += -Wl,--end-group
|
||||||
|
|
||||||
|
ifdef USE_JABY_MAKE
|
||||||
|
include Wrapper.mk
|
||||||
|
else
|
||||||
include $(PCSX_REDUX)/common.mk
|
include $(PCSX_REDUX)/common.mk
|
||||||
|
endif
|
||||||
|
|
||||||
fullclean: clean
|
fullclean: clean
|
||||||
rm -fr iso/Info/* bin/GlobalLBATable.bin
|
rm -fr iso/Info/* bin/GlobalLBATable.bin
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#this makefile translates from NUGGET make to JabyMake
|
||||||
|
ARTIFACT = JabyEngine
|
||||||
|
|
||||||
|
BUILD_DIR = bin
|
||||||
|
ifeq ($(BUILD),Release)
|
||||||
|
BUILD_PROFILE := release
|
||||||
|
else
|
||||||
|
BUILD_PROFILE := debug
|
||||||
|
endif
|
||||||
|
|
||||||
|
CCFLAGS_all := $(CPPFLAGS)
|
||||||
|
LIBS := $(LDFLAGS)
|
||||||
|
|
||||||
|
undefine CPPFLAGS
|
||||||
|
undefine LDFLAGS
|
||||||
|
undefine BUILD
|
||||||
|
|
||||||
|
#include the real make file
|
||||||
|
include ../Makefile
|
|
@ -28,7 +28,7 @@
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "make project",
|
"label": "nugget make",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"dependsOrder": "sequence",
|
"dependsOrder": "sequence",
|
||||||
"dependsOn": ["make", "finalize"],
|
"dependsOn": ["make", "finalize"],
|
||||||
|
@ -38,9 +38,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "new make",
|
"label": "jaby make",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "wsl make ${input:target} -f ../Makefile BUILD_PROFILE=${input:build_profile}",
|
"command": "wsl make ${input:target} BUILD=${input:build} USE_JABY_MAKE=true",
|
||||||
"options": {
|
"options": {
|
||||||
"cwd": "Code"
|
"cwd": "Code"
|
||||||
},
|
},
|
||||||
|
@ -100,10 +100,6 @@
|
||||||
"C_Cpp.default.compilerArgs": [
|
"C_Cpp.default.compilerArgs": [
|
||||||
],
|
],
|
||||||
"C_Cpp.default.defines": [
|
"C_Cpp.default.defines": [
|
||||||
],
|
]
|
||||||
"files.exclude": {
|
|
||||||
"**/*.o": true,
|
|
||||||
"**/*.dep": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
66
Makefile
66
Makefile
|
@ -1,13 +1,12 @@
|
||||||
ARTIFACT = JabyEngine
|
|
||||||
|
|
||||||
#Build architecture/variant string, possible values: x86, armv7le, etc...
|
#Build architecture/variant string, possible values: x86, armv7le, etc...
|
||||||
PLATFORM ?= x86_64
|
PLATFORM ?= PSX
|
||||||
|
|
||||||
#Build profile, possible values: release, debug, profile, coverage
|
#Build profile, possible values: release, debug, profile, coverage
|
||||||
|
BUILD_DIR ?= build
|
||||||
BUILD_PROFILE ?= debug
|
BUILD_PROFILE ?= debug
|
||||||
|
|
||||||
CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE)
|
CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE)
|
||||||
OUTPUT_DIR = build/$(CONFIG_NAME)
|
OUTPUT_DIR = $(BUILD_DIR)/$(CONFIG_NAME)
|
||||||
TARGET = $(OUTPUT_DIR)/$(ARTIFACT)
|
TARGET = $(OUTPUT_DIR)/$(ARTIFACT)
|
||||||
|
|
||||||
#Compiler definitions
|
#Compiler definitions
|
||||||
|
@ -20,19 +19,17 @@ PREFIX ?= mipsel-none-elf
|
||||||
FORMAT ?= elf32-littlemips
|
FORMAT ?= elf32-littlemips
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ROOTDIR = ../../../GIT/pcsx-redux/src/mips
|
$(info We currently only support normal linker scripts)
|
||||||
LDSCRIPT ?= $(ROOTDIR)/ps-exe.ld
|
LDSCRIPT ?= $(PCSX_REDUX)/ps-exe.ld
|
||||||
LDSCRIPT := $(addprefix $(ROOTDIR)/default.ld , -T$(LDSCRIPT))
|
LDSCRIPT := $(addprefix $(PCSX_REDUX)/default.ld , -T$(LDSCRIPT))
|
||||||
|
|
||||||
CC = $(PREFIX)-gcc-10
|
CC = $(PREFIX)-gcc-10
|
||||||
CXX = $(PREFIX)-g++-10
|
CXX = $(PREFIX)-g++-10
|
||||||
LD = $(CXX)
|
LD = $(CXX)
|
||||||
|
|
||||||
LIB_DEPS_NAMES = Qt_Obj
|
#architecture flags
|
||||||
LIB_DEPS_PATHES = ../QtXTObj/build/$(CONFIG_NAME)-Qt_Obj
|
ARCHFLAGS = -march=mips1 -mabi=32 -EL -fno-pic -mno-shared -mno-abicalls -mfp32
|
||||||
|
ARCHFLAGS += -fno-stack-protector -nostdlib -ffreestanding
|
||||||
#LIBS += -lsocket
|
|
||||||
#LIBS += -liconv
|
|
||||||
|
|
||||||
#Compiler flags for build profiles
|
#Compiler flags for build profiles
|
||||||
CCFLAGS_release += -O3
|
CCFLAGS_release += -O3
|
||||||
|
@ -40,11 +37,6 @@ CCFLAGS_debug += -O0 -fno-builtin
|
||||||
|
|
||||||
CXXFLAGS += -fno-exceptions -fno-rtti
|
CXXFLAGS += -fno-exceptions -fno-rtti
|
||||||
|
|
||||||
#Generic compiler flags (which include build type flags)
|
|
||||||
ARCHFLAGS = -march=mips1 -mabi=32 -EL -fno-pic -mno-shared -mno-abicalls -mfp32
|
|
||||||
ARCHFLAGS += -fno-stack-protector -nostdlib -ffreestanding
|
|
||||||
|
|
||||||
|
|
||||||
USE_FUNCTION_SECTIONS ?= true
|
USE_FUNCTION_SECTIONS ?= true
|
||||||
ifeq ($(USE_FUNCTION_SECTIONS),true)
|
ifeq ($(USE_FUNCTION_SECTIONS),true)
|
||||||
CCFLAGS_all += -ffunction-sections
|
CCFLAGS_all += -ffunction-sections
|
||||||
|
@ -55,42 +47,10 @@ CCFLAGS_all += $(ARCHFLAGS)
|
||||||
|
|
||||||
CCFLAGS_all += $(CCFLAGS_$(BUILD_PROFILE))
|
CCFLAGS_all += $(CCFLAGS_$(BUILD_PROFILE))
|
||||||
|
|
||||||
################################################################
|
|
||||||
PSYQ_PATH ?= ../../../PSYQ/Converted
|
|
||||||
CCFLAGS_all += -I$(PSYQ_PATH)/Include
|
|
||||||
|
|
||||||
LIBS += -L$(PSYQ_PATH)/Lib
|
|
||||||
LIBS += -Wl,--start-group
|
|
||||||
LIBS += -lapi
|
|
||||||
LIBS += -lc
|
|
||||||
LIBS += -lc2
|
|
||||||
LIBS += -lcard
|
|
||||||
LIBS += -lcomb
|
|
||||||
LIBS += -lds
|
|
||||||
LIBS += -letc
|
|
||||||
LIBS += -lgpu
|
|
||||||
LIBS += -lgs
|
|
||||||
LIBS += -lgte
|
|
||||||
LIBS += -lgun
|
|
||||||
LIBS += -lhmd
|
|
||||||
LIBS += -lmath
|
|
||||||
LIBS += -lmcrd
|
|
||||||
LIBS += -lmcx
|
|
||||||
LIBS += -lpad
|
|
||||||
LIBS += -lpress
|
|
||||||
LIBS += -lsio
|
|
||||||
LIBS += -lsnd
|
|
||||||
LIBS += -lspu
|
|
||||||
LIBS += -ltap
|
|
||||||
LIBS += -lcd
|
|
||||||
LIBS += -Wl,--end-group
|
|
||||||
|
|
||||||
################################################################
|
|
||||||
|
|
||||||
#Linker flags
|
#Linker flags
|
||||||
LDFLAGS_release += -Os
|
LDFLAGS_release += -Os
|
||||||
|
|
||||||
LDFLAGS_all += -Wl,-Map=$(BINDIR)$(TARGET).map -nostdlib -T$(LDSCRIPT) -static -Wl,--gc-sections
|
LDFLAGS_all += -Wl,-Map=$(TARGET).map -nostdlib -T$(LDSCRIPT) -static -Wl,--gc-sections
|
||||||
LDFLAGS_all += $(ARCHFLAGS) -Wl,--oformat=$(FORMAT)
|
LDFLAGS_all += $(ARCHFLAGS) -Wl,--oformat=$(FORMAT)
|
||||||
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE))
|
LDFLAGS_all += $(LDFLAGS_$(BUILD_PROFILE))
|
||||||
|
|
||||||
|
@ -101,10 +61,6 @@ DEPS = -Wp,-MMD,$(@:%.o=%.d),-MT,$@
|
||||||
#Macro to expand files recursively: parameters $1 - directory, $2 - extension, i.e. cpp
|
#Macro to expand files recursively: parameters $1 - directory, $2 - extension, i.e. cpp
|
||||||
rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2))
|
rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2))
|
||||||
|
|
||||||
#Source list
|
|
||||||
SRCS += $(ROOTDIR)/common/crt0/crt0.s
|
|
||||||
SRCS += $(call rwildcard, src, c cpp)
|
|
||||||
|
|
||||||
#Object files list
|
#Object files list
|
||||||
OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(subst ..,super,$(basename $(SRCS)))))
|
OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(subst ..,super,$(basename $(SRCS)))))
|
||||||
|
|
||||||
|
@ -120,7 +76,7 @@ $(OUTPUT_DIR)/%.o: %.cpp
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
$(OUTPUT_DIR)/%.o: $$(subst super,..,%.s)
|
$(OUTPUT_DIR)/%.o: $$(subst super,..,%.s)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(CC) $(ARCHFLAGS) -I$(ROOTDIR) -g -c -o $@ $<
|
$(CC) $(ARCHFLAGS) -I$(PCSX_REDUX) -g -c -o $@ $<
|
||||||
$(info at is $@)
|
$(info at is $@)
|
||||||
$(info dollar is $<)
|
$(info dollar is $<)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue