Michael J. Radwin

Tales of a software engineer who keeps kosher and hates the web.

XML for Makefiles?

ant.jpg XML hasn’t cured our ills or saved the world, but people keep using it for absurd purposes anyways.

I finally took a quick look at Apache Ant today to see what all the fuss is about. Apparently with some additional components you can actually get Ant to build C/C++ code.

However, compare this build.xml for Ant:


<?xml version="1.0"?>

<project name="Hello" default="hello" basedir=".">

<taskdef resource="cpptasks.tasks"/>

<taskdef resource="cpptasks.types"/>

<target name="hello">

<cc name="gcc" outfile="hello">

<fileset dir="." includes="hello.c"/>

<compilerarg value="-O2"/>

</cc>

</target>

</project>

with this Makefile for gmake:


hello: hello.c

gcc -O2 $< -o $@

I think I’ll stick with gmake for now.