🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #124

Make and Dynamic Dependencies

#124
From: Steve Robertshaw
Date: Thu, 09 Apr 1992 18:30
48 lines
2196 bytes
Hi,

We are currently running under 2 different environments. One is under SunOS and
the other is under Motorola's Unix SYS V R3. I wanted to use gnumake to create
a consistent set of Makefiles which could take advantage of searching an SCCS
directory (which is something the native SYS V R3 make does not do).
In converting my files there has only been one area that has really stumped me.
In the SunOS make and the SYS V R3 make there is something called the
Dynamic Dependency. It uses the $$@ notation. I read your workaround
for creating library/archive entries, however, I can not seem to achieve
the desired results for our application which is: 

We have a list of targets. I want the file part of the target checked as a
dependency and then the proper target rules to be applied to the dependency
which will then be followed by a copy. The part of the Makefile I am trying to
make work looks like this:


VMON_TARG_DIR=	../../$(MAKE_TARGET)/vmon
LIB_DIR=	../../$(MAKE_TARGET)/lib

DOWNLOADS=	\
		$(VMON_TARG_DIR)/mmon \
		$(VMON_TARG_DIR)/fep \
		$(LIB_DIR)/gmgr.ld \
		$(LIB_DIR)/traplib.o

$(DOWNLOADS):	$$(@F)
		cp $? $@


This works nice because there is only ever 1 $? that is created by $$(@F). If I
only use $(@F), the variable does not get expanded. I have tried to use the
static variable rule but I don't seem to have the right combination of targets
to fit into that rule. I am sure I could write a rule for each target but I
would like not to do that...

Thanks for your help.

P.S. I was told to say "I'm not on the list", so if you could may a reply
directly back to me that would be great. Thanks again...

-- 

Steve Robertshaw                curtech!swr@nic.unh.edu
Current Technology              (603) 868-2270
99 Madbury Rd.
Durham, NH   03824
Technical Details
Message-ID: <9204091830.AA08372@ctnet>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!curtech.UUCP!swr

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!curtech.UUCP!swr
From: swr@curtech.UUCP (Steve Robertshaw)
Subject: Make and Dynamic Dependencies
Message-ID: <9204091830.AA08372@ctnet>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 9 Apr 1992 18:30:12 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 49