Worlds smallest JUCE build file (or, bollocks to make)


#1

I had to set this up for our own purposes (ant/c++/java/sql batch testing system). May be of interest to others.

You’ll need Ant (you’ll likely have it already?) from…

http://ant.apache.org/

and the cpptasks from…

http://downloads.sourceforge.net/ant-contrib/cpptasks-1.0b4.tar.gz?modtime=1148053176&big_mirror=0

you’ll need to put “cpptasks.jar” in /usr/share/ant/lib (or whereever your ant lib folder is)

put the following in juce/build/linux as “build.xml”

<?xml version="1.0" ?>
<project default="release"> 
 
	<taskdef resource="cpptasks.tasks"/>
    <typedef resource="cpptasks.types"/>

	<property name="juce.outdir" 	value="../../bin" /> 
	<property name="juce.objdir" 	value="${juce.outdir}/intermediate_linux" />
	<property name="juce.srcdir" 	value="../../src" />
	<property name="juce.libs" 		value="pthread,freetype,X11" />
	<property name="juce.c_args" 	value="-Wall" />
	<fileset id="juce.srcfiles" dir="${juce.srcdir}" includes="**/*.h,**/*.cpp" />

	<target name="release" depends="make-juce-dirs">
		<cc name="g++"
			debug="false" 
			objdir="${juce.objdir}/Release"
			outtype="static"
			outfile="${juce.outdir}/juce"
			multithreaded="true"
			runtime="dynamic">

			<compilerarg value="${juce.c_args}" />
			<defineset define="LINUX=1,NDEBUG=1" />
			<fileset refid="juce.srcfiles" />
			<libset libs="${juce.libs}" />
		</cc>
	</target>

	<target name="debug" depends="make-juce-dirs">
		<cc name="g++"
			debug="true" 
			objdir="${juce.objdir}/Debug"
			outtype="static"
			outfile="${juce.outdir}/juce_debug"
			multithreaded="true"
			runtime="dynamic">

			<compilerarg value="${juce.c_args}" />
			<defineset define="LINUX=1,_DEBUG=1,DEBUG=1" />
			<fileset refid="juce.srcfiles" />
			<libset libs="${juce.libs}" />
		</cc>
	</target>

	<target name="make-juce-dirs">
		<mkdir dir="${juce.objdir}/Release" />
		<mkdir dir="${juce.objdir}/Debug" />
	</target>

</project>

to build, cd to juce/build/linux and do…

for release, or

no more makefiles! yay!!

off to do win32 version…


#2

Looks cool - I’ve never tried ant, but have heard good things about it.


#3

Interesting… I was thinking about doing a JUCE makefile so I could use Eclipse (specifically on the Mac, since I’m not a fan of Xcode), but it seemed rather involved. Maybe I’ll have more luck with this Ant script.


#4

Also take a look at this:
http://www.bakefile.org/index.html

I like it a lot since it can generate a variety of projects/makefiles in a cross-platform manner, from a simple XML file.


#5