help-make
[Top][All Lists]
Advanced

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

Recursive use of Gmake


From: Jean-Paul . Cloarec
Subject: Recursive use of Gmake
Date: Tue, 4 Feb 2003 10:20:39 +0100

Hello,

There is something I don't understand regarding recursive make
>From the manual , I got this :
SUBDIRS = foo bar baz

  .PHONY: subdirs $(SUBDIRS)

  subdirs: $(SUBDIRS)

  $(SUBDIRS):
          $(MAKE) -C $@

  foo: baz


What I don't understand is subdirs target
What is the difference with the following :

SUBDIRS = foo bar baz

  .PHONY: $(SUBDIRS)

  $(SUBDIRS):
          $(MAKE) -C $@

  foo: baz

I tried it. It seems to work fine :
% Gmake
( cd baz; Gmake )
Gmake[1]: Entering directory `/vob/cncs_training_ni/FICHE1/baz'
cc -o toto toto.c
Gmake[1]: Leaving directory `/vob/cncs_training_ni/FICHE1/baz'
( cd foo; Gmake )
Gmake[1]: Entering directory `/vob/cncs_training_ni/FICHE1/foo'
cc -o toto toto.c
Gmake[1]: Leaving directory `/vob/cncs_training_ni/FICHE1/foo'

So, what is the purpose of subdirs ?

Thank you for your help
Best regards
jena-paul







reply via email to

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