devkitPro.org
https://devkitpro.org/

[beginner] Tonc: "My first GBA demo" Makefile failure
https://devkitpro.org/viewtopic.php?f=37&t=8740
Page 1 of 1

Author:  PRZ [ Tue Jun 19, 2018 6:39 am ]
Post subject:  [beginner] Tonc: "My first GBA demo" Makefile failure

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

Author:  WinterMute [ Tue Jun 19, 2018 2:03 pm ]
Post subject:  Re: [beginner] Tonc: "My first GBA demo" Makefile failure

It's possible to just copy the terminal output & add it to a post in code tags, like this -
Code:
$ 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:
env
&
Code:
uname -a
on your system.

Author:  PRZ [ Tue Jun 19, 2018 4:24 pm ]
Post subject:  Re: [beginner] Tonc: "My first GBA demo" Makefile failure

Output for env:

Code:
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:
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.

Author:  WinterMute [ Wed Jun 20, 2018 8:08 pm ]
Post subject:  Re: [beginner] Tonc: "My first GBA demo" Makefile failure

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:
export PATH=/opt/devkitpro/devkitARM/bin:/opt/devkitpro/tools/bin:$PATH

Author:  PRZ [ Thu Jun 21, 2018 8:14 am ]
Post subject:  Re: [beginner] Tonc: "My first GBA demo" Makefile failure

You are a godsend. Thank you so much.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/