http://www.nhplace.com/kent/Papers/Large-Systems.html
http://www.canb.auug.org.au/~millerp/rmch/recu-make-cons-harm.html

Makedir
=======


We  want  to  manage  two  kinds  of  source  packages:  programs  and
libraries.   In addition, we  want to  be able  to gather  modules and
submodules.


Previously,  one source  hierarchy  would be  NFS-mounted on  serveral
architectures and  possibly compiled  on several architectures  at the
same time.   Hence the use  of object.${TARGET] directories  where the
compilation was done. However, for one thing this scheme did not scale
very well (needed  to create artificial target names),  and anyway, it
was never implemented to the full extent (bin, lib directories...).

Anyway,  nowaday we  use  CVS  and can  duplicate  more easily  source
hierarchies (big  hard disks  being available).  Therefore,  either we
design  a sophisticated  scheme, like  gcc, to  compile in  a separate
object hierarchy (but we don't really  need it, while gcc has to do it
for cross-compilation), or we  just compile in the source directories,
avoiding to create  temporary directories that would be  in the way of
cvs.







Installation directory hierarchy
================================

    install-dir
    -----------
        bin/
            program1
            program2
        lib/module1/
            interfaces/
            libraries/
            documentation/
        lib/module2/
            interfaces/
            libraries/
            documentation/
        ...

        The install-dir  is specified when compiling a  module. It may
        be either the project-dir or a subdirectory of it, or a global
        installation directory.


    project-dir
    -----------
        Makefile
            SUBPROJECT=module1 module2
            include $(COMMON)/makedir/project

        module1/
        module2/
        ...


    module-dir (either program or library)
    --------------------------------------
        Makefile
            include $(COMMON)/makedir/module

        analysis/
        architecture/
        design/
        documentation/
        interfaces/
        reviews/
        sources/
            Makefile

                PROGRAMNAME=name
                include $(COMMON)/makedir/program

                LIBRARYNAME=name
                include $(COMMON)/makedir/library


        specifications/
        tests/


        (tests may be either a (sub-)project-dir, or a module-dir)



    Everything is compiled in the sources/ subdirectories, then it may
    be installed  in the  install-dir. In the  case of a  project with
    some  modules,  the  modules  are  compiled and  installed  in  an
    project-specific installation directory.

    The target

    project-dir




Makefile targets
----------------

    clean       Remove .o and similar compilation intermediary files.

    cleanall    Remove also build targets such as lib*.a, executables, etc.

    distclean   Removes everything but what would be distributed (may keep
                some intermediary sources generated by special tools).

    cvsclean    Removes everything that does not go into CVS.

    help
    depend
    all
    install
    showvars
    conflicts   Greps CVS conflicts.


Makefile parameters
-------------------

    MAKEDIR     Where the makefiles are found.
                $(COMMON)/make

    BCLIB       Where the BCLIB module is installed.
                $(PREFIX)/bclib

    BPLIB       Where the BPLIB module is installed.
                $(PREFIX)/bplib


    The module directories generaly contain:

        $(MODULE)/interfaces/
        $(MODULE)/documentation/
        $(MODULE)/libraries/



Makefiles
---------

    apply           An xargs wrapper/replacement.
    distribution    Detects the running system/distribution/release.
    maketemplate    This script builds a software project directory.
                    Copies one of the following template Makefiles.

    library_template_makefile
    module_template_makefile
    program_template_makefile
    project_template_makefile

    project         Rules to build a project (a list of MODULES).
    module          Rules to build a module (include sources/Makefile).
    library         Rules to build a library.
    program         Rules to build a program.
    common          Common rules.
    lisp            Rules to build lisp programs.

    target          An empty target used until TARGET is determined.

    targetAIX
    targetDJGPP
    targetLinux
    targetMACINTOSH
    targetDarwin
    targetNEXTSTEP



Recursive Make
==============

Note that this make system is not designed according to the "Recursive
Make Considered Harmful" paper, because it does not try to compile one
big  project,  but  several  libraries  or  programs.   If  there  are
dependencies  accross  libraries, there  are  not  established in  the
source directories, but to the installed copy.

However, it  is desirable  to have a  non recurisve make  framework to
build  large  projects  composed  of several  modules,  libraries  and
programs.


    Makefile
    include subdir/Makefile.inc

- project = { program , library }...
- library = libXxxx.{a,so}
- program = Xxxx

A project :
    - a list of modules (subprojects / subdirectories),
    - a list of targets { executable, library, other }.


                  ---------------------------------
                              ---------
                                  .
ViewGit