Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watdaisy!dvadura From: dvadura@watdaisy.UUCP Newsgroups: comp.unix.wizards Subject: Re: "make" SHELL variable Message-ID: <8139@watdaisy.UUCP> Date: Sun, 15-Feb-87 19:22:30 EST Article-I.D.: watdaisy.8139 Posted: Sun Feb 15 19:22:30 1987 Date-Received: Sun, 15-Feb-87 23:20:36 EST References: <3953@brl-adm.ARPA> <2590002@hpisod2.HP> Reply-To: dvadura@watdaisy.UUCP (Dennis Vadura) Organization: Computer Science Dept., University of Waterloo Lines: 39 The question of what shell is used inside make only becomes a problem during those command sequences inside the makefile that are essentially shell scripts. Writing such command sequences makes your makefile non-portable to anything but machines containing compatible shells. There is however a side issue to all this. Most shells provide some form of redirection and pipelining if the OS supports it. It is in these instances that it would be advantageous to have make read the SHELL variable or MAKE_SHELL variable (what you really call it makes little difference) from the environment. Since make can then use the proper shell based on host machine/os combination. I propose, and have implemented the following rules for a version of make that is soon to be released. This make is an attempt at unifying those features of most use found in unix make, adding some features not found in any unix make, fixing bugs/annoyances found in unix make, and making the code usable on a wide variety of machines. (so far this includes vax family, MS-DOS boxen, amiga, and soon Sun, Sys V, etc. ) Thus the point of SHELL is important here. So here are the rules in order of priority (highest to lowest): 1. if you do not mention SHELL anywhere make will use the default compiled in shell. (eg. unix == /bin/sh, DOS == command.com, etc ...) 2. if you mention SHELL in command line or in makefile then that is the SHELL that is used. unless you say SHELL= in this case the default shell is used. 3. if you say -a or -e, (-e == read environment strings) and SHELL is defined in the environment, (-a == look for shell in environment, -e superceeds -a) then that value of SHELL is used provided SHELL is NOT mentioned anywhere that rule 2 applies. This way SHELL found in environment strings can only be used if SHELL is not mentioned anywhere else, and you must specifically request for it to be used. -- -------------------------------------------------------------------------------- Dennis Vadura, Computer Science Dept., University of Waterloo UUCP: {ihnp4|allegra|utzoo|utcsri}!watmath!watdaisy!dvadura ================================================================================