Conversation Between Kenny1 and Shiny Quagsire
1 to 15 of 18
  1. Kenny1
    October 30th, 2014 7:27 PM
    Kenny1
    I'm actually using Hyper-V to run Linux, it partitioned a section of my drive for linux, only problem is that I can't connect to the internet, so I might just double boot my PC.
  2. Shiny Quagsire
    October 30th, 2014 12:58 PM
    Shiny Quagsire
    Perhaps, although for tools Windows is the best option. I personally triple boot Linux, OS X Mavericks, and Win7 so I can test across platforms. OS X was a pain to set up though, so unless you *really* need it I would hardly recommend getting it.

    I will say that in terms of compiling, Linux is a TON easier to set up than Windows.
  3. Kenny1
    October 30th, 2014 9:50 AM
    Kenny1
    I decided to install Linux on my PC, because it seems Windows isnt the best for everything, do you think this should help me?
  4. Shiny Quagsire
    October 29th, 2014 3:42 PM
    Shiny Quagsire
    I guess. I've gotten it working on Windows before but I'm not sure what's up with your system tbh.
  5. Kenny1
    October 29th, 2014 9:08 AM
    Kenny1
    I don't know where, anyway, I think it would be better if I just left it, it's CLEARLY not working.
  6. Shiny Quagsire
    October 28th, 2014 7:02 PM
    Shiny Quagsire
    This is probably the line you want:

    export PATH := $(DEVKITARM)/bin:$(PATH)

    Try throwing that into the RoA makefile and see if that does it.
  7. Kenny1
    October 28th, 2014 8:10 AM
    Kenny1
    I cant find it, I don't know how it works :(

    Working makefile:
    Spoiler:
    #
    # Template tonc makefile
    #
    # Yoinked mostly from DKP's template
    #

    # === SETUP ===========================================================

    # --- No implicit rules ---
    .SUFFIXES:

    # --- Tonc paths ---
    # If not defined as environment variable, assumed to be 2 dirs up
    export TONCCODE ?= $(CURDIR)/../..

    include $(TONCCODE)/tonc_rules

    # --- Main path ---

    export PATH := $(DEVKITARM)/bin:$(PATH)


    # === PROJECT DETAILS =================================================
    # PROJ : Base project name
    # TITLE : Title for ROM header (12 characters)
    # LIBS : Libraries to use, formatted as list for linker flags
    # BUILD : Directory for build process temporaries. Should NOT be empty!
    # SRCDIRS : List of source file directories
    # DATADIRS : List of data file directories
    # INCDIRS : List of header file directories
    # LIBDIRS : List of library directories
    # General note: use `.' for the current dir, don't leave the lists empty.

    export PROJ ?= $(notdir $(CURDIR))
    TITLE := $(PROJ)
    GFXLIBS :=
    MUSIC := audio

    LIBS := -ltonc -lmm

    BUILD := build
    SRCDIRS := source
    DATADIRS := data
    INCDIRS := include
    LIBDIRS := $(TONCCODE)/tonclib

    # --- switches ---

    bMB := 0 # Multiboot build
    bTEMPS := 0 # Save gcc temporaries (.i and .s files)
    bDEBUG := 0 # Generate debug info


    # === BUILD FLAGS =====================================================
    # This is probably where you can stop editing
    # NOTE: I've noticed that -fgcse and -ftree-loop-optimize sometimes muck
    # up things (gcse seems fond of building masks inside a loop instead of
    # outside them for example). Removing them sometimes helps

    # --- Architecture ---

    ARCH := -mthumb-interwork -mthumb
    RARCH := -mthumb-interwork -mthumb
    IARCH := -mthumb-interwork -marm -mlong-calls

    # --- Main flags ---

    ifeq ($(strip $(bDEBUG)), 2)

    CFLAGS := -mcpu=arm7tdmi -mtune=arm7tdmi -O3
    CFLAGS += -Wall
    CFLAGS += $(INCLUDE)
    CFLAGS +=

    CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions

    ASFLAGS := $(ARCH) $(INCLUDE)
    LDFLAGS := $(ARCH) -Wl,-Map,$(PROJ).map

    else ifeq ($(strip $(bDEBUG)), 1)

    CFLAGS := -mcpu=arm7tdmi -mtune=arm7tdmi -O3
    CFLAGS += -Wall
    CFLAGS += $(INCLUDE)
    CFLAGS +=

    CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions

    ASFLAGS := $(ARCH) $(INCLUDE)
    LDFLAGS := $(ARCH) -Wl,-Map,$(PROJ).map

    else

    CFLAGS := -mcpu=arm7tdmi -mtune=arm7tdmi -O2
    CFLAGS += -Wall
    CFLAGS += $(INCLUDE)
    CFLAGS += -ffast-math -fno-strict-aliasing

    CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions

    ASFLAGS := $(ARCH) $(INCLUDE)
    LDFLAGS := $(ARCH) -Wl,-Map,$(PROJ).map
    endif



    # --- switched additions ----------------------------------------------

    # --- Multiboot ? ---
    ifeq ($(strip $(bMB)), 1)
    TARGET := $(PROJ).mb
    else


    ifeq ($(strip $(bDEBUG)), 2)
    TARGET := $(PROJ)_debug_VBA
    else ifeq ($(strip $(bDEBUG)), 1)
    TARGET := $(PROJ)_debug_Eclipse
    else
    TARGET := $(PROJ)
    endif

    endif

    # --- Save temporary files ? ---
    ifeq ($(strip $(bTEMPS)), 1)
    CFLAGS += -save-temps
    CXXFLAGS += -save-temps
    endif

    # --- Debug info ? ---

    ifeq ($(strip $(bDEBUG)), 2)
    CFLAGS += -DNDEBUG
    CXXFLAGS += -DNDEBUG
    ASFLAGS += -DNDEBUG
    else ifeq ($(strip $(bDEBUG)), 1)
    CFLAGS += -DDEBUG -g
    CXXFLAGS += -DDEBUG -g
    ASFLAGS += -DDEBUG -g
    LDFLAGS += -g
    else
    CFLAGS += -DNDEBUG
    CXXFLAGS += -DNDEBUG
    ASFLAGS += -DNDEBUG
    endif


    # === BUILD PROC ======================================================

    ifneq ($(BUILD),$(notdir $(CURDIR)))

    # Still in main dir:
    # * Define/export some extra variables
    # * Invoke this file again from the build dir
    # PONDER: what happens if BUILD == "" ?

    export OUTPUT := $(CURDIR)/$(TARGET)
    export VPATH := \
    $(foreach dir, $(SRCDIRS) , $(CURDIR)/$(dir)) \
    $(foreach dir, $(DATADIRS), $(CURDIR)/$(dir))

    export DEPSDIR := $(CURDIR)/$(BUILD)

    # --- List source and data files ---

    CFILES := $(foreach dir, $(SRCDIRS) , $(notdir $(wildcard $(dir)/*.c)))
    CPPFILES := $(foreach dir, $(SRCDIRS) , $(notdir $(wildcard $(dir)/*.cpp)))
    SFILES := $(foreach dir, $(SRCDIRS) , $(notdir $(wildcard $(dir)/*.s)))
    BINFILES := $(foreach dir, $(DATADIRS), $(notdir $(wildcard $(dir)/*.*))) soundbank.bin

    export AUDIOFILES := $(foreach dir,$(notdir $(wildcard $(MUSIC)/*.*)),$(CURDIR)/$(MUSIC)/$(dir))


    # --- Set linker depending on C++ file existence ---
    ifeq ($(strip $(CPPFILES)),)
    export LD := $(CC)
    else
    export LD := $(CXX)
    endif

    # --- Define object file list ---
    export OFILES := $(addsuffix .o, $(BINFILES)) \
    $(CFILES:.c=.o) $(CPPFILES:.cpp=.o) \
    $(SFILES:.s=.o)

    # --- Create include and library search paths ---
    export INCLUDE := $(foreach dir,$(INCDIRS),-I$(CURDIR)/$(dir)) \
    $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
    -I$(CURDIR)/$(BUILD)

    export LIBPATHS := -L$(CURDIR) $(foreach dir,$(LIBDIRS),-L$(dir)/lib)

    # --- More targets ----------------------------------------------------

    .PHONY: $(BUILD) clean

    # --- Create BUILD if necessary, and run this makefile from there ---

    $(BUILD):
    @[ -d [email protected] ] || mkdir -p [email protected]
    @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
    arm-none-eabi-nm -Sn $(OUTPUT).elf > $(BUILD)/$(TARGET).map

    all : $(BUILD)

    clean:
    @echo clean ...
    @rm -fr $(BUILD) $(TARGET).elf $(TARGET).gba


    else # If we're here, we should be in the BUILD dir



    DEPENDS := $(OFILES:.o=.d)



    # --- Main targets ----

    $(OUTPUT).gba : $(OUTPUT).elf

    $(OUTPUT).elf : $(OFILES)

    #---------------------------------------------------------------------------------
    # The bin2o rule should be copied and modified
    # for each extension used in the data directories
    #---------------------------------------------------------------------------------

    #---------------------------------------------------------------------------------
    # rule to build soundbank from music files
    #---------------------------------------------------------------------------------
    soundbank.bin : $(AUDIOFILES)
    #---------------------------------------------------------------------------------
    @mmutil $^ -osoundbank.bin -hsoundbank.h

    #---------------------------------------------------------------------------------
    # This rule links in binary data with the .bin extension
    #---------------------------------------------------------------------------------
    %.bin.o : %.bin
    #---------------------------------------------------------------------------------
    @echo $(notdir $<)
    @$(bin2o)



    -include $(DEPENDS)


    endif # End BUILD switch

    # EOF
    Alph puzzle makefile:
    default_target: bpre
    .PHONY : default_target

    TARGET = [email protected]

    ifdef offset
    INSERT=$(shell printf "%d" 0x$(offset))
    endif

    PATH := /opt/devkitpro/devkitARM/bin:$(PATH)
    OPTS := -fauto-inc-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse -fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-const -fipa-profile -fipa-reference -fmerge-constants -fsplit-wide-types -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -fomit-frame-pointer -fthread-jumps -falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-checks -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-lm -finline-small-functions -findirect-inlining -fipa-sra -foptimize-sibling-calls -fpartial-inlining -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch-conversion -ftree-tail-merge -ftree-pre -ftree-vrp -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-slp-vectorize -fvect-cost-model -fipa-cp-clone -ffast-math -fno-protect-parens -fstack-arrays -fforward-propagate -finline-functions-called-once -fmerge-all-constants -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse-sm -fgcse-las -funsafe-loop-optimizations -fconserve-stack

    #
    #Build for Fire Red
    #
    bpre :
    sed 's/^ rom : ORIGIN = 0x08XXXXXX, LENGTH = 32M$$/ rom : ORIGIN = 0x08$(offset), LENGTH = 32M/' linker_base.lsc > linker.lsc
    gcc ${OPTS} -mthumb -mthumb-interwork -Dengine=0 -g -c -w -std=gnu99 -o main.out main.c
    ld -o main.o -T linker.lsc main.out
    objcopy -O binary main.o main.bin
    rm main.o
    rm main.out
    rm linker.lsc

    #Auto-Insert into the ROM
    ifdef fname
    ifdef INSERT
    dd if=main.bin of="$(fname)" conv=notrunc seek=$(INSERT) bs=1
    else
    @echo "Insertion location not found!"
    @echo "Did you forget to define 'offset'?"
    @echo "Ex: make <version> fname=something.gba offset=<offset in hex>"
    endif
    else
    @echo "File location not found!"
    @echo "Did you forget to define 'fname'?"
    @echo "Ex: make <version> fname=<GBA ROM File> insert=1A2B3C"
    endif

    .PHONY : bpre

    #
    #Build for Emerald
    #
    bpee :
    sed 's/^ rom : ORIGIN = 0x08XXXXXX, LENGTH = 32M$$/ rom : ORIGIN = 0x08$(offset), LENGTH = 32M/' linker_base.lsc > linker.lsc
    gcc ${OPTS} -mthumb -mthumb-interwork -Dengine=1 -g -c -w -std=gnu99 -o main.out main.c
    ld -o main.o -T linker.lsc main.out
    objcopy -O binary main.o main.bin
    rm main.o
    rm main.out
    rm linker.lsc

    #Auto-Insert into the ROM
    ifdef fname
    ifdef INSERT
    dd if=main.bin of="$(fname)" conv=notrunc seek=$(INSERT) bs=1
    endif
    endif

    .PHONY : bpee
  8. Kenny1
    October 27th, 2014 5:15 PM
    Kenny1
    Thank you Shiny Quagsire, I'll try that later when I get on PC. Thank you for giving me your time to try help me, I REALLY appreciate it.
  9. Shiny Quagsire
    October 27th, 2014 1:29 PM
    Shiny Quagsire
    Hm, perhaps check those makefiles and see how they are calling gcc? I can't really think of much else tbh.
  10. Kenny1
    October 27th, 2014 6:04 AM
    Kenny1
    I already do compile my own projects, it works, even if I try calling GCC.exe, it says it has no source, so it is working
  11. Shiny Quagsire
    October 26th, 2014 6:17 PM
    Shiny Quagsire
    Try copying the gcc.exe to the building directory, or, alternatively, add that bin folder to your PATH variable, which will set up your system to be able to call that executable from anywhere in cmd.exe The latter is a much more long term solution, especially if you plan on building multiple projects.
  12. Kenny1
    October 25th, 2014 9:59 PM
    Kenny1
    Same error, I think
    Spoiler:
    sed 's/^ rom : ORIGIN = 0x08XXXXXX, LENGTH = 32M$/ rom : O
    RIGIN = 0x08800000, LENGTH = 32M/' linker_base.lsc > linker.lsc
    gcc -fauto-inc-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-
    branch -fdse -fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-p
    ure-const -fipa-profile -fipa-reference -fmerge-constants -fsplit-wide-types -ft
    ree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copyrename -ftre
    e-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-phiprop
    -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -fomit-frame-pointer -fthread
    -jumps -falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-sa
    ves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-c
    hecks -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-lm -finline-small-f
    unctions -findirect-inlining -fipa-sra -foptimize-sibling-calls -fpartial-inlini
    ng -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-
    loop -fsched-interblock -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict
    -aliasing -fstrict-overflow -ftree-switch-conversion -ftree-tail-merge -ftree-pr
    e -ftree-vrp -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-a
    fter-reload -ftree-slp-vectorize -fvect-cost-model -fipa-cp-clone -ffast-math -f
    no-protect-parens -fstack-arrays -fforward-propagate -finline-functions-called-o
    nce -fmerge-all-constants -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse-sm
    -fgcse-las -funsafe-loop-optimizations -fconserve-stack -mthumb -mthumb-interwo
    rk -Dengine=0 -g -c -w -std=gnu99 -o main.out main.c
    make: gcc: Command not found
    make: *** [bpre] Error 127
  13. Shiny Quagsire
    October 25th, 2014 8:52 PM
    Shiny Quagsire
    Ah, if that's the case then try running gcc from the command line. It *should* work. If it doesn't, copy gcc, as, objcopy, and ld to the project directory (where the Makefile is) and rename them to arm-eabi-gcc, arm-none-eabi-as, arm-none-eabi-objcopy and arm-none-eabi-ld. If it did work, try editing the makefile to use those executables instead (ie replace arm-none-eabi-gcc with just gcc)
  14. Kenny1
    October 25th, 2014 10:24 AM
    Kenny1
    Should I reinstall DevkitPro?
  15. Kenny1
    October 25th, 2014 10:04 AM
    Kenny1