Simple Makefile

sparky mat max at
Tue Aug 5 19:38:33 CEST 2008

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:

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> wrote:

> On Mon, Aug 4, 2008 at 1:14 PM, Roland Schatz <
> roland.schatz 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...

More information about the devel mailing list