# Makefile for the ROOT test programs.
# This Makefile shows nicely how to compile and link applications
# using the ROOT libraries on all supported platforms.
#
# Copyright (c) 2000 Rene Brun and Fons Rademakers
#
# Author: Fons Rademakers, 29/2/2000

include Makefile.arch

#------------------------------------------------------------------------------

TESTO        = TestClass.$(ObjSuf) TestDict.$(ObjSuf)
TESTS        = TestClass.$(SrcSuf) TestDict.$(SrcSuf)
TESTSO       = libTest.$(DllSuf)
ifeq ($(PLATFORM),win32)
TESTLIB      = libTest.lib
else
TESTLIB      = $(shell pwd)/$(TESTSO)
endif

OBJS          = $(TESTO)

PROGRAMS      = 

#------------------------------------------------------------------------------

.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
.PHONY:    

all:            $(PROGRAMS)

$(TESTSO):     $(TESTO)
		$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
		@echo "$@ done"

clean:
		@rm -f $(OBJS) core

distclean:      clean
		-@mv -f linearIO.root linearIO.roott
		@rm -f $(PROGRAMS) $(TESTSO) $(TESTLIB) *Dict.* *.def *.exp \
		   *.root *.ps *.so *.lib *.dll *.d *.log .def so_locations
		@rm -rf cxx_repository
		-@mv -f linearIO.roott linearIO.root
		-@cd RootShower && $(MAKE) distclean

.SUFFIXES: .$(SrcSuf)

###

Test.$(ObjSuf): TestClass.h

TestDict.$(SrcSuf): TestClass.h TestLinkDef.h
	@echo "Generating dictionary $@..."
	@rootcint -f $@ -c $^

.$(SrcSuf).$(ObjSuf):
	$(CXX) $(CXXFLAGS) -c $<
