Page 1 of 1
automake - Makefile.am - ELF output
Posted: Mon May 19, 2008 11:31 am
by engine252
How can i make a Makefile.am that outputs a ELF or flat binary file.
Posted: Mon May 19, 2008 4:22 pm
by Combuster
As far as I know, automake can only create makefiles. Use GCC instead.
Also, do you actually know how your tools work? That's a prerequisite for developing an OS for good reason.
Posted: Mon May 19, 2008 5:40 pm
by piranha
This is an interesting test case for the RTFM and STFW thread a little while back.
Lets sit back and watch!
-JL
[ON TOPIC] To make an ELF (under Linux, idk about other places):
gcc test.c -o test
or, under 64bit to make a 32 bit version: Add -m32 flag.
IIRC, to make a flat binary, you need to use ld or another linker), am I right?
-JL
Re: automake - Makefile.am - ELF output
Posted: Tue May 20, 2008 1:30 am
by JamesM
engine252 wrote:How can i make a Makefile.am that outputs a ELF or flat binary file.
Read the
manual.
Posted: Tue May 20, 2008 5:03 am
by engine252
i have read the manual and now i added the line
format=elf
but now i only get a kernel.o file
if i rename this file to kernel.bin and load it with grub i get
unsupported file format
i guess i have to link it but don't know how to tell it to automake
i'd like to use automake for my little OS development project so if someone can get me started.
thx in advance.
Posted: Tue May 20, 2008 5:22 am
by JamesM
You have to tell automake to create an executable.
Read the autoconf manual too - they go hand in hand.
I really can't recommend autoconf/automake to anyone, I've found them to be nothing but trouble. Personally, I would recommend CMake.
Posted: Tue May 20, 2008 6:53 am
by Steve the Pirate
Yeah, I tried automake too, and couldn't get it to make the binary without getting all these unresolved symbols, no matter how many linker flags I tried to give it... I still haven't found a better replacement for my makefile...
Posted: Tue May 20, 2008 6:14 pm
by Zenith
OP: Since I'm assuming you're using gcc, remove the -c flag so that the kernel actually gets linked. Read the manual (for GCC, since I really doubt this is an automake issue).
I tried autoconf/automake once, ditched automake (since I'd made a much more flexible, non-recursive Makefile.in) and (partly) stuck with autoconf. Though ./configure is pretty bloated, it's preferable for compiler detection and since I compile my OS to 3 different architectures, it allows me to work on, compile, and test any of the 3 versions at the same time.