From bd32f9007ad1ab721c1eba212ca62b3a50f2ca93 Mon Sep 17 00:00:00 2001 From: jaby Date: Tue, 26 Apr 2022 20:36:12 +0200 Subject: [PATCH] Small MakeFile improvements --- Makefile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e479d2f6..7055ae95 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ DEPS = -Wp,-MMD,$(@:%.o=%.d),-MT,$@ rwildcard = $(wildcard $(addprefix $1/*.,$2)) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2)) #Object files list -OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(subst ..,super,$(basename $(SRCS))))) +OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(subst ..,!super,$(basename $(SRCS))))) #Compiling rule $(OUTPUT_DIR)/%.o: %.c @@ -74,22 +74,20 @@ $(OUTPUT_DIR)/%.o: %.cpp $(CXX) -c $(DEPS) -o $@ $(CCFLAGS_all) $(CXXFLAGS) $< .SECONDEXPANSION: -$(OUTPUT_DIR)/%.o: $$(subst super,..,%.s) +$(OUTPUT_DIR)/%.o: $$(subst !super,..,%.s) @mkdir -p $(dir $@) $(CC) $(ARCHFLAGS) -I$(PCSX_REDUX) -g -c -o $@ $< - $(info at is $@) - $(info dollar is $<) #Linking rule $(TARGET).elf: $(OBJS) $(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) $(LIBS_all) $(LIBS) -# -$(TARGET).psexe: $(TARGET).elf +#Strips the psexe +$(TARGET).ps-exe: $(TARGET).elf $(PREFIX)-objcopy $(addprefix -R , $(OVERLAYSECTION)) -O binary $< $@ #Rules section for default compilation and linking -all: $(TARGET).psexe +all: $(TARGET).ps-exe clean: rm -fr $(OUTPUT_DIR)