[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
confusion over eval and warning
From: |
Ted Stern |
Subject: |
confusion over eval and warning |
Date: |
Mon, 21 Jun 2004 14:32:51 -0700 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) |
Hi Paul and others,
I'd like to use $(eval) to abbreviate some make commands, but I'm having
trouble combining that with the $(warning) command.
Here's an example that gives the flavor of what I'm trying to do:
# These shorthand macros are actually defined elsewhere using an eval'ed macro:
one.o := a/a/one.o
two.o := b/b/two.o
three.o := c/c/three.o
four.o := d/d/four.o
five.o := e/e/five.o
ALL_BASE := one two three four five
define DEFINE_OBJ_LIST
$(1)_OBJS := $(foreach BASE,$(filter $(2)%,$(ALL_BASE)),$($(BASE).o))
$(warning $(1)_OBJS (contains $(words $($(1)_OBJS)) objects) = $($(1)_OBJS))
endef
$(eval $(call DEFINE_OBJ_LIST,ONE,one))
$(eval $(call DEFINE_OBJ_LIST,TWO,two))
.PHONY: all
all:
echo $(ONE_OBJS) $(TWO_OBJS)
make -f maketest.mk all
maketest.mk:15: ONE_OBJS (contains 0 objects) =
maketest.mk:16: TWO_OBJS (contains 0 objects) =
echo a/a/one.o b/b/two.o
a/a/one.o b/b/two.o
Basically, I'm trying to extract part of a very long list and then see what I
fished out. I do this a lot so I'd like to automate it. But as you can see
from the v3.80 output, $(warning) doesn't show the output I want.
I'm sure I'm misunderstanding something, but I don't see what it is.
Thanks for your time,
--
Ted Stern Applications Group
Cray Inc. office: 206-701-2182
411 First Avenue South, Suite 600 cell: 206-383-1049
Seattle, WA 98104-2860 FAX: 206-701-2500
Frango ut patefaciam -- I break that I may reveal
(The Paleontological Society motto, equally apropos for debugging)
- confusion over eval and warning,
Ted Stern <=