I want to tweak target lists and locations for the build of two different libraries in my project. I don't want to replicate all of the contents of the makefile for each one. Pattern-specific variables seemed like a good way to achieve this, but it seems that target names can't have any dependency on pattern-specific variables. What is the best way to achieve this goal?

I want to have something like (of course, with far more rules, but I should be able to generalize from something that works for this):

OBJDIR = bin

TARGET1 = $(OBJDIR)/foo/target.tx
TARGET2 = $(OBJDIR)/bar/target.tx

TARGET1: PROJ = foo
TARGET2: PROJ = bar

SRCDIR = ../src/$(PROJ)
SRCS: $(wildcard $(SRCDIR)/*.x)
OBJS: $($(subst $(SRCDIR),$(OBJDIR),$(SRCS)):%.x=%.o)

all: $(TARGET1) $(TARGET2)

%.tx: $(OBJS)
   commands ...
etc...

TIA,

--
Rahul Jain
Random Walk Computing
[EMAIL PROTECTED]
212-480-5820 ext. 394




_______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to