PDA

View Full Version : Getting Automake/Autoconf to compile C



Jamie_Edwards
07-13-2012, 08:04 AM
Hi guys,

I'm having trouble with getting my head around automake and autoconf.

I've read that both tools are good, and I want to make use of them with what I'm trying to develop.

I'm learning C, and I'm writing an OS as my learning platform, but I'm doing it by writing my own version of the linux kernel. But I want to be able to compile and link the source code quickly and not so painfully, and this is where automake and autoconf come in.

I've been told that it needs a makefile.in and makefile.am, and also configure.ac etc...

Now I can set up the configure.ac, it's headerfiles, but when it comes to the makefile.am/.in I haven't got a clue ( as I have been relying on IDE's to do the work for me )

Does anyone know how I could achieve this? And also be able to add new subdirs to the project while I go along?

Here's my structure at the moment:


Root_Dir
|
boot fs include init kernel lib mm tools
|
multiboot asm linux sys


All source files reside in all of the sub dirs, and the header files mostly reside in the include file. My main source file resides in the init directory.

I hope you guys are able to help.

Jamie

Salem
07-13-2012, 11:18 AM
I think it would be a lot easier for the moment to stick with regular make.

Until you're ready to distribute your code to a range of platforms, the "auto" features aren't going to buy you a lot.

Jamie_Edwards
07-13-2012, 11:39 AM
I think it would be a lot easier for the moment to stick with regular make.

Until you're ready to distribute your code to a range of platforms, the "auto" features aren't going to buy you a lot.

hmm, I guess your right, but even so this information would still useful for when, and if I ever get to distribute the code.

Or for any other project I decide to have a go at for that matter :L

Salem
07-13-2012, 11:41 AM
True, but do you need to learn so many things in parallel?

Jamie_Edwards
07-13-2012, 12:48 PM
True, but do you need to learn so many things in parallel?

I'm trying not to, in respect of the OS, once I've completed a source, for arguments sake, the FileSystem, I'll then implement that into my own version of main, compile and run it, and do the same then for memory management.

As for the automake/autoconf I'm not needing to learn how to do it, more of having a template that I can then use on any project, and changing any fields that need changed etc.