Configure, CVS, platform-dependant, etc

[BTW: sorry to SDL readers this is a bit off topic]

The tool we use is called “Python”. You may prefer Perl.

I know both, I never really practiced any of these, how would you use
them? Can you show me an example (for how it can help compile…)?

You can do, with suitable subroutines:

if timestamp("foo.c") > timestamp("foo.o"):
	os.system ("gcc -c -o foo.o foo.cpp")

instead of

foo.o: foo.c
	gcc -c -o foo.o foo.c

The python is a bit longer, but it is easy to generalise
to be table driven.

For dependency checking, it isn’t so hard to write
a topological sort in Python … it is just a recursive
descent on a dictionary of dependencies.

So make is not really doing much useful work you can’t
emulate with a few more lines in Python.

On the other hand you can write arbitrary executable
Python code to do conditional building, glob for
filenames, apply regular expressions, or do any
other sort of arbitrary calculation … all in the
same language with a single tool available on almost
all platforms – certainly on more platforms than
make or bash. And with some care, like writing

"dir"+os.sep+"foo.c"

instead of just “dir/foo.c” you can write script that
works on Windows too. The build script for Felix
works on both Unix and Windows, including using
MSVC++ instead of gcc. (This took months to get
working – but at least it is possible!)On Mon, 2006-02-27 at 01:09 -0500, Simon wrote:


John Skaller
Async PL, Realtime software consultants
Checkout Felix: http://felix.sourceforge.net

All of this automaticly covered by scons. It does MD5 hashes on files and
remembers dependencies. Syntax is even simpler as mentioned below, but
similar.

Quoting skaller :>

You can do, with suitable subroutines:

if timestamp(“foo.c”) > timestamp(“foo.o”):
os.system (“gcc -c -o foo.o foo.cpp”)

instead of

foo.o: foo.c
gcc -c -o foo.o foo.c

The python is a bit longer, but it is easy to generalise
to be table driven.

For dependency checking, it isn’t so hard to write
a topological sort in Python … it is just a recursive
descent on a dictionary of dependencies.

So make is not really doing much useful work you can’t
emulate with a few more lines in Python.

On the other hand you can write arbitrary executable
Python code to do conditional building, glob for
filenames, apply regular expressions, or do any
other sort of arbitrary calculation … all in the
same language with a single tool available on almost
all platforms – certainly on more platforms than
make or bash. And with some care, like writing

“dir”+os.sep+“foo.c”

instead of just “dir/foo.c” you can write script that
works on Windows too. The build script for Felix
works on both Unix and Windows, including using
MSVC++ instead of gcc. (This took months to get
working – but at least it is possible!)

That means it works out of the box for windows and linux. Unfortunatly I don’t
own a mac or know someone who has one. So I can’t test it for this platform.
According to the site www.scons.org it supports Linux, other POSIX systems
(including AIX, *BSD systems, HP/UX, IRIX and Solaris), Windows NT, Mac OS X,
and OS/2.
Syntax is really simple, even if you don’t know python.

Maybe it is worth to take a short look at it.

Took note of it, I’ll definately check it out.

Thanks John,
Simon