Build Management

Diomidis Spinellis
Department of Management Science and Technology
Athens University of Economics and Business
Athens, Greece

The Build Process

Diagram of the build process

Typical Project Dependencies

Typical project dependencies

Example: Apache Project Dependencies

Apache dependencies

Example: Mozilla Dependencies

Mozilla dependencies

Example: Internet Explorer Dependencies

Interner Explorer dependencies

Tool Types


Part of an Apache Makefile

  modules.o \
  $(MODULES) \
  main/libmain.a \
  $(OSDIR)/libos.a \

        $(CC) -c $(INCLUDES) $(CFLAGS) $<

        emximp -o $@ $<


lib$(TARGET).$(SHLIB_SUFFIX_NAME): subdirs modules.o
        $(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c

target_static: subdirs modules.o
        $(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c
              -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) $(EXPATLIB) $(LIBS)

        -rm -f $(TARGET) lib$(TARGET).* *.o
        @for i in $(SUBDIRS); do \
                echo "===> $(SDP)$$i"\
                ( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' $@ ) || exit 1; \
                echo "<=== $(SDP)$$i"\


$(OBJS): Makefile subdirs

buildmark.o: buildmark.c include/ap_config.h include/ap_mmn.h \
 include/ap_config_auto.h os/unix/os.h include/ap_ctype.h \
 include/hsregex.h include/httpd.h include/ap_alloc.h include/buff.h \
 include/ap.h include/util_uri.h
modules.o: modules.c include/httpd.h include/ap_config.h \
 include/ap_mmn.h include/ap_config_auto.h os/unix/os.h \
 include/ap_ctype.h include/hsregex.h include/ap_alloc.h include/buff.h \
 include/ap.h include/util_uri.h include/http_config.h

Make Problems and Solutions


The Ant Approach

Some ant Tasks

Examples of ant built-in tasks:

Example Ant Build File

<project name="Jasper" default="deploy" basedir=".">
  <!-- ===================== Initialize Property Values =================== -->

  <!-- See "" in the top level directory for all     -->
  <!-- property values you must customize for successful building!!!        -->
  <property file=""/>
  <property file="../"/>
  <property file="${user.home}/"/>

  <!-- Build Defaults -->
  <property name="build.compiler"    value="classic"/>
  <property name="copy.crimson.jar"  value="../lib/crimson.jar"/>

  <!-- =================== BUILD: Create Directories ====================== -->
  <target name="build-prepare">

    <available classname="junit.framework.TestCase" property="junit.present" />

    <mkdir dir="${}"/>
    <mkdir dir="${}/jasper"/>
    <mkdir dir="${}/lib"/>


  <!-- =================== BUILD: Copy Static Files ======================= -->
  <target name="build-static" depends="build-prepare">

    <!-- Executable Commands -->
    <copy todir="${}/bin">
      <fileset dir="src/bin" />
    <fixcrlf srcdir="${}/bin" includes="*.sh" eol="lf"/>
    <fixcrlf srcdir="${}/bin" includes="*.bat" eol="crlf"/>
    <chmod perm="+x" file="${}/bin/"/>
    <chmod perm="+x" file="${}/bin/"/>

    <!-- Common Extensions -->
    <copy todir="${}/jasper" file="${copy.crimson.jar}"/>
    <copy todir="${}/jasper" file="${copy.jaxp.jar}"/>


  <!-- ================= BUILD: Compile Server Components ================= -->
  <target name="build-main" depends="build-static">

    <!-- Compile internal server components -->
    <javac srcdir="src/share" destdir="${}/classes"
           debug="${compile.debug}" deprecation="${compile.deprecation}"
      <classpath refid="jasper.classpath" />

The Maven Approach

Maven's Lifecycle

(Source: Apache Maven Lifecycle Reference (

Automating System Configuration

Best Practices

Best Practices (Variables)

Use variables for varying elements:

Further Reading