csh scripts in Makefiles

Mark Johnson OPER mj at elmgate.UUCP
Sat Jan 7 01:35:57 AEST 1989


	I am trying to write Makefiles using Sun 4.0 make.  I would
	like to use csh as the command interpreter for the
	lines in the makefile, which is easy;
	SHELL=/bin/csh
	will do it.  Because of of csh's unfortunate requirement
	that certain keywords (such as foreach, while, end, etc.)
	appear alone on a line, I can't seem to write makefiles
	using these constructs.  csh scripts work OK, but
	embedded in Makefiles with \'s at the ends, the
	scripts fail.  Looking at the output of the Makefile below,
	I'm a little puzzled as to why the interpreting shell is "-sh",
	but it understands "foreach"; it *must* be a csh, but
	I don't see it in the 'ps'.  Does anyone know what's going 
	on, and/or know a workaround?  Here's the example:

% cat Makefile
SHELL=/bin/csh
GRONK=a b c d
bletch:
        set verbose echo;\
        ps xg;\
        foreach i ($(GRONK)) ;\
                echo $$i ;\
        end
% make
set verbose echo;\
ps xg;\
        foreach i (a b c d) ;\
                echo $i ;\
        end
ps xg
  PID TT STAT  TIME COMMAND
20284 p1 S     0:00 make
20293 p1 R     0:00 -sh -ce set verbose echo;\ps xg;\        foreach i (a b c d
20294 p1 R     0:00 ps xg
24415 p1 S     0:15 -csh (csh)
foreach i ( a b c d )
? foreach: end not found.
*** Error code 1
make: Fatal error: Command failed for target `bletch'
%

	Any help would be appreciated... Please respond via email;
	I'll post a summary if there's sufficient interest.

						Mark

-------------------------------------------------------------------------------
Mark A Johnson                                 Eastman Kodak Company - SISD
UUCP: rochester!kodak!elmgate!mj  USPS: 222 Norman Road, Rochester NY 14623
WORK: (716) 726-7035
"Quidquid latine dictum, altum videtur."



More information about the Comp.unix.questions mailing list