Makefiles, depend and define		( J.Taylor 7th February 1990 )
----------------------------

There is a tree of `Makefile's in the Pygmalion source - and in each
directory where there is a Makefile, there is a corresponding shell script
`make', which invokes the real make binary, but passing it a path to the file
`pygmalion.mk' in the top level directory which contains all the common
variable definitions.

It is relatively easy to create new Makefiles and insert them into the
Pygmalion source tree so that a single `make' command at the top level will
permeate down all the directories and make everything ( in the right order.)
The define and depend scripts described later help to create correct
Makefiles.  These tools don't do ALL the work for you, but save a lot of
bother.  To generate a new Makefile, do the following :

1.	Copy either one of the existing Makefiles, or the skeleton Makefile
	`template.mk' from this directory to the target directory and rename
	it `Makefile' ( must use upper case M ).

2.	Copy the skeleton shell script `sample.make' to the file `make' in
	the target directory.  This calls the real `make', but provides the
	path to the Pygmalion definitions file `pygmalion.mk'.  You should
	have already edited `pygmalion.mk' to conform to your configuration
	( i.e.  where the root `pygmalion' directory is, where to find X
	libraries etc. )

3.	Edit the new `make' to ensure that it contains the correct path from
	the target directory to `pygmalion.mk' ( i.e. how many `../'s ).

4.	In the target directory, run `make define'.  If the pygmalion.mk
	file path is correctly specified, the SRCS and OBJS values in
	`Makefile' will be updated.

5.	Edit the new Makefile, putting a suitable comment in the header, add
	a default target: and put the relative path to the `h' headers
	directory in for HEADERS ( again a number of `../'s ).  Add entries
	if necessary for install: - i.e. binaries to be copied to a standard
	directory.  It may then be necessary to add other targets and rules
	( up to you ).

6.	Run `make depend'.  If step (4.) worked and the HEADERS value is
	correct, then a list of dependencies is added to the end of
	`Makefile'.  Check some of these.

7.	There is an alternative form of `Makefile' which simply calls `make'
	for each of the specified sub-directories.  This form is in
	`pygmalion' itself, `pygmalion/src/nc' etc.  When you add a new
	directory, modify the subdirectory list in `Makefile' in the parent
	directory so that a top level `make' will find all entries in the
	tree.

Note :	Certain # lines in the Makefile's must not be edited or removed -
	don't or you'll break it.

If you add further source ( i.e. .c ) files later, you may re-run `make
define'.  If, however, you have already modified the SRCS or OBJS lists in a
Makefile, DON'T re-run `make define'.  More often though, you will need to
re-run `make depend' to maintain correct dependencies ( especially on .h
files ).  The template Makefile also provides targets `install:' `clean:'
and `tidy:'.  These do obvious things, you may want to augment the number of
file patterns in the clean: and tidy:  lists.

The program `make' varies in detail between different operating systems.  One
good feature of the SunOS `make' is that `make' always acts on command lines
containing the macro $(MAKE).  This is used in the subdirectory-type
Makefile's, thus in the top level `pygmalion' directory, `make -n' will list
all the new compilations etc. that are needed in all directories, because the
nested `makes' are still executed recursively.  This feature is
unfortunately not available with some other varieties of `make'.


depend and define 
-----------------

The `depend' and `define' scripts in this directory are used to generate and
maintain Makefile dependencies.  They are not used directly, but via targets
within Makefile's - see above.  The dependencies in the Makefiles supplied
in the Pygmalion source should be correct already, but you should use the
`make define' and `make depend' options if you create new directories ( for
example for new algorithms ) - and may need to regenerate dependencies with
`make depend' for the existing Makefiles if, for example, you modify the
header ( .h ) files.

These scripts and the make/Makefile techniques are derived from those in the
PP source.  Thanks due to Julian Onions and Steve Kille.

There are two versions of depend :
	depend.43	- 4.3 specific uses cc -M flag
	depend.42	- uses standard unix tools

The 4.3 version does a better job, but the 4.2 is more generic.  If cc has
the -M flag documented use the 4.3 version, if not or you are not sure - use
the 4.2 version. Either way its not too critical.

To configure copy the chosen file to depend, e.g.

	cp depend.43 depend

to install the 4.3 version.


`define' :	edits Makefile in the current directory to create/update the
		variables ${SRCS} and ${OBJS}.

`depend' :	edits Makefile in the current directory to create/update the
		dependency lists for .h files etc.
