Improving Incremental Builds Using ObjDir Method

One annoyance I’ve ran into while working with incremental builds is that the Makefile are generated in the obj-dir. Rebuilding requires you to go from your source directory to your corresponding obj-dir and invoking ‘make’.

Just place the following command in a script in your path:

cd $(pwd | sed 's/mozilla-central/mozilla-central\/obj-ff-dbg/g') && make; cd -

make -C $(pwd | sed 's/mozilla-central/mozilla-central\/obj-ff-dbg/g')

This script will call the corresponding obj-dir Makefile from the source folder. As readers mentioned the second version removes the ‘cd’ nastiness, thanks!

This is great if your working with both 32 and 64-bits obj-dirs since you can create a make32.sh and make64.sh script to trigger the corresponding incremental build from the same source folder and manage two builds!

Advertisements

5 thoughts on “Improving Incremental Builds Using ObjDir Method

  1. I got the habit of assuming that the Makefile need to be invoked from the pwd from working with a few ‘bad’ build systems in the past but you are right, this should be fine with mozilla code base. I will change it, thanks.

    Edit: I’ve just tried the following command instead: make -f $(pwd | sed ‘s/mozilla-central/mozilla-central\/obj-ff-dbg/g’)/Makefile but it fails since the Makefile references ‘../config/autoconf.mk’.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s