[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pattern-specific variables in target names?
From: |
Rahul Jain |
Subject: |
pattern-specific variables in target names? |
Date: |
Mon, 31 Jan 2005 15:39:00 -0500 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041217 |
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
address@hidden
212-480-5820 ext. 394
- pattern-specific variables in target names?,
Rahul Jain <=