#
# Pablo System: Visual/Src/System/Build/Managers/Makefile
#       Generates object files listed in ./ObjFiles and adds them to library.
#
.PHONY : Makefile ../Makefile.common

MYTOP 		:= ..
OBJECTS 	:= $(shell cat ./ObjFiles)

LOCAL_DIR 	:= Managers
LOCAL_SRCDIRS 	:= ../../$(LOCAL_DIR)
LOCAL_INCLUDES   = -I. \
		   -I$(TOP)/Visual/Src/Widgets/Includes \
		   -I$(TOP)/Visual/Src/Widgets/Wrappers \
		   -I$(TOP)/Visual/Src/Motif/Includes \
		   $(MOTIF_INCDIR) \
	           $(X11_INCDIR) 
#
# Here we explicitly include the master Makefile.defines file so that
# we have the correct value of USE_AUDIO.  Usually ../Makefile.common
# includes the file but that's too late here
#
TOP := $(MYTOP)/../../../..
.PHONY : $(TOP)/Makefile.defines
include  $(TOP)/Makefile.defines

ifeq ($(strip $(USE_AUDIO)),yes)
  LOCAL_INCLUDES += -I../../../Audio/Includes
endif

include ../Makefile.common
    
#
# We use perl to build the files FunctionalUnitList.C and FunctionalUnitList.h.
# FunctionalUnitManager.dep depends on these so force it to be built.
#
FUDEF := ../../Includes/FunctionalUnitList.fudef 

ifeq ($(strip $(USE_AUDIO)),yes)
FUDEF += ../../Includes/SoundFunctionalUnitList.fudef
endif

FunctionalUnitList.C: FunctionalUnitList.h 

FunctionalUnitList.h: $(FUDEF) 
	cat $(FUDEF) > FUdefs
	$(PERL) ../../Scripts/processFUdefs.perl FUdefs FunctionalUnitList
	rm FUdefs

FunctionalUnitManager.dep: FunctionalUnitList.h
