#--------------------------------------------------------------------------------- .SUFFIXES: #--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITARM)),) $(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") endif TOPDIR ?= $(CURDIR) AMS := $(TOPDIR)/../../ include $(DEVKITARM)/base_rules AMSBRANCH := $(shell git symbolic-ref --short HEAD) AMSHASH := $(shell git rev-parse --short HEAD) AMSREV := $(AMSBRANCH)-$(AMSHASH) ifneq (, $(strip $(shell git status --porcelain 2>/dev/null))) AMSREV := $(AMSREV)-dirty endif define _bin2o bin2s $< | $(AS) -o $(@) echo "extern const u8" `(echo $( `(echo $(> `(echo $(> `(echo $( $(notdir $*.lst) $(OFILES_SRC) : $(HFILES_BIN) #--------------------------------------------------------------------------------- # you need a rule like this for each extension you use as binary data #--------------------------------------------------------------------------------- fusee_primary.bin.o fusee_primary_bin.h: fusee-primary.bin #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(_bin2o) sept_primary.bin.o sept_primary_bin.h: sept-primary.bin #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(_bin2o) sept_secondary.enc.o sept_secondary_enc.h: sept-secondary.enc #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(_bin2o) %.bin.o %_bin.h: %.bin #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(bin2o) %.bmp.o %_bmp.h: %.bmp #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(bin2o) %.kip.o %_kip.h: %.kip #--------------------------------------------------------------------------------- @echo $(notdir $<) @$(bin2o) -include $(DEPENDS) #--------------------------------------------------------------------------------------- endif #---------------------------------------------------------------------------------------