help-make
[Top][All Lists]
Advanced

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

secondexpansion of requisite list for non-existing file


From: Mathieu Zhang
Subject: secondexpansion of requisite list for non-existing file
Date: Mon, 9 May 2011 20:00:31 -0700 (PDT)

I made the following simple file to study .SECONDEXPANSION
### BEGIN
rmsuffix=$(1:%$(suffix $1)=%)
FILES := $(wildcard *.pdf)

all : $(FILES)

.SECONDEXPANSION:
%.pdf : $$(addsuffix .eps,$$(call rmsuffix,$$@))
# $(addsuffix .eps,$(call rmsuffix,$@))
### END

When I run it like this:
$ make -f test.mk -p | grep ".pdf:"
%.pdf: $(addsuffix .eps,$(call rmsuffix,$@))
# test.pdf: test.eps

This is expected result. Now if i change the last two lines to be:
%.pdf : $$(addsuffix .eps_,$$(call rmsuffix,$$@))
# $(addsuffix .eps_,$(call rmsuffix,$@))
and I get:
test.pdf:
since test.eps_ doesn't exist.

So, using .SECONDEXPANSION to make a requisite list seems to drop all those 
that do not exist and make doesn't know the rule to make it. I want make to 
instead give up and throw me an error that says the requisite doesn't exist and 
it doesn't know how to make it instead so that I am reminded to make it 
manually.

I am going to use this Makefile for writing some latex articles. Some of the 
figures are generated by other non-CLI program that I can't easily automates in 
make.

Thanks,

--MZ



reply via email to

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