#
# Pablo System: Visual/Src/Motif/Build/Makefile
#
TOP := ../../../..

.PHONY : Makefile $(TOP)/Makefile.defines   # explicitly mark PHONY to save time

include $(TOP)/Makefile.defines

#
# Some definitions for this particular Makefile
#   LOCAL_FLAGS : flags added to C++FLAGS and CFLAGS
#   TARGETLIB   : name of library to build 
#   INCLUDES    : -I flags for include directories
#   SRCDIRS     : source file directories
#   SRCFILES    : list of sources with paths
#   SOURCES     : sources without paths
#   OBJECTS     : objects for all sources (no paths)
#   DEPFILES    : dependency files for all objects
#   C++FLAGS    : c++ build flags
#   CFLAGS      : c build flags
#
#LOCAL_FLAGS := -g
TARGETLIB   := libMotif.a

INCLUDES    := -I../Includes \
	       -I$(TOP)/Visual/Src/System/Includes \
	       $(MOTIF_INCDIR) \
	       $(X11_INCDIR)

SRCDIRS     := ../Base \
	       ../Complex \
	       ../Misc \
	       ../PrimitiveGadgets \
	       ../PrimitiveWidgets

SRCFILES    := $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.C))
SOURCES     := $(notdir $(SRCFILES))       
OBJECTS     := $(SOURCES:.C=.o)           
DEPFILES    := $(OBJECTS:.o=.dep)        
C++FLAGS    := $(LOCAL_FLAGS) $(CNFG_C++FLAGS) $(INCLUDES)
CFLAGS      := $(LOCAL_FLAGS) $(CNFG_CFLAGS) $(INCLUDES)

vpath %.C   $(shell echo $(SRCDIRS) | sed 's/ /:/g')

#
# Default target is all ( $(TARGETLIB) )
#
.PHONY  : all

all: 	$(TARGETLIB)

#
# Files containing dependencies for all the objects listed in $OBJECTS
#
include $(DEPFILES)

#
# Pablo implicit rules (cancels all predefines rules)
#
.PHONY : $(TOP)/MakeRules/local.implicit.rules
include $(TOP)/MakeRules/local.implicit.rules
