help-make
[Top][All Lists]
Advanced

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

Question about PHONY


From: vichy
Subject: Question about PHONY
Date: Sun, 13 Apr 2008 14:37:05 +0800

Dear all:
I read the document about make recently.
I have some questions:
1. in example 1 list below that excerpted from document, there are 2
disadvantages:
   1. Cannot see the error.
   2. Cannot use parallel execution.
So the doc uses modification 1 to fix them, but if I use modification 2, I
will also fix them, right? Except I cannot force make to rerun it every
time, if there is already a file called subdirs. 

Appreciate your help,
vichy

Example1:
SUBDIRS = foo bar baz
subdirs:
        for dir in $(SUBDIRS); do \
        $(MAKE) -C $$dir; \
        done

Modification 1:
SUBDIRS = foo bar baz
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
        $(MAKE) -C $@
foo: baz

modification 2:
SUBDIRS = foo bar baz
.PHONY: $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
        $(MAKE) -C $@
foo: baz







reply via email to

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