ant instead of make?
-
Candamir
ant instead of make?
I kind of don't like make; far too complicated, yet it still seems the standard method of writing build scripts in this community...
So, i've asked myself why nobody uses ant instead of make? Has anyone got an idea how this could be done?
Please note that I'm trying to not start a flame, just trying to figure out if it's feasible...
Candamir
So, i've asked myself why nobody uses ant instead of make? Has anyone got an idea how this could be done?
Please note that I'm trying to not start a flame, just trying to figure out if it's feasible...
Candamir
-
chasetec
Re:ant instead of make?
http://ant-contrib.sourceforge.net/cc.html
You might also want to take a look at another build tool designed for C/C++ that is supposed to be much simpler then make. http://www.perforce.com/jam/jam.html
Pesonally my OS stuff has always been small enough that I just write a shell script to do the compiling and linking.
You might also want to take a look at another build tool designed for C/C++ that is supposed to be much simpler then make. http://www.perforce.com/jam/jam.html
Pesonally my OS stuff has always been small enough that I just write a shell script to do the compiling and linking.
- Colonel Kernel
- Member

- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
Re:ant instead of make?
I don't like make either, but eventually I want my OS to be self-hosted... Is there source code available for Perforce jam?
If I ever write an OS in Java, then maybe I'll use Ant. ;D
If I ever write an OS in Java, then maybe I'll use Ant. ;D
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
Re:ant instead of make?
The reason why people use C / make / CVS is "critical mass" - once enough people use product A, it starts being the "easier" solution no matter how good product B might be, simply because of available documentation / advice / prior art.
That's why Windows and MS Office are so successful.
That being said, I've never touched ant, sorry.
That's why Windows and MS Office are so successful.
That being said, I've never touched ant, sorry.
Every good solution is obvious once you've found it.
Re:ant instead of make?
I use rant in ruby. (never liked scons) sooo nice and easy and powerfull.
-- Stu --
-
chasetec
Re:ant instead of make?
The Jam source code is downloadable. If you go through the page I linked to you'll see where they cover porting it to other platforms(already runs on all of the major ones) and they even have an example of building an OpenBeOS kernel with Jam.Colonel Kernel wrote: I don't like make either, but eventually I want my OS to be self-hosted... Is there source code available for Perforce jam?
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:ant instead of make?
i'd say you could use virtually the make system you want for an OS project. Whatever you do, you will probably not avoid completely the need for additional scripts anyway, as the needs may be very specific (making drivers or modules, etc.)
Personnally, i'd probably give up compiling a hobby OS if i realise i don't have the proper tool on my system (that is, wrong version of GCC, or wrong version of python/java/etc.) as, in my experience, updating these may have severe side effects on your system -- or may simply be too complicated (try to install gcc 4.0 on a SuSE 8.x system, you'll see what i mean
)
For a project that inherently take ages (and OS deving *does* take ages), i'd be suspicious about hype-and-recently-introduced-tools as chances are that features will come and go faster than i can follow -- and people will just report "your OS did not compile".
Now, that's just me and i've been trained to think "make", so if you have a good knowledge of ANT, a "userbase" that believe ANT is superior to the rest of the world ( ;D ) and want to try it, go ahead. Probably you'll find people happy to test your OS just because it has been compiled with ANT
Personnally, i'd probably give up compiling a hobby OS if i realise i don't have the proper tool on my system (that is, wrong version of GCC, or wrong version of python/java/etc.) as, in my experience, updating these may have severe side effects on your system -- or may simply be too complicated (try to install gcc 4.0 on a SuSE 8.x system, you'll see what i mean
For a project that inherently take ages (and OS deving *does* take ages), i'd be suspicious about hype-and-recently-introduced-tools as chances are that features will come and go faster than i can follow -- and people will just report "your OS did not compile".
Now, that's just me and i've been trained to think "make", so if you have a good knowledge of ANT, a "userbase" that believe ANT is superior to the rest of the world ( ;D ) and want to try it, go ahead. Probably you'll find people happy to test your OS just because it has been compiled with ANT
Re:ant instead of make?
Ant seems to be trained toward java usage and working on a certain way. I tend to work in different ways from other people so that counts it out for me.
Jam is better, because it automatically understands C and C++ and performs the necessary dependency checking + it uses multiple cpu's and keeps compiling after errors. That small sum makes me puke and wonder whether they've ever even read the make man page. -k == keep going, as in, keep compiling after errors. -j == use multiple cpu's. A build system that tries to understand my sources is inherently flawed, what if I want to use assembly? or whatnot? or a slightly different language from C that only just doesn't pass their parser?
The only thing I consider wrong with make at the moment (gmake) is that it doesn't change the relative root of parsing when you include a file, which makes the include statement a lot less powerful (say, totally useless for >1 layer of include). If they hadn't done that I would've been using it right now for everything, I'm actually doubting about it. I could make a patch for it (probably will), but that requires everybody to rebuild their make. Anyway...
Jam is better, because it automatically understands C and C++ and performs the necessary dependency checking + it uses multiple cpu's and keeps compiling after errors. That small sum makes me puke and wonder whether they've ever even read the make man page. -k == keep going, as in, keep compiling after errors. -j == use multiple cpu's. A build system that tries to understand my sources is inherently flawed, what if I want to use assembly? or whatnot? or a slightly different language from C that only just doesn't pass their parser?
The only thing I consider wrong with make at the moment (gmake) is that it doesn't change the relative root of parsing when you include a file, which makes the include statement a lot less powerful (say, totally useless for >1 layer of include). If they hadn't done that I would've been using it right now for everything, I'm actually doubting about it. I could make a patch for it (probably will), but that requires everybody to rebuild their make. Anyway...
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:ant instead of make?
the only thing that could make me change of make system would be the promise of faster compilation -- for instance through a "gcc server" process that would remain up and keep track of pre-parsed header files ... There are gcc-server thing, but (afaik) they're pretty boring to set up so i prefer fine-tuning my dependencies and think twice when i modify some header file 
Re:ant instead of make?
Candy, I didn't quite get the point of your include gripe. Would you mind elaborating on the point (perhaps by PM if you think it's not that much of public interest)? I've tinkered some with make, and am quite happy with the results, including some tricky includes...
Every good solution is obvious once you've found it.
Re:ant instead of make?
Well... I've tried to make something with a generic makefile that each level includes with a bunch of defines for local specifications. I've also tried to make a makefile that includes all sublying makefiles for single-make-compile.Solar wrote: Candy, I didn't quite get the point of your include gripe. Would you mind elaborating on the point (perhaps by PM if you think it's not that much of public interest)? I've tinkered some with make, and am quite happy with the results, including some tricky includes...
The first failed because:
./makefile:
<generic stuff>
a/makefile:
include ../makefile
a/b/makefile:
include ../makefile
The second include, when executed from that directory, will include a/makefile. That makefile will then, erringly imo, include itself again. You end up with an infinite loop gmake breaks out of since it's pointless.
It fails the other way around too:
./makefile:
include a/makefile
$(TARGET): a/obj.o
-----
a/makefile:
include b/makefile
$(TARGET): b/obj2.o
-----
b/makefile:
obj2.o: something
The first includes the right makefile, the second can't find the b directory.
-
Hogan
Re:ant instead of make?
I am using this in main Makefile:
Makedepend produce something like this to Makefile.dep:
I have included Makefile.dep at end of init/src/Makefile, so for making objects from sources i need just one generic rule.
Code: Select all
cd init/src && makedepend -o Makefile.dep -I. *.c && $(MAKE)Code: Select all
elf.o: elf.c ../../include/definitions.h elf.h mem.h panic.h
ints.o: ints.c ../../include/definitions.h ints.h mem.h
main.o: main.c ../../include/definitions.h video.h mem.h multiboot.h mt.h \
ints.h elf.h panic.h
mem.o: mem.c mem.h ../../include/definitions.h video.h panic.h
mt.o: mt.c ../../include/definitions.h mt.h
multiboot.o: multiboot.c ../../include/definitions.h
panic.o: panic.c ../../include/definitions.h ints.h panic.h video.h
video.o: video.c video.h ../../include/definitions.h-
zloba
Re:ant instead of make?
I've switched to SCons everywhere (currently non-OSdev). Works great (edit-compile-whatever cycle). And with some custom scripting, it's doing wonders for multi-project integration and dependencies.
(spam omitted - just read the scons homepage)
Never want to write another makefile..
(spam omitted - just read the scons homepage)
Never want to write another makefile..
-
guest
Re:ant instead of make?
About the problem with the Makefiles Candy mentions, that problem is typically circumvented using a SRCDIR variable.
./Makefile
./a/Makefile
./a/b/Makefile
./Makefile
Code: Select all
SRCDIR = ${pwd}
all: all2
@echo '"all" ran successfully'
include $(SRCDIR)/a/Makefile
Code: Select all
all2: all3
@echo '"all2" ran successfully'
include $(SRCDIR)/a/b/Makefile
Code: Select all
all3:
@echo '"all3" ran successfully'
Re:ant instead of make?
I did. Up to the previous version of my OS, it contained a bunch of makefiles that would use that exact construction.
Yet, my idea was that you should be able to do a partial compile. How do you make it work with a partial compile (cd a; make; cd ..)?
Yet, my idea was that you should be able to do a partial compile. How do you make it work with a partial compile (cd a; make; cd ..)?