gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Make File "Command Not Found"

#126815 - Palko17 - Fri Apr 27, 2007 12:08 am

Okay I followed the TONC instructions made a C file called first.c made a make file called first.mak. Used command line to run first.mak (make -f first.mak). Nothing happens I get an error: make: arm-eabi-gcc command not found. What am I doing wrong, does the make and c file need to be in a different directory, they are in C:\devkitPro\testing\.

Link to article: http://user.chem.tue.nl/jakvijn/tonc/first.htm

C File:

Code:
// First demo. You are not expected to understand it
// (don't spend too much time trying and read on).
// But if you do understand (as a newbie): wow!

int main()
{
    *(unsigned int*)0x04000000 = 0x0403;

    ((unsigned short*)0x06000000)[120+80*240] = 0x001F;
    ((unsigned short*)0x06000000)[136+80*240] = 0x03E0;
    ((unsigned short*)0x06000000)[120+96*240] = 0x7C00;

    while(1);

    return 0;
}


Make File:

Code:
PROJ= first

CC= arm-eabi-gcc
OBJCOPY= arm-eabi-objcopy

.PHONY : build
build:
   $(CC) -mthumb-interwork -mthumb -c $(PROJ).c
   $(CC) -specs=gba_mb.specs -mthumb-interwork -mthumb $(PROJ).o -o $(PROJ).elf
   $(OBJCOPY) -v -O binary $(PROJ).elf $(PROJ).mb.gba
   -@gbafix $(PROJ).mb.gba

.PHONY : clean
clean:
   @rm -fv $(PROJ).o
   @rm -fv $(PROJ).mb.gba
   @rm -fv $(PROJ).elf

#126820 - Ant6n - Fri Apr 27, 2007 1:57 am

is the devkitpro dir containing arm-eabi-gcc in your environment variables?

#126823 - wintermute - Fri Apr 27, 2007 2:42 am

The correct solution is :- add the following line to the top of the Makefile

Code:

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


This assumes that either you used the devkitPro installer or followed the manual installation instructions properly.

I recommend the installer, it works and is less error prone.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#126824 - Palko17 - Fri Apr 27, 2007 2:51 am

Thank-you, I'll edit to tell you if it worked!

EDIT: it worked thank-you so much! Hopefully (since I couldn't find a fix on Google) someone will find this in the future and it will help them. Thank-you again!

#126836 - tepples - Fri Apr 27, 2007 4:27 am

wintermute wrote:
I recommend the installer, it works and is less error prone.

In fact, I've recommended the installer to some other people who just wanted MSYS to use with MinGW, because it's easier than installing the official MSYS distribution.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126848 - keldon - Fri Apr 27, 2007 9:34 am

The way the site is laid out makes you think that devkitARM release 20 is the right thing to download and the wording makes you think the installer/updater is not. Maybe you need to change the literature, too many people are making that same mistake, in fact I think they all do!