Streamlining Makefile output

Issues related to installation of ADL
Post Reply
houchin
Posts: 128
Joined: Mon Jan 10, 2011 6:20 am

Streamlining Makefile output

Post by houchin »

Hi all...

Another request here related to minimizing output from Make and the compiler when rebuilding ADL. I've also send this one onto Paul Meade, but I am posting here to see what others think.

When compiling by hand through a terminal (not through an integrated development environment), particularly for huge projects with lots of include directories and other compiler params, Make tends to produce a lot of output itself. For example, on an 80 character wide terminal window, just the single line to compile one C++ file results in 11 lines on my screen. When everything works fine, this is generally not a problem. However, when I or one of the analyst on my team is trying to make an algorithm update, I expect there will be some errors here and there. For a C++/Unix savvy software developer, yes, we are used to this and can deal with it.

However, as I push some code update tasks from people that are more software oriented (and thus skilled in C and Unix Make) to the analyst team (generally Matlab or IDL programmers), making the output of a rebuild as simple and clear as possible is important. If they make changes to a few C++ files and compile with some errors, it should be immediately clear which file contained the error.

To that end, I would like to see the Makefiles updated to hide much of the compiler syntax and parameters. I have never written an Imakefile myself, but in just thinking of the resulting Makefile, it occurred to me that something as simple as the following would work (and certainly there may be other solutions and I've not tied to this solution):

Create a simple script cc.sh in $ADL_HOME/scripts

Code: Select all

#!/bin/sh

$CCr $CCr_PARAMS "$@"
This script allows both the specific compiler and the compiler parameters to be specified through environment variables. The Makefile could be updated as follows:

Code: Select all

export CCr := ${GCCLOC}/g++
CCs = ${ADL_HOME}/scripts/gcc/cc

.c.o:
	$(CCs) -c $< -o $@
This would result in, for example, the very simple statement:

Code: Select all

/path/to/ADL/scripts/cc -c CalCAndCPrime.cpp -o CalCAndCPrime.o
Instead of the monster:

Code: Select all

/group/viirs/local/gcc432/bin/g++ -DBYTE_ORDER_LE -DADL_ENV -D_USE_FLAT_FILE_ -D_THREAD_SAFE -DGCC -m64 -fPIC -Wall -Wno-unknown-pragmas -ggdb3   -DEXCLUDE_CRIS   -I../include 	-I/group/viirs/adl/adl31/ADL/SDR/VIIRS/include 	-I/group/viirs/adl/adl31/ADL/CMN/Utilities/INF/include 	-I/group/viirs/adl/adl31/ADL/CMN/Utilities/include 	-I/group/viirs/adl/adl31/ADL/CMN/Utilities/INF/common/exceptions/include 	-I/group/viirs/adl/adl31/ADL/CMN/Utilities/ING/include 	-I/group/viirs/adl/adl31/ADL/CMN/VerifiedRDRs/include 	-I/group/viirs/adl/adl31/COTS/boost_1_45_0 	-I/group/viirs/adl/adl31/ADL/Geolocation/TerrainCorrect/include 	-I/group/viirs/adl/adl31/ADL/Geolocation/CmnGeo/include 	-I/group/viirs/adl/adl31/ADL/Geolocation/novas-c201/include -I/group/viirs/adl/adl31/ADL/include               -I/group/viirs/adl/adl31/ADL/CMN/Utilities/DMS/include               -I/group/viirs/adl/adl31/ADL/CMN/Utilities/INF/include               -I/group/viirs/adl/adl31/ADL/CMN/Utilities/INF/common/exceptions/include               -I/group/viirs/adl/adl31/ADL/CMN/Utilities/INF/common/util/include               -I/group/viirs/adl/adl31/ADL/CMN/Utilities/INF/util/cfg/include               -I/group/viirs/adl/adl31/ADL/CMN/Utilities/INF/util/time/include               -I/group/viirs/adl/adl31/ADL/CMN/Utilities/ING/include               -I/group/viirs/adl/adl31/local/include               -I/group/viirs/adl/adl31/COTS/boost_1_45_0               -I/group/viirs/adl/adl31/COTS/xerces-c_2_8_0-x86_64-linux-gcc_3_4/include -c CalCAndCprime.cpp -o CalCAndCprime.o
Scott Houchin, Senior Engineering Specialist, The Aerospace Corporation
15049 Conference Center Dr CH3/310, Chantilly, VA 20151; 571-307-3914; scott.houchin@aero.org
Post Reply