# Makefile for Test code
SHELL = /bin/sh

# Machine specific flags and locations (include files & libraries)
include Make.include

OBJS_ := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJS =  $(OBJS_) testDict.o 
CINT_LIST :=  record.h channel.h
LINKDEF:= LinkDef.h
#########################################################################
all:		lib liblink rootcint bin 

lib:		$(OBJS)	
		@echo -e "\nBuilding library..."
		$(SOCMD) $(SOFLAGS) $(SOMINF) $(OBJS) $(OutPutOpt) libTest.$(DllSuf)	

liblink: 	FORCE	
ifeq ($(strip $(ARCH)),macosx)
	$(SYMLINK) libTest.$(DllSuf) libTest.$(DllLinkSuf)
endif

bin:		$(OBJS) 
		@echo -e "\nBuilding executable"
		$(CXX) -o test.exe $(CXXFLAGS) $(CPPFLAGS) $(LIBRARIES) -L./ -lTest $(OBJS) 

clean:
		rm -f *.o
		rm -f *~
		rm -f *.$(DllSuf)
		rm -f *.$(DllLinkSuf)
		rm -f testDict.cc
		rm -f test.exe


### create ROOT dictionary
rootcint: 	FORCE testDict.o

testDict.cc: 	$(LINKDEF) $(CINTLIST)
		rm -f testDict.*
		@echo -e "\nGenerating dictionary ..."
		rootcint -f testDict.cc -c $(INCLUDES) $(CINT_LIST) $(LINKDEF)

FORCE:	

###