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))
|
||||
|
||||
#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)
|
||||
|
|
Loading…
Reference in New Issue