Re: make: target-depending prerequisites?

Henrik Carlqvist <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization SunSITE.dk - Supporting Open source
Message-ID <[email protected]>
Yves <[email protected]> wrote:
> My strategy is then to create a variable DEPEND

Do you really need the variables DEPEND and main_depend?

> Unfortunately, this does not seem to work:

My guess is that your problem is the order that make expands variables and
evaluates rules. As you are now using your rules to expand variables those
variables will not be expanded until after the rules have been evaluated.

A more simple and working approach would be:

-8<-----------------------------
texfiles = main.tex

all_pdf = $(texfiles:%.tex=%.pdf)

all: $(all_pdf)

main.pdf: section1.tex

%.pdf: %.tex 
	@echo "All prerequisites:" $^
	touch $@
-8<-----------------------------

But maybe you have some other reason to have your variable main_depend not
shown in your example?

regards Henrik
-- 
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.