%% "Oelke, Dan" <[EMAIL PROTECTED]> writes:

  od> .PHONY: $(SUBSYSTEM)_
  od> $(SUBSYSTEM)_:

Ouch.

  od> $($(SUBSYSTEM)_C_Objs): obj/%.o: %.c $(SUBSYSTEM)_
  od>   $(CC_T) $(T_CFLAGS) $($(filter-out %.c,$+)CFLAGS) -c $< -o $@

  od> The CC_T line needs to access the SUBSYSTEM variable, but since
  od> SUBSYSTEM gets redefined repeatedly, it isn't there when it comes
  od> time to evaluate that line.  We need the SUBSYSTEM variable to get
  od> at the $(SUBSYSTEM_CFLAGS) value.  So, the quick solution we came
  od> up with was to add SUBSYSTEM as a dependency and then filter it
  od> out.  But declaring it as a .PHONY isn't perfect, as now we need
  od> to create a file of the name $(SUBSYSTEM)_ for every possible
  od> SUBSYSTEM value, or the target is always out of date.

Why don't you punt all this and use target-specific variables?

  $($(SUBSYSTEM)_C_Objs): LOCAL_SUBSYSTEM := $(SUBSYSTEM)

  $($(SUBSYSTEM)_C_Objs): obj/%.o : %.c
          $(CC_T) $(T_CFLAGS) $($(LOCAL_SUBSYSTEM)_CFLAGS) -o $@ -c $<

Note I didn't try this, but I _think_ it will work.

-- 
-------------------------------------------------------------------------------
 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

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

Reply via email to