Author Topic: Compiling C for Nspire  (Read 10569 times)

0 Members and 1 Guest are viewing this topic.

Offline Maizesmagikarp

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +1/-0
  • Master of the Lickitungs
    • View Profile
    • Lickitung's World
Compiling C for Nspire
« on: March 09, 2010, 06:27:06 pm »
Hi!

I was wondering how one would compile C source code for the TI-Nspire (Ndless).
As in compile the C into a .TNS.
Any help would be greatly appreciated!

Maize
Omnomnom!
Author of Encyclopedia Ingenus Lingus: http://lickitung.ath.cx/Encyclopedia_Final.pdf
Administrator of all Lickitung's World entities

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Compiling C for Nspire
« Reply #1 on: March 09, 2010, 06:30:17 pm »
Read the Ndless readme!
On Linux, all I had to do was install arm-elf-gcc, binutils (for ARM), and newlib.
On Windows, I think you want to install Yagarto, which is an ARM toolchain for Windows.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Compiling C for Nspire
« Reply #2 on: March 09, 2010, 07:42:23 pm »
Let's not scare away new members, bwang, but I agree that the readme might have some useful information on what you need. If not, or if it confuses you, feel free to ask more questions (altough I myself may not be able to help, since I don't do C).

Also, what computer OS are you running?

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Compiling C for Nspire
« Reply #3 on: March 09, 2010, 07:50:50 pm »
Sorry if I sounded rude; I really meant "there's useful stuff in the readme but I'm too lazy to type it here". Also, I just realized the document I got the development information from was Ndless-v1.0/src/doc/Dev.txt, which has step-by-step instructions on how to install YAGARTO, as well as various Eclipse plugins if you're into IDEs and such. That should be all you need to get started on Windows.
If you are running Linux, there are a couple posts on UTI that will help you (see, for example, this).
« Last Edit: March 09, 2010, 07:53:48 pm by bwang »

Offline Maizesmagikarp

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +1/-0
  • Master of the Lickitungs
    • View Profile
    • Lickitung's World
Re: Compiling C for Nspire
« Reply #4 on: March 09, 2010, 07:51:54 pm »
FYI, I run Windows.
Thanks!
I'll look into it.
Omnomnom!
Author of Encyclopedia Ingenus Lingus: http://lickitung.ath.cx/Encyclopedia_Final.pdf
Administrator of all Lickitung's World entities

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Compiling C for Nspire
« Reply #5 on: March 09, 2010, 07:56:01 pm »
Will this work on most Windows versions, btw? I mean x64 Seven/Vista, 2000, etc

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Compiling C for Nspire
« Reply #6 on: March 09, 2010, 08:09:05 pm »
I don't actually know since I'm running Linux, but there's no reason it shouldn't since it doesn't involve drivers or strange hardware.

Offline BrownyTCat

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 420
  • Rating: +37/-8
    • View Profile
Re: Compiling C for Nspire
« Reply #7 on: March 10, 2010, 08:58:46 pm »
 ??? Yeah I want to compile, but I need to have a compiler, I suck at makefiles.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Compiling C for Nspire
« Reply #8 on: March 10, 2010, 09:15:34 pm »
Right now, I just use the Makefile that came with Ndless and modify it as necessary.

Offline BrownyTCat

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 420
  • Rating: +37/-8
    • View Profile
Re: Compiling C for Nspire
« Reply #9 on: March 11, 2010, 05:26:18 pm »
Right now, I just use the Makefile that came with Ndless and modify it as necessary.
But how? How do you... Run a makefile and set it up?
I have two files: main.c and utils.h, How do I make them a .tns and/or debug them?

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Compiling C for Nspire
« Reply #10 on: March 11, 2010, 06:54:50 pm »
According to the DEV.txt, just open a MSYS shell in the folder your code is in.
If you edit the original Ndless demo, you can just edit main.c and then run "make" in the src folder. I use Linux, though, so I don't know how MSYS works. Presumably its just a command shell like the Windows DOS prompt.
If MSYS is just a bash shell like the site said it was, these commands will build the demo:
Code: [Select]
cd <NSPIRE_DIRECTORY>/src/arm/demo
make

Offline Tribal

  • The Fallen
  • LV5 Advanced (Next: 300)
  • *
  • Posts: 218
  • Rating: +15/-1
    • View Profile
Re: Compiling C for Nspire
« Reply #11 on: March 12, 2010, 11:02:20 am »
Is there considerable difference between Yogarto and the devkitARM toolchain? It would be nice to know if one has any advantages over another.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Compiling C for Nspire
« Reply #12 on: March 12, 2010, 11:12:11 am »
I'm not sure. It seems both of them are gcc's, though.

Offline BrownyTCat

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 420
  • Rating: +37/-8
    • View Profile
Re: Compiling C for Nspire
« Reply #13 on: March 12, 2010, 07:52:26 pm »
Yeah I edit using Programmer's Notepad 2, the YAGARTO toolchain, and makefiles.