[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -n option executes commands; bug?"
From: |
gk |
Subject: |
Re: -n option executes commands; bug?" |
Date: |
Mon, 23 Jun 2003 16:56:18 -0700 |
At 05:51 PM 6/23/2003 -0400, you wrote:
Right. But why do you use define or call here? Simpler to just use a
straight assignment:
_MAKE = $(MAKE)
I was just cutting and pasting from my real world use where I need the
define: $(XMAKE) is essentially equivalent to $(MAKE) below.
#Makefile
define XM_reqs
$(XMAKE) -x -p $(1) 2>/dev/null|sed -n -e 's%^$(patsubst .,\.,$(1)):
\(.*\)%\1%p' -e '\%^$(patsubst .,\.,$(1)):.*%q'
endef
# Use Make -p option to print the internal database
# we only print the first occurence of 'target:', avoiding the rule itself
# % doesn't match '/' in target names so we need two rules for each XM.% rule
# echo the prerequisites of target /%
XM.reqs./%: FORCE
@$(call XM_reqs,/$*)
# this is used for PHONY targets
XM.reqs.%: FORCE
@$(call XM_reqs,$*)
- Greg Keraunen
http://www.xmake.org