Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!att!cbnewsl!moss!jona From: jona@moss.ATT.COM (Jon M. Allingham) Newsgroups: comp.sources.d Subject: Re: Looking for a make version to better support software versions Summary: nmake will do it Keywords: nmake Message-ID: <3613@cbnewsl.ATT.COM> Date: 12 Jan 90 13:07:06 GMT References: <1440@jimi.cs.unlv.edu> Sender: nntp@cbnewsl.ATT.COM Reply-To: jona@moss.ATT.COM Followup-To: comp.sources.d Organization: AT&T Bell Laboratories Lines: 78 In article <1440@jimi.cs.unlv.edu> jack@jimi.cs.unlv.edu (Jack Alexander) writes: ] ] Hello: ] ] I have a need for a make-type program that will allow recompilations ] to be dependent on the changing of compiler definitions (i.e., "-DVERSIONB") ] The problem is that I have many megabytes of code that have to support ] many, many different versions of basically the same program. Because I ] want to keep the guts of the system the same, whereever a slight ] modification is needed for a particular version, I just make the code ] segment conditional using #ifdef's, #ifndef's, etc. However, when I change ] a compile variable, I don't want to re-compile every file (some directories may ] have 50 source files each), just the ones that actually reference the variable. ] ] Has anybody heard of any such program? Does anybody else need such a program? ] If the need is terrific, I may endeavor to hack it into gnu make. If I do ] this, I would appreciate any recommendations. ] ] -- Jack Alexander AT&T has a new version of make (nmake) that does exactly that sort of thing. You can set variables in the makefile, specify that certain source files depend on them and then the "cc" line will put in the -Dvar=val. It maintains all info in a state file and recompiles the necessary files when needed. Changing the rule will also cause the correct files to be recompiled. It also does auto dependency generation, i.e. it determines automagically what header files are #included (even does nested includes) and allows make variables to be specified as "SCAN" variables, in which case it will scan source files (including #include files) for use of that symbol and include its value as a -Dvar=val. It also has full support for viewpathing which is really a must for large projects. Viewpathing allows you to have a "background (or `official' node" containing the entire project directory structure and one or more "development nodes" which contain some piece corresponding to the official structure. This development node is overlayed on the official node and any files in it supercede the official stuff. Any files not found in a development node are take from the official node. Pretty slick actually. Makefiles are also preprocessed with cpp and there is a lot of support for conditionals inside the makefile. Setting command line flags will change the conditionals. Between getting rid of the explicity dependencies and adding more power to make, nmake makefiles are significantly smaller and more powerful than their make counterparts. It also works on many different machines, the only real requirement is that the C compiler allow an alternate cpp be used since the standard cpp's header search rules break viewpathing. The only problem I can forsee is availability outside AT&T. As I am only a happy user I really don't know what the status is. If you are interested in finding out more or in determining availability contact nmake@mozart.ATT.COM or perhaps steve@mozart.ATT.COM. My 2 cents on adding features like this to existing makes: Some stuff can probably be added without too much grief, but you really are looking at some fundamental changes in the way make works. I know that Nmake was entirely new code and not a re-hack of make and it still is a monster program. ---- Jon M. Allingham (201)386-3637 AT&T Bell Laboratories (Whippany,NJ) {clyde}!moss!jona WH 14D-339 "To those of us with real understanding, dancing is the only pure art form" -Snoopy -- ---- Jon M. Allingham (201)386-3637 AT&T Bell Laboratories (Whippany,NJ) {clyde}!moss!jona WH 14D-339