Path: utzoo!utgpu!attcan!uunet!sco!rosso From: rosso@sco.COM (Ross Oliver) Newsgroups: comp.unix.xenix Subject: Re: Makefile question Message-ID: <1283@viscous.sco.COM> Date: 11 Jan 89 23:48:19 GMT References: <3450@ucdavis.ucdavis.edu> Distribution: comp.unix.xenix Organization: SCO Technical Support Lines: 51 In article <3450@ucdavis.ucdavis.edu> tuck@iris.ucdavis.edu (Devon Tuck) writes: >I am having difficulties using a Makefile for compiling LPI-Fortran >programs. The following does not work for me, and I assume I have not >scrutinized the make instructions well enough to catch the problem. > >test: test.o > ldfortran -o test test.o >test.o: test.f > lpifortran test.f > >The error I get is: > >NAME: ldfortran - Command not found >INAME: lpifortran - Command not found >. >. >etc. We traced the cause of this to the fact that /usr/bin/ldfortran is actually a Bourne shell script. The make utility executes the command lines in the makefile using the shell specified in the SHELL environment variable, normally set to your login shell by /etc/login. In this case, SHELL was set to /bin/csh. However, the first three non-comment lines in /usr/bin/ldfortran are: NAME=ldfortran INAME=lpifortran VERSION=03.00.00 These are valid variable assignment statements to the Bourne shell, but are interpreted as external commands by the C shell, resulting in the errors NAME=ldfortran: Command not found INAME=lpifortran: Command not found VERSION=03.00.00: Command not found The shell script then exited with a non-zero exit code, causing make to quit. The easiest way to correct this problem is to add the following line to the top of your makefile: SHELL=/bin/sh Make will then execute commands using the Bourne shell rather than the C shell. This is only necessary if you need to execute Bourne shell scripts from within you makefile, and you use the C shell as your login shell. Ross Oliver Technical Support The Santa Cruz Operation, Inc.