Contents|Index|Previous|Next
Complex makefile example

The following is the makefile for the GNU tar program. This is a moderately complex makefile.

Because it is the first target, the default goal is ‘all’. An interesting feature of this makefile is that ‘testpad.h’ is a source file automatically created by the testpad program, itself compiled from ‘testpad.c’.

If you type ‘make’ or ‘make all’, then make creates the ‘tar’ executable, the ‘rmt’ daemon that provides remote tape access, and the ‘tar.info’ Info file.

If you type ‘make install’, then make not only creates ‘tar’, ‘rmt’, and ‘tar.info’, but also installs them.

If you type ‘make clean’, then make removes the ‘.o’ files, and the ‘tar’, ‘rmt’, ‘testpad’, ‘testpad.h’, and ‘core’ files.

If you type ‘make distclean’, then make not only removes the same files as does ‘make clean’ but also the ‘TAGS’, ‘Makefile’, and ‘config.status’ files. (Although it is not evident, this makefile (and ‘config.status’) is generated by the user with the configure program which is provided in the tar distribution; not shown here.)

If you type ‘make realclean’, then make removes the same files as does ‘make distclean’ and also removes the Info files generated from ‘tar.texinfo’.

In addition, there are targets shar and dist that create distribution kits.
 



Top|Contents|Index|Previous|Next