WiiUPluginSystem/share/wups_rules
2020-04-29 17:53:53 +02:00

39 lines
1.2 KiB
Plaintext

#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitPro")
endif
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>/devkitPro/devkitPPC")
endif
include $(DEVKITPPC)/base_rules
PORTLIBS := $(PORTLIBS_PATH)/wiiu $(PORTLIBS_PATH)/ppc
export PATH := $(PORTLIBS_PATH)/wiiu/bin:$(PORTLIBS_PATH)/ppc/bin:$(PATH)
WUPS_ROOT ?= $(DEVKITPRO)/wups
WUPSSPECS := -specs=$(WUPS_ROOT)/share/wups.specs
MACHDEP = -DESPRESSO -mcpu=750 -meabi -mhard-float
#---------------------------------------------------------------------------------
%.wps: %.elf
@cp $< $*.strip.elf
@$(STRIP) -g $*.strip.elf
@elf2rpl $*.strip.elf $@
@printf '\xDE\xAD' | dd of=$@ bs=1 seek=9 count=2 conv=notrunc status=none
@rm $*.strip.elf
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.elf:
@echo linking ... $(notdir $@)
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
@$(NM) -CSn $@ > $(notdir $*.lst)