*** empty log message ***

This commit is contained in:
Dave Murphy 2005-08-01 23:36:04 +00:00
parent eb97b2f71e
commit 94184de5fc
2 changed files with 20 additions and 14 deletions

View File

@ -10,6 +10,7 @@ PREFIX := arm-elf-
export CC := $(PREFIX)gcc export CC := $(PREFIX)gcc
export CXX := $(PREFIX)g++ export CXX := $(PREFIX)g++
export AS := $(PREFIX)as
export AR := $(PREFIX)ar export AR := $(PREFIX)ar
export OBJCOPY := $(PREFIX)objcopy export OBJCOPY := $(PREFIX)objcopy
@ -44,15 +45,11 @@ export OBJCOPY := $(PREFIX)objcopy
# canned command sequence for binary data # canned command sequence for binary data
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
define bin2o define bin2o
padbin 4 $(<) bin2s $< | $(AS) $(ARCH) -o $(@)
$(OBJCOPY) -I binary -O elf32-littlearm -B arm \ echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
--rename-section .data=.rodata,readonly,data,contents,alloc \ echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
--redefine-sym _binary_`(echo $(<) | sed -e 's/^\/\([a-zA-Z]\/\)/\1_/' | tr . _ | tr / _)`_start=`(echo $(<F) | tr . _)`\ echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_len[]";" >> `(echo $(<F) | tr . _)`.h
--redefine-sym _binary_`(echo $(<) | sed -e 's/^\/\([a-zA-Z]\/\)/\1_/' | tr . _ | tr / _)`_end=`(echo $(<F) | tr . _)`_end\ echo "#define" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_size (u32)"`(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_len >> `(echo $(<F) | tr . _)`.h
--redefine-sym _binary_`(echo $(<) | sed -e 's/^\/\([a-zA-Z]\/\)/\1_/' | tr . _ | tr / _)`_size=`(echo $(<F) | tr . _)`_size\
$(<) $(@)
echo "extern const u32" `(echo $(<F) | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
echo "extern const u8" `(echo $(<F) | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
echo "extern const u32" `(echo $(<F) | tr . _)`_size[]";" >> `(echo $(<F) | tr . _)`.h
endef endef

View File

@ -1,4 +1,8 @@
-include $(DEVKITARM)/base_rules ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
endif
include $(DEVKITARM)/base_rules
LIBNDS := $(DEVKITPRO)/libnds LIBNDS := $(DEVKITPRO)/libnds
@ -8,16 +12,21 @@ LIBNDS := $(DEVKITPRO)/libnds
@echo built ... $(notdir $@) @echo built ... $(notdir $@)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%.nds: %.bin %.nds: %.arm9
@ndstool -c $@ -9 $< @ndstool -c $@ -9 $<
@echo built ... $(notdir $@) @echo built ... $(notdir $@)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%.bin: %.elf %.arm9: %.elf
@$(OBJCOPY) -O binary $< $@ @$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@) @echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.arm7: %.elf
@$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@)
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%.elf: %.elf:
@echo linking binary @echo linking $(notdir $@)
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@ @$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@