Simple Makefile

sparky mat max at sparkymat.net
Wed Aug 6 05:25:12 CEST 2008


I managed to compile and execute the tutorial GTK+ application (at
http://wiki.openmoko.org/wiki/Building_a_hello_world_application#GDK_the_Wrong_.2F_Easy_Way)
using the attached Makefile.

On Tue, Aug 5, 2008 at 11:08 PM, sparky mat <max at sparkymat.net> wrote:

> I had a follow-up query. Please take a look at my (simple) Makefile
> attached. I am trying to figure out how to organize my files into the
> following structure:
>
> inc/
> src/
> build/
> build/armv4t/ (which will contain an 'obj' folder and the final binary)
> build/x86/ ( - do - )
>
> How do I alter the '%.o: %.c' directive so that it picks up the .c from
> src/ and drops the .o into build/<arch>/obj/ , and link the objs into the
> final executable at build/<arch>/ ?
>
> On Tue, Aug 5, 2008 at 8:41 AM, sparky mat <max at sparkymat.net> wrote:
>
>> On Mon, Aug 4, 2008 at 1:14 PM, Roland Schatz <
>> roland.schatz at students.jku.at> wrote:
>>
>>> Hello
>>> > I set up the toolchain as per the instructions on the wiki and was
>>> > able to build and package the sample project as per the tutorial.
>>> >
>>> > My problem is that I am not very comfortable with the 'autoconf' way
>>> > of doing things. I usually prefer a simple Makefile / Scons file.
>>> No problem, just replace all occurances of gcc with
>>> arm-angstrom-gneabi-gcc (same for g++, ld, strip, ...).
>>>
>>> Personally I use a combination of autoconf and hand-written makefiles
>>> (no automake), but I see no problem doing the same thing without
>>> autoconf.
>>> What I do is just setting a HOST variable in the makefile, and then
>>> compile using $(HOST)-gcc, and putting all target files into the
>>> bin.$(HOST) directory.
>>> > I am assuming I can make do with a simple Makefile right? It's not
>>> > like the target hardware/platform is changing a lot for an Openmoko
>>> > project. Possibly I can have different targets for ARMv4T build and
>>> > x86 build. So I needed some help with this:
>>> >
>>> > I could see the usually libraries - libc, libdl, libcrypt, libgcc,
>>> > libpthread .. etc. in
>>> > /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/lib . What about
>>> > the windowing toolkit libraries - GTK+, Qt - libraries? What about X
>>> > libraries? How do I get more libraries (that have been ported)?
>>> Most libraries are in
>>> /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/lib. If some are
>>> missing, you can just install them on the host using "./configure
>>> --prefix=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr
>>> --host=arm-angstrom-linux-gnueabi; make; make install".
>>>
>>>
>> Yay!! 'Hello World' working on my phone!! Yipeeee... feel so awesome!!
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmoko.org/pipermail/devel/attachments/20080806/15817812/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 595 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/devel/attachments/20080806/15817812/attachment.obj 


More information about the devel mailing list