Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.software-eng Subject: Re: Anyone know of a "better" 'make' than vanilla System-V's?. Message-ID: Date: 3 Oct 90 21:12:52 GMT References: <1990Oct3.000440.5275@hades.ausonics.oz.au> Sender: davidm@cimshop.UUCP Distribution: comp Organization: Consilium Inc., Mountain View, California. Lines: 67 In-reply-to: greyham@hades.ausonics.oz.au's message of 3 Oct 90 00:04:40 GMT In article <1990Oct3.000440.5275@hades.ausonics.oz.au> greyham@hades.ausonics.oz.au (Greyham Stoney) writes: My company is working on a medium-to-large software project for which we use standard System-V 'make' to specify the rules by which objects are made from source files, and for specifying the source file dependancies. There are some problems with this however, which lead me to ask if there is anything better we could use; In particular, 'make' seems to have the following annoying problems & deficencies: * The Makefile is assumed to reside in the current directory and each Makefile must contain the rules saying how to make objects, since make's built-in rules aren't right. We have well over 100 Makefiles in one project; most of which contain basically the same information; but with minor differences. Eg: they all contain the same command to put an object in a library, although the library name differs. Changing the name of the librarian utility (if we needed to) would be impossible (have to change 100+ Makefiles just to do that). A couple of things in the standard MAKE can help this situation: 1. You can redefine the standard built-in rules to anything you want by redefining the SUFFIXES list and creating new suffix rules (of the form '.suf1.suf2:'). These 'new' standard rules could then be put into a Makefile include file and use M4(1) to build the Makefile at run-time from the Makefile.m4 file and the include file. One of the standard rules that you would add, for instance, is the rule to make a Makefile from a Makefile.m4. 2. Good use of MACROS can make the Makefile extremely flexible. For instance, "LIBUTIL=ar" and "LIBUTILFLAGS=rv" could be defined to make your standard library utility AR(1), but these macros could be redefined at anytime on the MAKE command line, if you need to change your library utility on a temporary basis. If you need to make it permanent, then these MACROS could also be put in the include file (see 1) so that you would only make the change in one place. * Dependancies must be explicitly listed in the Makefile; and they are never kept up to date: No ammount of forcing people is going to keep them up to date, and it's a pretty pointless exercise anyway. In order to control the rules with which our objects are made, we delta Makefiles which makes it even worse since to update the depenancies you have to get the thing for editing. Why can't the dependancies be discerned from the source file at make time?. The Sun extensions to the standard MAKE for SVR4 will actually do this (when set up properly). There was a "depends" program floating around somewhere (probably Berkeley) that could read C programs and determine its dependencies in a form that could be put into the Makefile. I forget how it worked exactly, but it was mostly a shell script using GREP and AWK to find "#include" statements. These were then massaged into a Makefile form which was then con'CAT'ted onto the end of the Makefile. This was a standard rule that was executed first thing via a "make depend" command (it shouldn't need to be run that often -- how often do you add a new dependency to a file?). If you can't find "depends", it shouldn't be that hard to make yourself (its not terribly complex). BTW, with this approach, you only delta the Makefile.m4 file (which doesn't have dependency lists). Are there any make-like systems that conquer these two basic problems?. Does this help? -- ==================================================================== David Masterson Consilium, Inc. uunet!cimshop!davidm Mtn. View, CA 94043 ==================================================================== "If someone thinks they know what I said, then I didn't say it!"