mirror of
https://github.com/devkitPro/buildscripts.git
synced 2026-03-22 18:14:20 -05:00
*** empty log message ***
This commit is contained in:
parent
eb97b2f71e
commit
94184de5fc
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 $@
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user