Small MakeFile improvements
This commit is contained in:
parent
0cadc7ff99
commit
bd32f9007a
12
Makefile
12
Makefile
|
@ -62,7 +62,7 @@ DEPS = -Wp,-MMD,$(@:%.o=%.d),-MT,$@
|
||||||
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))
|
||||||
|
|
||||||
#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)))))
|
||||||
|
|
||||||
#Compiling rule
|
#Compiling rule
|
||||||
$(OUTPUT_DIR)/%.o: %.c
|
$(OUTPUT_DIR)/%.o: %.c
|
||||||
|
@ -74,22 +74,20 @@ $(OUTPUT_DIR)/%.o: %.cpp
|
||||||
$(CXX) -c $(DEPS) -o $@ $(CCFLAGS_all) $(CXXFLAGS) $<
|
$(CXX) -c $(DEPS) -o $@ $(CCFLAGS_all) $(CXXFLAGS) $<
|
||||||
|
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
$(OUTPUT_DIR)/%.o: $$(subst super,..,%.s)
|
$(OUTPUT_DIR)/%.o: $$(subst !super,..,%.s)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(CC) $(ARCHFLAGS) -I$(PCSX_REDUX) -g -c -o $@ $<
|
$(CC) $(ARCHFLAGS) -I$(PCSX_REDUX) -g -c -o $@ $<
|
||||||
$(info at is $@)
|
|
||||||
$(info dollar is $<)
|
|
||||||
|
|
||||||
#Linking rule
|
#Linking rule
|
||||||
$(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)
|
||||||
|
|
||||||
#
|
#Strips the psexe
|
||||||
$(TARGET).psexe: $(TARGET).elf
|
$(TARGET).ps-exe: $(TARGET).elf
|
||||||
$(PREFIX)-objcopy $(addprefix -R , $(OVERLAYSECTION)) -O binary $< $@
|
$(PREFIX)-objcopy $(addprefix -R , $(OVERLAYSECTION)) -O binary $< $@
|
||||||
|
|
||||||
#Rules section for default compilation and linking
|
#Rules section for default compilation and linking
|
||||||
all: $(TARGET).psexe
|
all: $(TARGET).ps-exe
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr $(OUTPUT_DIR)
|
rm -fr $(OUTPUT_DIR)
|
||||||
|
|
Loading…
Reference in New Issue