%% Magnus Fromreide <[EMAIL PROTECTED]> writes:

  mf> In what section? Phony targets?

Yes.

  mf> Are you suggesting

  mf> SUBDIRS:=A B
  mf> PROGS:=$(SUBDIRS:%=prog%)
  mf> LIBS:=$(SUBDIRS:%=lib%)
  mf> TARGET=null

  mf> prog: $(PROGS)
  mf> $(PROGS): $(LIBS)
  mf> lib: $(LIBS)
  mf> $(PROGS): TARGET=prog
  mf> $(LIBS): TARGET=lib
  mf> $(LIBS) $(PROGS):
  mf>         @test -d $(@:$(TARGET)%=%) || mkdir $(@:$(TARGET)%=%)
  mf>         $(MAKE) -C $(@:$(TARGET)%=%) $(TARGET)

  mf> .PHONY: $(LIBS) $(PROGS) lib prog

  mf> or what?

  >> Try $(MAKECMDGOALS).

  mf> I still can't see how MAKECMDGOALS could help me in this situation.

Something like this:

  SUBDIRS   = A B

  prog:
  prog lib: $(SUBDIRS)

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

  .PHONY: $(SUBDIRS) prog lib

Does this not do something you need?

You can also make simple prerequisites, like:

  a: b

to make sure everything builds in the right order in the face of
parallel builds.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to