#
# Pablo System: Visual/Src/Widgets/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 : additional defines for build
#   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 := -DASSERT
TARGETLIB   := libPerfWidgets.a

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

SRCDIRS     := ../Wrappers \
	       ../bargraph \
	       ../boxAndWhisker \
	       ../bubble \
	       ../chart \
	       ../contour \
	       ../dial \
	       ../gantt \
	       ../historydial \
	       ../interval \
	       ../kiviat \
	       ../led \
	       ../xygraph \
	       ../matrix \
	       ../parallelCoords \
	       ../piechart \
	       ../polar \
	       ../scatter3d 
# 	       currently ../coloredit and ../graph not used

SRCFILES    := $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.[cC]))
SOURCES     := $(notdir $(SRCFILES))       
OBJECTS1    := $(SOURCES:.C=.c)           # first change .C's to .c's
OBJECTS     := $(OBJECTS1:.c=.o)          # then change .c's to .o's
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')
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 predefined rules)
#
.PHONY : $(TOP)/MakeRules/local.implicit.rules
include $(TOP)/MakeRules/local.implicit.rules
