[beginner] Tonc: "My first GBA demo" Makefile failure

Post Reply
PRZ
Posts: 3
Joined: Tue Jun 19, 2018 1:45 am

[beginner] Tonc: "My first GBA demo" Makefile failure

Post by PRZ » Tue Jun 19, 2018 6:39 am

The Tonc page I am referencing can be found here http://www.coranac.com/tonc/text/first.htm.

I have followed the correct procedure to install the devkitARM toolchain through pacman (on OSX), and the gcc compiler is definitely in my /opt/devkitpro/devkitARM/bin directory as expected. I also copied the "first.c" file and corresponding Makefile exactly as shown in the Tonc page. However when I attempt to make, it fails giving the error in the screencapture below.

I've been pulling my hair out for hours trying to figure this out but to no avail. I have checked that the environment var DEVKITPRO holds the proper value, and have no reason to suspect that the given makefile is incorrect. Both the makefile and first.c are given in the tonc page, and I copied them exactly. I realize this is probably more a Unix path problem than GBA development but I would really appreciate the help. Thanks!
Attachments
Screen Shot 2018-06-19 at 12.36.19 AM.png
(32.78 KiB) Not downloaded yet

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: [beginner] Tonc: "My first GBA demo" Makefile failure

Post by WinterMute » Tue Jun 19, 2018 2:03 pm

It's possible to just copy the terminal output & add it to a post in code tags, like this -

Code: Select all

$ make
arm-none-eabi-gcc -c first.c -mthumb-interwork -mthumb -O2 -Wall -fno-strict-aliasing -o first.o
arm-none-eabi-gcc first.o -mthumb-interwork -mthumb -specs=gba.specs -o first.elf
arm-none-eabi-objcopy -v -O binary first.elf first.gba
copy from `first.elf' [elf32-littlearm] to `first.gba' [binary]
ROM fixed!
Can you show me the output of

Code: Select all

env
&

Code: Select all

uname -a
on your system.
Help keep devkitPro toolchains free, Donate today

Personal Blog

PRZ
Posts: 3
Joined: Tue Jun 19, 2018 1:45 am

Re: [beginner] Tonc: "My first GBA demo" Makefile failure

Post by PRZ » Tue Jun 19, 2018 4:24 pm

Output for env:

Code: Select all

DEVKITARM=/opt/devkitpro/devkitARM
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/h7/2y_pc6x15tl3ftrl7jr02h2m0000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.HjFKsWY4pP/Render
TERM_PROGRAM_VERSION=388.1.1
TERM_SESSION_ID=755836E9-FDC8-4E99-A887-BB0FFD03BF0E
USER=Louis
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.w4FOahVSni/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/Louis
LANG=en_US.UTF-8
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/Louis
LOGNAME=Louis
_=/usr/bin/env

Output for uname -a:

Code: Select all

Darwin Louiss-MacBook-Pro.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Thanks again.

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: [beginner] Tonc: "My first GBA demo" Makefile failure

Post by WinterMute » Wed Jun 20, 2018 8:08 pm

OK, I managed to replicate this on a Macbook running High Sierra and I'm really quite flummoxed.

It seems like you can't actually set the PATH in a Makefile on OSX this way although it will work with the recursive devkitPro Makefiles that descend into a build folder before calling the tools. For these early simple Makefiles in Tonc it'll probably be better to just add the toolchain and supplementary tools to PATH before building.

Code: Select all

export PATH=/opt/devkitpro/devkitARM/bin:/opt/devkitpro/tools/bin:$PATH
Help keep devkitPro toolchains free, Donate today

Personal Blog

PRZ
Posts: 3
Joined: Tue Jun 19, 2018 1:45 am

Re: [beginner] Tonc: "My first GBA demo" Makefile failure

Post by PRZ » Thu Jun 21, 2018 8:14 am

You are a godsend. Thank you so much.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests