help-make
[Top][All Lists]
Advanced

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

the % target does not propagate ?!


From: Alex Tillequin
Subject: the % target does not propagate ?!
Date: Tue, 19 Nov 2002 18:33:02 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901

Hi,
I've a little problem, trying to be as clean as possible
in my makefile :
here is what i do now :

A: $(LIBDIR)/libA.a($(addprefix $(TOP)/,$(OBJ_A)))
B: $(LIBDIR)/libB.a($(addprefix $(TOP)/,$(OBJ_B)))
C: $(LIBDIR)/libC.a($(addprefix $(TOP)/,$(OBJ_C)))

each of the OBJ_x vars being set separately too.

I feel that it can be more elegant (and easy when one have more than 3 lines) and tried something
like :
MODULES := A B C
the one and only rule being now :
$(MODULES) : %: $(LIBDIR)/lib%.a( ...
$(addprefix $(TOP)/,
  $(patsubst %.c,%.o,
    $(wildcard %/src/*.c)
    )
  )
) (on the same line :-)

The problem is that the '%' inside the wildcard should be the module name A B or C. This is not the case in pratice.

How can i do such a thing with one rule only rather
than one for each module WITHOUT doing recursion (i hate recursion) ???

Thanks,
Axel




reply via email to

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