From 6c87ceb4d0f1914e7e2e96f2d4f982cc84e6f16f Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 24 Apr 2022 17:57:45 +0200 Subject: [PATCH] Make hello_world compile --- Code/NewMakefile | 52 ++++++++++++++++++++++++++++++--------- JabyEngine.code-workspace | 2 +- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/Code/NewMakefile b/Code/NewMakefile index 06360fa8..c7af070c 100644 --- a/Code/NewMakefile +++ b/Code/NewMakefile @@ -28,12 +28,6 @@ CC = $(PREFIX)-gcc-10 CXX = $(PREFIX)-g++-10 LD = $(CXX) -#User defined include/preprocessor flags and libraries -INCLUDES += -I../../../INCLUDE/ -INCLUDES += -I../../../LLVM/Include -INCLUDES += -I../../../../ExecutionEnvironment/EXTERNAL/INCLUDE -INCLUDES += -I../WindowsRuntime/Include - LIB_DEPS_NAMES = Qt_Obj LIB_DEPS_PATHES = ../QtXTObj/build/$(CONFIG_NAME)-Qt_Obj @@ -41,8 +35,8 @@ LIB_DEPS_PATHES = ../QtXTObj/build/$(CONFIG_NAME)-Qt_Obj #LIBS += -liconv #Compiler flags for build profiles -CCFLAGS_release += -g -O3 -CCFLAGS_debug += -g -O0 -fno-builtin +CCFLAGS_release += -O3 +CCFLAGS_debug += -O0 -fno-builtin CXXFLAGS += -fno-exceptions -fno-rtti @@ -61,6 +55,38 @@ CCFLAGS_all += $(ARCHFLAGS) 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 LDFLAGS_release += -Os @@ -85,11 +111,11 @@ OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(subst ..,super,$(basename $( #Compiling rule $(OUTPUT_DIR)/%.o: %.c @mkdir -p $(dir $@) - $(CC) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $< + $(CC) -c $(DEPS) -o $@ $(CCFLAGS_all) $(CCFLAGS) $< $(OUTPUT_DIR)/%.o: %.cpp @mkdir -p $(dir $@) - $(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CXXFLAGS) $< + $(CXX) -c $(DEPS) -o $@ $(CCFLAGS_all) $(CXXFLAGS) $< .SECONDEXPANSION: $(OUTPUT_DIR)/%.o: $$(subst super,..,%.s) @@ -102,8 +128,12 @@ $(OUTPUT_DIR)/%.o: $$(subst super,..,%.s) $(TARGET).elf: $(OBJS) $(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS) +# +$(TARGET).psexe: $(TARGET).elf + $(PREFIX)-objcopy $(addprefix -R , $(OVERLAYSECTION)) -O binary $< $@ + #Rules section for default compilation and linking -all: $(TARGET) +all: $(TARGET).psexe clean: rm -fr $(OUTPUT_DIR) diff --git a/JabyEngine.code-workspace b/JabyEngine.code-workspace index 2889cd7f..a30729ae 100644 --- a/JabyEngine.code-workspace +++ b/JabyEngine.code-workspace @@ -40,7 +40,7 @@ { "label": "Blubb", "type": "shell", - "command": "wsl make -f NewMakefile BUILD_PROFILE=release", + "command": "wsl make all -f NewMakefile BUILD_PROFILE=release", "options": { "cwd": "Code" },