USDA ARS

IPW Makefiles

include files

Over 400 Makefiles are used to manage IPW's source directory "$IPW/src". The maintenance of so many Makefiles is greatly simplified by the extensive use of the include feature of GNU's version of "make".

This feature allows a set of Makefiles to share macro definitions and dependency rules via a single include file. The hundreds of Makefiles are quite small and simple because the macro definitions and dependency rules are all located in a small set of include files (i.e., less than 20 files). Furthermore, the Makefiles are fairly stable since modifications are limited to the include files.

All the include files are located in "$IPW/make" directory. There is one include file for each type of subdirectory in IPW's source directory. For example, the include file for an IPW command's individual subdirectory is aptly named "command", while the include file for an IPW library of C functions is named "library".

Common targets

One advantage of using include files in the Makefiles is the standardization of targets for the "make" command. Some of the common targets are:

help
This target displays a list of possible targets for the current directory.

install
This target builds commands, library functions, and their manual pages, and then installs them into their respective directories: "$IPW/bin", "$IPW/lib", and "$IPW/man".

clean
This target removes intermediate files that are generated as part of building commands, library functions, and manual pages, for example, the object files (*.o) from compiling C source code files.

install-clean
This target yields the same results as specifying the individual targets "install" and "clean" together; however, this targets removes intermediate files as it installs thereby minimizing the disk space used during the installation process.

real-clean
This target removes every generated file, essentially restoring a directory to its original state, i.e., the way it was prior to building and installing the software. NOTE: this target also uninstalls IPW commands and libraries; therefore, it should only be used prior to rebuilding and installing part of or all of the IPW software.


IPW documentation / Last revised 20 May 2009 / IPW web site