Re: Makefile for a simple program

Greg Ungerer <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <[email protected]>
Hi Bob,

Bob Brusa wrote:
> Hm, it seems simple, but it is not. I have tried a lot and get errors only.
> 
> I use a COBRA5282-board (with dBUG ready) and I want to compile, link, 
> download and execute the simple helloworld-program shown below:
> ----------------------------------
> #include <stdio.h>
> 
> int main(void)
> {
>     printf("Hello World\n");
>     return 0;
> }
> -----------------------------------
> 
> I use the toolchain installed by executing the script 
> m68k-uclinux-tools-20061214.sh (downloaded from 
> http://www.uclinux.org/pub/uClinux/m68k-elf-tools/)
> My present understanding is, that the makefile should use a prefix of 
> m68k-uclinux and hence invoke gcc as m68k-uclinux-gcc. But there are 
> options (and more) required and I do not really see which ones. Does 
> anyone have a "proposal" how my makefile should look like?

Are you trying to build a uClinux application, or a stand alone
run-on-bare-metal binary?

The above toolchain can of course do both, but you will supply
a different set of compile options.

If compiling a stand alone binary you will need some assembler start
up code, and a library to supply a bare-metal printf as well.
The above toolchain does not have those in it. (It does have
libraries and startup code for uClinux applications though).

Regards
Greg



> Thank you and best regards
> Bob
> 
> PS: Download to the board using tftp works fine, but the binaries I get 
> from my makefile do not work.
> 
> --Bob Brusa                [email protected]
> Chapfwiesenstr. 14       ph: +4144 926 74 74
> CH-8712 Stäfa            fx:   +4144 926 73 34
> ---
> [email protected]              Send a post to the list.
> [email protected]        Join the list.
> [email protected]    Join the list in digest mode.
> [email protected]     Leave the list.
> 
> 

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     [email protected]
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
---
[email protected]              Send a post to the list.
[email protected]        Join the list.
[email protected]    Join the list in digest mode.
[email protected]     Leave the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.