CPMake Frequently Asked Questions

Frequently asked questions about CPMake. If you have a question that is not answered here please stop by the SourceForge project and drop an email on the list. And if your question is worthy I'll add it here along with the answer.

Why another make system?

Now I may not be familiar with all make systems out there but I have used some of the heavy hitters and have come away rather disappointed.  So to answer why another make system I will discuss the deficiencies of the ones I have used.

Ant:  Here is an interesting take on a make system.  Build files are written in XML.  A little to verbose for my taste and not very flexible.  Ant works ok if you only ever want to build Java programs.  Have you ever tried to compile a C++ app with it?  There is no way to iterate through a set of files performing a task on each one.  I guess there is if I wanted to write a plugin for it, yuck!

Autotools:  This is like driving in a nail with a train.  Oh it does the job but after you have taken two weeks to lay the track so the train will hit the nail just right you want to commit suicide.  Then every time you want to drive the nail in again you have to warm up the engines, shovel in the coal, then wait a half an hour just to lurch forward 2 inches to get the nail in.  God forbid you ever move the nail!
You pretty much have to have a PhD in autotools to get it to do what you want.  Sorry but I do not have the time.

Gnu make:  This hits the spot better.  Using rules, patterns and dependencies to compile a project is the right approach.  This way if a file is modified only that file and the ones that depend on it are rebuilt, that is if you set up your make file correctly.  This is the right answer but poorly delivered.  The language of the make files is limited and getting the syntax right can be a pain sometimes.  Have you ever tried to debug a gnu make file?  The only way to echo out the value of a variable is in a make rule.  I have spent many a long hour trying to debug a problematic make file. 

I'm a programmer, give me a real language to write my make files in.  I want to be able to use design techniques to write my make files.  I want to use functions and loop structures so I can customize my make file to my project.

I also want a make system that is cross platform.  I want to compile my code on windows as well as unix.  The only one above that comes close to this is Ant.  Yeah ok you can get the others to work on windows if you install cygwin.  That is being cross platform by proxy, more of a hack then a solution.

I want my make system to be multi threaded to take advantage of fast hyper threaded processors.

I want my make system to deal with back slashes vs forward slashes in file names

I want to be able to debug my make files.

I want a host of functionality in the make system.  And it should be easily extended.

Ok are you convinced that another make system is needed?  I was so I wrote CPMake.  Now my wants are satisfied.

Are you trying to take over the world with CPMake?

Who me?  Am I trying to take over the world?  Yes no, actualy I'm want to destroy it and then use CPMake to rebuild the whole thing.  I think if I can harness enough computing power and run multiple threads I could get the job done in 5 days.  I would have the Almighty beat by a day!

What version of Java do I need?

CPMake requires Java Runetime environment 1.4 or higher.  The reason for this is the heavy use of regular expressions in the CPMake method calls.

Can I use a JVM other then Sun's?

As long as it supports the 1.4 runtime environment.  Although I have not yet tested CPMake on anything but Sun's JVM.

Why do you not use MD5 checksum on files?

I had noticed that other projects use the MD5 checksum to identify when files have changed.  I was going to add it to CPMake until I thought better of it.  With the MD5 you have to do it every time a build is started and you have to do it on all files.  If the project is small this is not a big deal, but if the project has a lot of files this could take a while.  What I do instead is cache the modification time of the file.  When building a target I check the modification time of the dependency with the one in cache for that same file.  If the modification time changed at all the target is rebuilt.  The cached times are stored on a per target basis.  The cached value is only updated when the target is succesfuly built.  Yes I know there is a small chance that the file could be changed and the modification time remain the same.  If that were to happen CPMake would not rebuild the file.  There is also a small chance that the MD5 checksum on the modified file is the same too.