help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gmake: multiple tgts, using stem as part of make env var for dep list..


From: Meier, Kerry
Subject: gmake: multiple tgts, using stem as part of make env var for dep list...
Date: Thu, 22 Feb 2001 09:37:07 -0500

I am trying to use the 'stem' value of a multiple target rule as part of a
make variable. The make variable(s) then contain a list of *.o files which
are the dependencies for the particular target. make does not 'complain'
about this, but the list of *.o files are not being utilized as
dependencies.

Is make supposed to recursively expand the make variable in this case?

I am using:
GNU Make version 3.74 (vpath+), by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation,
Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Example: ------------------------------------------------------------------

l1_OBJ_LIST = f11.o f12.o f13.o
l2_OBJ_LIST = f21.o f22.o f23.o

l1_TESTFUNC_LIST = t11.o t12.o t13.o
l2_TESTFUNC_LIST = t21.o t22.o t23.o

TARGETS = l1.obj l2.obj

$(TARGETS) : %.obj : $(%_OBJ_LIST)   $(%_TESTFUNC_LIST)
        $(LD) $(LDFLAGS) $(LD_PARTIAL_FLAGS) \
                       $($*_OBJ_LIST) $($*_TESTFUNC_LIST) \
                -o $(@:.obj=.dbg)

However, as expected, the below will cause the targets (all targets,
regardless of which *.o file is newer) to be linked: ----------

$(TARGETS) : %.obj : $(%_OBJ_LIST)   $(%_TESTFUNC_LIST) \
                                 $(l1_OBJ_LIST) $(l2_OBJ_LIST)
$(l1_TESTFUNC_LIST)  $(l2_TESTFUNC_LIST)
        $(LD) $(LDFLAGS) $(LD_PARTIAL_FLAGS) \
                       $($*_OBJ_LIST) $($*_TESTFUNC_LIST) \
                -o $(@:.obj=.dbg)


I sincerely thank you for any light that you might shed on this issue.

Kerry

"Every job is a self-portrait of the person who did it." Norman Rockwell





reply via email to

[Prev in Thread] Current Thread [Next in Thread]