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
%


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

Reply via email to