diff --git a/build-devkit.sh b/build-devkit.sh index 9d6b6c9..55b3b8e 100755 --- a/build-devkit.sh +++ b/build-devkit.sh @@ -30,6 +30,7 @@ GENERAL_TOOLS_VER=1.0.2 LIBGBA_VER=0.5.1 GBATOOLS_VER=1.1.0 +DKARM_RULES_VER=1.0.0 LIBNDS_VER=1.7.2 DEFAULT_ARM7_VER=0.7.4 @@ -227,6 +228,8 @@ if [ $VERSION -eq 1 ]; then general-tools-$GENERAL_TOOLS_VER.tar.bz2 mmutil-$MMUTIL_VER.tar.bz2 dfu-util-$DFU_UTIL_VER.tar.bz2 stlink-$STLINK_VER.tar.bz2 3dstools-$TOOLS3DS_VER.tar.bz2 picasso-$PICASSO_VER.tar.bz2 tex3ds-$TEX3DS_VER.tar.bz2 3dslink-$LINK3DS_VER.tar.bz2" + + archives="devkitarm-rules-$DKARM_RULES_VER.tar.xz $archives" fi if [ $VERSION -eq 2 ]; then diff --git a/dkarm-eabi/rules/3ds_rules b/dkarm-eabi/rules/3ds_rules deleted file mode 100644 index 1a891b8..0000000 --- a/dkarm-eabi/rules/3ds_rules +++ /dev/null @@ -1,43 +0,0 @@ -ifeq ($(strip $(DEVKITPRO)),) -$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitPro) -endif - -include $(DEVKITARM)/base_rules - -PORTLIBS := $(PORTLIBS_PATH)/3ds - -export PATH := $(PORTLIBS_PATH)/3ds/bin:$(PATH) - -CTRULIB ?= $(DEVKITPRO)/libctru - -ifeq ($(strip $(APP_TITLE)),) -APP_TITLE := $(notdir $(OUTPUT)) -endif - -ifeq ($(strip $(APP_DESCRIPTION)),) -APP_DESCRIPTION := Built with devkitARM & libctru -endif - -ifeq ($(strip $(APP_AUTHOR)),) -APP_AUTHOR := Unspecified Author -endif - -ifeq ($(strip $(APP_ICON)),) -APP_ICON := $(CTRULIB)/default_icon.png -endif - -#--------------------------------------------------------------------------------- -%.smdh: $(APP_ICON) $(MAKEFILE_LIST) - @smdhtool --create "$(APP_TITLE)" "$(APP_DESCRIPTION)" "$(APP_AUTHOR)" $(APP_ICON) $@ - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.3dsx: %.elf - @3dsxtool $< $@ $(_3DSXFLAGS) - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.elf: - @echo linking $(notdir $@) - @$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@ - @$(NM) -CSn $@ > $(notdir $*.lst) diff --git a/dkarm-eabi/rules/base_rules b/dkarm-eabi/rules/base_rules deleted file mode 100644 index d8dbdb3..0000000 --- a/dkarm-eabi/rules/base_rules +++ /dev/null @@ -1,111 +0,0 @@ -include $(DEVKITARM)/base_tools - -#--------------------------------------------------------------------------------- -# add portlibs path -#--------------------------------------------------------------------------------- -export PORTLIBS_PATH := $(DEVKITPRO)/portlibs - - -#--------------------------------------------------------------------------------- -%.a: -#--------------------------------------------------------------------------------- - @echo $(notdir $@) - @rm -f $@ - $(AR) -rc $@ $^ - -#--------------------------------------------------------------------------------- -%.arm.o: %.arm.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.arm.d $(CXXFLAGS) -marm -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.arm.o: %.arm.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.arm.d $(CFLAGS) -marm -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.arm.o: %.arm.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.arm.d $(OBJCFLAGS) -marm -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.thumb.o: %.thumb.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.thumb.d $(CXXFLAGS) -mthumb -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.thumb.o: %.thumb.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.thumb.d $(CFLAGS) -mthumb -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.thumb.o: %.thumb.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.thumb.d $(OBJCFLAGS) -mthumb -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.iwram.o: %.iwram.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.iwram.d $(CXXFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.iwram.o: %.iwram.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.iwram.d $(CFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.iwram.o: %.iwram.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.iwram.d $(OBJCFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.itcm.o: %.itcm.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.itcm.d $(CXXFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.itcm.o: %.itcm.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.itcm.d $(CFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.itcm.o: %.itcm.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.itcm.d $(OBJCFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - - -#--------------------------------------------------------------------------------- -%.o: %.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.o: %.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.o: %.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(OBJCFLAGS) -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.o: %.s - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.o: %.S - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -# canned command sequence for binary data -#--------------------------------------------------------------------------------- -define bin2o - bin2s $< | $(AS) -o $(@) - echo "extern const u8" `(echo $( `(echo $(> `(echo $(> `(echo $(&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g' -endif diff --git a/dkarm-eabi/rules/ds_rules b/dkarm-eabi/rules/ds_rules deleted file mode 100644 index 0b98b5c..0000000 --- a/dkarm-eabi/rules/ds_rules +++ /dev/null @@ -1,54 +0,0 @@ -ifeq ($(strip $(DEVKITPRO)),) -$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitPro) -endif - -include $(DEVKITARM)/base_rules - -PORTLIBS := $(PORTLIBS_PATH)/nds $(PORTLIBS_PATH)/armv5te - -LIBNDS := $(DEVKITPRO)/libnds - -ifeq ($(strip $(GAME_TITLE)),) -GAME_TITLE := $(notdir $(OUTPUT)) -endif - -ifeq ($(strip $(GAME_SUBTITLE1)),) -GAME_SUBTITLE1 := built with devkitARM -endif - -ifeq ($(strip $(GAME_SUBTITLE2)),) -GAME_SUBTITLE2 := http://devkitpro.org -endif - -ifeq ($(strip $(GAME_ICON)),) -GAME_ICON := $(DEVKITPRO)/libnds/icon.bmp -endif - -ifneq ($(strip $(NITRO_FILES)),) -_ADDFILES := -d $(NITRO_FILES) -endif - -#--------------------------------------------------------------------------------- -%.nds: %.arm9 - @ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES) - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.nds: %.elf - @ndstool -c $@ -9 $< -b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" $(_ADDFILES) - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.arm9: %.elf - @$(OBJCOPY) -O binary $< $@ - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.arm7: %.elf - @$(OBJCOPY) -O binary $< $@ - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.elf: - @echo linking $(notdir $@) - @$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@ diff --git a/dkarm-eabi/rules/gba_rules b/dkarm-eabi/rules/gba_rules deleted file mode 100644 index 455d10a..0000000 --- a/dkarm-eabi/rules/gba_rules +++ /dev/null @@ -1,25 +0,0 @@ -ifeq ($(strip $(DEVKITPRO)),) -$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitPro) -endif - -include $(DEVKITARM)/base_rules - -PORTLIBS := $(PORTLIBS_PATH)/gba $(PORTLIBS_PATH)/armv4 - -LIBGBA := $(DEVKITPRO)/libgba - -#--------------------------------------------------------------------------------- -%.gba: %.elf - @$(OBJCOPY) -O binary $< $@ - @echo built ... $(notdir $@) - @gbafix $@ - -#--------------------------------------------------------------------------------- -%_mb.elf: - @echo linking multiboot - @$(LD) -specs=gba_mb.specs $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@ - -#--------------------------------------------------------------------------------- -%.elf: - @echo linking cartridge - @$(LD) $(LDFLAGS) -specs=gba.specs $(OFILES) $(LIBPATHS) $(LIBS) -o $@ diff --git a/dkarm-eabi/rules/gp32_rules b/dkarm-eabi/rules/gp32_rules deleted file mode 100644 index 3ed44fc..0000000 --- a/dkarm-eabi/rules/gp32_rules +++ /dev/null @@ -1,20 +0,0 @@ --include $(DEVKITARM)/base_rules - -PORTLIBS := $(PORTLIBS_PATH)/gp32 $(PORTLIBS_PATH)/armv4 - -LIBMIRKO := $(DEVKITPRO)/libmirko - -#--------------------------------------------------------------------------------- -%.fxe: %.bin - @b2fxec -a "$(AUTHOR)" -t "$(TITLE)" $< $@ - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.bin: %.elf - @$(OBJCOPY) -O binary $< $@ - @echo built ... $(notdir $@) - -#--------------------------------------------------------------------------------- -%.elf: - @echo linking binary - @$(LD) $(LDFLAGS) -specs=gp32.specs $(OFILES) $(LIBPATHS) $(LIBS) -o $@ diff --git a/dkarm-eabi/scripts/build-gcc.sh b/dkarm-eabi/scripts/build-gcc.sh index de95bf2..dc5049b 100755 --- a/dkarm-eabi/scripts/build-gcc.sh +++ b/dkarm-eabi/scripts/build-gcc.sh @@ -151,39 +151,6 @@ rm -fr $prefix/$target/sys-include cd $BUILDDIR - -#--------------------------------------------------------------------------------- -# copy base rulesets -#--------------------------------------------------------------------------------- -cp -v $BUILDSCRIPTDIR/dkarm-eabi/rules/* $prefix - - -#--------------------------------------------------------------------------------- -# set env variables -#--------------------------------------------------------------------------------- -export DEVKITPRO=$TOOLPATH -export DEVKITARM=$DEVKITPRO/devkitARM - -#--------------------------------------------------------------------------------- -# Install and build the crt0 files -#--------------------------------------------------------------------------------- - -cp -v $BUILDSCRIPTDIR/dkarm-eabi/crtls/* $prefix/$target/lib/ -cd $prefix/$target/lib/ - - -$MAKE CRT=gba -$MAKE CRT=gp32 -$MAKE CRT=er -$MAKE CRT=gp32_gpsdk -$MAKE CRT=ds_arm7 -$MAKE CRT=ds_arm9 -$MAKE CRT=ds_cart -$MAKE ds_arm7_vram_crt0 -$MAKE 3dsx_crt0 - -cd $BUILDDIR - #--------------------------------------------------------------------------------- # build and install the debugger #--------------------------------------------------------------------------------- diff --git a/dkarm-eabi/scripts/build-libs.sh b/dkarm-eabi/scripts/build-libs.sh index 64eee9d..4e8f7ab 100644 --- a/dkarm-eabi/scripts/build-libs.sh +++ b/dkarm-eabi/scripts/build-libs.sh @@ -1,8 +1,39 @@ #!/bin/sh +#--------------------------------------------------------------------------------- +# set env variables +#--------------------------------------------------------------------------------- export DEVKITPRO=$TOOLPATH export DEVKITARM=$DEVKITPRO/devkitARM +#--------------------------------------------------------------------------------- +# Install the rules files +#--------------------------------------------------------------------------------- +cd $BUILDDIR + +mkdir -p rules +cd rules +tar -xvf $SRCDIR/devkitarm-rules-$DKARM_RULES_VER.tar.xz +make install + +#--------------------------------------------------------------------------------- +# Install and build the crt0 files +#--------------------------------------------------------------------------------- + +cp -v $BUILDSCRIPTDIR/dkarm-eabi/crtls/* $prefix/$target/lib/ +cd $prefix/$target/lib/ + + +$MAKE CRT=gba +$MAKE CRT=gp32 +$MAKE CRT=er +$MAKE CRT=gp32_gpsdk +$MAKE CRT=ds_arm7 +$MAKE CRT=ds_arm9 +$MAKE CRT=ds_cart +$MAKE ds_arm7_vram_crt0 +$MAKE 3dsx_crt0 + cd $BUILDDIR/libgba-$LIBGBA_VER $MAKE || { echo "error building libgba"; exit 1; } $MAKE install || { echo "error installing libgba"; exit 1; }