Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!umd5!uvaarpa!mcnc!rti!tijc02!djm408 From: djm408@tijc02.UUCP (David Marks ) Newsgroups: comp.unix.questions Subject: Re: Slave shell in nmake Message-ID: <190@tijc02.UUCP> Date: 25 Jan 88 18:38:00 GMT References: <367@dlhpedg.co.uk> Organization: Texas Instr., Johnson City TN Lines: 43 in article <367@dlhpedg.co.uk>, cl@dlhpedg.co.uk (Charles Lambert) says: > Summary: What is the scope of the slave environment? > > We recently acquired nmake from the AT&T Toolchest. Since we haven't got > ksh(1), I converted it to run with Bourne shell (which doesn't provide > inheritance of shell functions). Looking at the source, I couldn't decide > for certain whether there should be one slave shell for the entire execution > of nmake, or whether a separate shell should be spawned (and subsequently > input-terminated) for each rule block. The alternate consequences are that > the current directory and environment variables either have scope for > the entire make (so one rule can alter the environment in which a > subsequent rule executes) or only for one rule. > > Anyone able to enlighten me? > > ------------------ > Charles Lambert ukc!datlog!dlhpedg!cl One of the nice things about nmake(1), is that it runs all rule actions in the same shell, thereby saving the overhead of process creation for each rule/target it is going to execute. This should increase the speed of execution. Additionally, as you stated, the shell environment is preserved from one rule/target execution to another within the same nmake invocation. This makes nmamke makefiles leaner, as shell variables and functions only have to be set in one rule, and not by all rules that need to use them. The two major advantages of nmake(1) as I see it, are the single shell accross all rules, and the fact that it knows about multiple directories. If you modify it to spawn a shell for each rule excution, then you have defeated one of the main reasons to use nmake(1). ----------------------------------------------------------------------------- #include LIFE IS NOT A MALFUNCTION! David J. Marks Texas Instruments Ms 3520 Erwin Highway/P. O. Drawer 1255 Johnson City, TN. 37605 mcnc!rti!tijc02!djm408