Small MakeFile improvements

This commit is contained in:
jaby 2022-04-26 20:36:12 +02:00
parent 0cadc7ff99
commit bd32f9007a
1 changed files with 5 additions and 7 deletions

View File

@ -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)