*** 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 CXX := $(PREFIX)g++
export AS := $(PREFIX)as
export AR := $(PREFIX)ar
export OBJCOPY := $(PREFIX)objcopy
@ -44,15 +45,11 @@ export OBJCOPY := $(PREFIX)objcopy
# canned command sequence for binary data
#---------------------------------------------------------------------------------
define bin2o
padbin 4 $(<)
$(OBJCOPY) -I binary -O elf32-littlearm -B arm \
--rename-section .data=.rodata,readonly,data,contents,alloc \
--redefine-sym _binary_`(echo $(<) | sed -e 's/^\/\([a-zA-Z]\/\)/\1_/' | tr . _ | tr / _)`_start=`(echo $(<F) | tr . _)`\
--redefine-sym _binary_`(echo $(<) | sed -e 's/^\/\([a-zA-Z]\/\)/\1_/' | tr . _ | tr / _)`_end=`(echo $(<F) | tr . _)`_end\
--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
bin2s $< | $(AS) $(ARCH) -o $(@)
echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_len[]";" >> `(echo $(<F) | tr . _)`.h
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
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
@ -8,16 +12,21 @@ LIBNDS := $(DEVKITPRO)/libnds
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.nds: %.bin
%.nds: %.arm9
@ndstool -c $@ -9 $<
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.bin: %.elf
%.arm9: %.elf
@$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.arm7: %.elf
@$(OBJCOPY) -O binary $< $@
@echo built ... $(notdir $@)
#---------------------------------------------------------------------------------
%.elf:
@echo linking binary
@echo linking $(notdir $@)
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@