####################################################################### # # # MK # # # # Generic makefiles # # # # projets Estime & Cristal, INRIA-Rocquencourt # # # # Copyright 2005-2007 INRIA. # # Institut National de Recherche en Informatique et en Automatique. # # All rights reserved. This file is distributed only by permission. # # # # Francois Clement # # Pierre Weis # # # ####################################################################### $Id: README,v 1.1 2007-07-13 12:53:27 fclement Exp $ Mk is a system of generic makefiles and development technology for building and maintaining computer handled projects of various kind (e.g. libraries, applications, papers, websites). The intent is to provide a simple machinery which is (much) easier to use than autoconf/automake, and is validated under both BSD and Gnu make technologies (meaning that we do not use any capability only provided by a specific implementation of make). Several useful tasks are handled automatically including the management of ".cvsignore" files, file banners and compilation dependencies, the production of documentation and the execution of tests. Several programming languages are supported including Caml, C, C++, Fortran, Java. To install the Mk system, follow the instructions in the INSTALL file. Mk is a free software distributed under the BSD license, see the LICENSE file for details. 1 - For the users of the distributed version of your package They should follow To configure, build and install the package ./configure [] make make install When called with one argument, the "configure" script makes it the root directory for the installation. When called without any argument, the "configure" script interactively asks the user. The expression ``installation root directory'' means that: - binaries go into subdirectory "bin", - includes go into subdirectory "include/", - Caml libraries go into subdirectory "lib/ocaml/" and other libraries go into subdirectory "lib/", - manual pages go into subdirectory "man/man", - (La)TeX documentations go into subdirectory "share/doc/tex" and HTML documentation pages go into subdirectory "share/doc/htm", - other materials go into subdirectory "share/". To remove all files installed by "make install", all files built by "make" and all files created by "./configure", respectively type in: make uninstall make clean ./unconfigure 2 - For the developers of your package The idea is to visit each sub-directory that must contain its own makefiles ``Makefile'' and ``Makefile.user''. ``Makefile.user'' is renamed ``Makefile'' in the distributed version of the package; hence, ``Makefile.user'' does not contain any development target. ``Makefile.user'' is included by the development makefile ``Makefile'' in order to use it during the entire development phase of the package. ``Makefile.user'' includes generic task makefiles from MK. 2.1 - The user makefile ``Makefile.user'' MK provides generic configuration makefiles ``*Config*.mk'' Each family of generic user makefiles have a particular destination: - */Config*.mk : configuration makefiles that set generic variables, - */Common*.mk : common makefiles that provide generic rules and targets - /Library.mk : to build a library, - /Application.mk : to build a stand alone application, - /Test.mk : to perform tests, - Subdirs.mk : the ``visitor'' makefile to visit sub-directories. (Technically: shared generic user makefiles are included by other generic makefiles, and thus are not supposed to be included explicitely: - Config.mk, Common.mk : universal makefiles included by universal compilation makefiles and the visitor makefile, - Config.compile.mk, Common.compile.mk : universal compilation makefiles included by specific compilation makefiles, - /Common.mk : common compilation makefiles specific to , included by the library, application and test makefiles.) Other generic makefiles are devoted to specific tasks and should be included by the user when appropriate: - /Config.mk : configuration compilation makefiles specific to , - /Library.mk : to build libraries, - /Application.mk : to build applications, - /Test.mk : to execute the tests, - text/Config.mk : configuration makefile specific to text purposes, - text/Common.mk : common makefile specific to text purposes, - Subdirs.mk : visitor makefile when there are no source files to compile in the directory. A typical makefile ``Makefile.user'' should first set the MKROOTDIR variable to a path to the directory where MK is installed. Then ``Makefile.user'' should include the appropriate generic configuration makefile, then set the corresponding generic variables, and include the appropriate generic task makefile, and finally possibly overload the generic local targets (see each generic task makefile). The MK package has its own ``Makefile.user'' that provides configuration, e.g. to set the parent directory for installation. 2.2 - The developement makefile ``Makefile'' The set of generic makefiles ``devel/*.mk'' is meant for developing purposes including the management of ``.cvsignore'' files and banner files ``banner_*'' through the use of the text file processor ``htmlc'', the bannerization through the use of the banner handler ``bh'', and the distribution of packages. ``Makefile'' provides the list of non-standard files to be bannerized and non-standard distribution actions (which is way too complicated to be factorized). - /Documentation.mk: to build the documentation, 3 - Universal make semantics We list here the semantics requirement about ``make'' on which this generic makefiles are based... Variables must be defined before they are actually used as target or dependencies. Quiet inclusion sinclude Target definition operators :, :: Variable assignment =, :=, ?=, +=, Substitution references Automatic variables $@, $<, $*, $(MAKE) Special targets .SUFFIXES, .PHONY