Make hello_world compile

This commit is contained in:
jaby 2022-04-24 17:57:45 +02:00
parent d10cc24419
commit bcdce9873b
2 changed files with 42 additions and 12 deletions

View File

@ -28,12 +28,6 @@ CC = $(PREFIX)-gcc-10
CXX = $(PREFIX)-g++-10 CXX = $(PREFIX)-g++-10
LD = $(CXX) 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_NAMES = Qt_Obj
LIB_DEPS_PATHES = ../QtXTObj/build/$(CONFIG_NAME)-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 #LIBS += -liconv
#Compiler flags for build profiles #Compiler flags for build profiles
CCFLAGS_release += -g -O3 CCFLAGS_release += -O3
CCFLAGS_debug += -g -O0 -fno-builtin CCFLAGS_debug += -O0 -fno-builtin
CXXFLAGS += -fno-exceptions -fno-rtti CXXFLAGS += -fno-exceptions -fno-rtti
@ -61,6 +55,38 @@ 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
@ -85,11 +111,11 @@ OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(subst ..,super,$(basename $(
#Compiling rule #Compiling rule
$(OUTPUT_DIR)/%.o: %.c $(OUTPUT_DIR)/%.o: %.c
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(CC) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CCFLAGS) $< $(CC) -c $(DEPS) -o $@ $(CCFLAGS_all) $(CCFLAGS) $<
$(OUTPUT_DIR)/%.o: %.cpp $(OUTPUT_DIR)/%.o: %.cpp
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(CXX) -c $(DEPS) -o $@ $(INCLUDES) $(CCFLAGS_all) $(CXXFLAGS) $< $(CXX) -c $(DEPS) -o $@ $(CCFLAGS_all) $(CXXFLAGS) $<
.SECONDEXPANSION: .SECONDEXPANSION:
$(OUTPUT_DIR)/%.o: $$(subst super,..,%.s) $(OUTPUT_DIR)/%.o: $$(subst super,..,%.s)
@ -102,8 +128,12 @@ $(OUTPUT_DIR)/%.o: $$(subst super,..,%.s)
$(TARGET).elf: $(OBJS) $(TARGET).elf: $(OBJS)
$(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS) $(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 #Rules section for default compilation and linking
all: $(TARGET) all: $(TARGET).psexe
clean: clean:
rm -fr $(OUTPUT_DIR) rm -fr $(OUTPUT_DIR)

View File

@ -40,7 +40,7 @@
{ {
"label": "Blubb", "label": "Blubb",
"type": "shell", "type": "shell",
"command": "wsl make -f NewMakefile BUILD_PROFILE=release", "command": "wsl make all -f NewMakefile BUILD_PROFILE=release",
"options": { "options": {
"cwd": "Code" "cwd": "Code"
}, },