Path: utzoo!attcan!uunet!snorkelwacker!apple!rutgers!mcnc!rti!sunpix!matthew From: matthew@sunpix.East.Sun.COM ( Sun Visualization Products) Newsgroups: comp.unix.questions Subject: Re: unix commands in makefiles Message-ID: <1152@jetdebug3.East.Sun.COM> Date: 18 Feb 90 22:19:37 GMT References: <6141@umd5.umd.edu> Distribution: na Organization: Sun Microsystems, Research Triangle Park, NC Lines: 48 In article <6141@umd5.umd.edu> jjk@astro.UMD.EDU writes: } }Running under sunos 4.0.3, I have the following in my makefile: } }__________________________________________________________________ }DEST = $(HOME)/astrobin/`arch` }__________________________________________________________________ } }__________________________________________________________________ }LIBS = $(HOME)/astro/astro.a \ } $(HOME)/iraf/lib/`arch`/iraf.a \ }__________________________________________________________________ } }I get the following error message when I try to make my program: } }make: Fatal error: Don't know how to make target `/a/jjk/iraf/lib/`arch`/iraf.a' } }Obviously, the `arch` works as expected in the DEST definition, but is }not getting read properly in the LIBS definition. Can someone please }help me with this? } }Thanks } }Jim Klavetter Judging by the error message, I assume you were using `$(LIBS)' in a dependency list. Thats were your problem is. When you were using back-quotes in the `DEST' macro, the text of that macro got passed to a shell and the shell did the command substitution. Dependency lists are handled by make(1) itself, and make does not know about command substitutions. To get around this problem, try making a new macro called ARCH. ARCH can be set one of two ways. 1) If you set an enviromental variable ARCH to the value of `arch` in your current working shell, it will propagate to a pre-defined macro in the makefile. 2) Add the following macro definition to your makefile. It uses a pre-defined macro "$(TARGET_ARCH)" and strips off the preceding dash. ARCH = $(TARGET_ARCH:-%=%) -- Matthew Lee Stier | Sun Microsystems --- RTP, NC 27709-3447 | "Wisconsin Escapee" uucp: sun!mstier or mcnc!rti!sunpix!matthew | phone: (919) 469-8300 fax: (919) 460-8355 |