help-make
[Top][All Lists]
Advanced

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

Re: how make interprets directory which are prerequisites


From: John Graham-Cumming
Subject: Re: how make interprets directory which are prerequisites
Date: Thu, 18 Jan 2007 14:24:42 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

sharan basappa wrote:
lib_codec := lib/codec
lib_db := lib/db
lib_ui := lib/ui
libraries := $(lib_ui) $(lib_db) $(lib_codec)
player := app/player
.PHONY: all $(player) $(libraries)
all: $(player)
$(player) $(libraries):
$(MAKE) --directory=$@
$(player): $(libraries)
$(lib_ui): $(lib_db) $(lib_codec)

Since you declared those directories as phony they will always be considered to be out of date. That means that in your example if you 'make all' (or just 'make') then you will always recurse into the player and libraries subdirectories, and the libraries will be built before the player.

This looks just like the totally standard way of handling recursion into sub-directories outlined in the GNU Make manual here: http://www.gnu.org/software/make/manual/make.html#Phony-Targets

John.





reply via email to

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