help-make
[Top][All Lists]
Advanced

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

Referencing awk field in rules put out by eval function


From: Huan-Chih Tsai
Subject: Referencing awk field in rules put out by eval function
Date: Wed, 06 Feb 2008 12:47:53 -0800
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Hi,

I tried to reference awk fields in a rule that was put out by eval function but apparently awk fields were expanded by make. The following is the Makefile and the output message. What is the correct way to write this rule?

Thanks in advance,

Huanchih

--------------------------------------------------
.PHONY: all

all: test

define TEST_RULE
.PHONY: $(1)
$(1):
        awk '{if (NF > 1) {print $$1 " " $$2} }' < Makefile
endef

$(eval $(call TEST_RULE,test))

test2:
        awk '{if (NF > 1) {print $$1 " " $$2} }' < Makefile

-------------------------------------------------

% make
awk '{if (NF > 1) {print  " " } }' < Makefile






% make test2
awk '{if (NF > 1) {print $1 " " $2} }' < Makefile
.PHONY: all
all: test
define TEST_RULE
.PHONY: $(1)
awk '{if
$(eval $(call
awk '{if
%




reply via email to

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