#Variables
include $(SCT_DAQ_ROOT)/build/Makefile.include
#Commands
include $(SCT_DAQ_ROOT)/build/Makefile.commands

# This make file builds the tests for the SctApi library

# Only define one
# DAQ_SW_DIR:=$(if $(DF_INST_PATH),$(DF_INST_PATH),$(DAQ_SW_DIR))

INCLUDES += -I$(ROOTSYS)/include

CC = g++

SRCS = $(wildcard *.cxx)

PROGS = AutoConfig BlockReads DspDump EchoTest Echo2Test Echo3Test EchoSlaveTest Histogram LedTest MdspDump Minimal \
	NMask PrimList RawScan ReportHistogram TestEvent TestTim TestTranslation TimTrigs

all: c++
c++: $(PROGS)

Minimal: Minimal.o 
NMask: NMask.o 
LedTest: LedTest.o 
EchoTest: EchoTest.o 
Echo2Test: Echo2Test.o 
Echo3Test: Echo3Test.o 
EchoSlaveTest: EchoSlaveTest.o 
DspDump: DspDump.o 
MdspDump: MdspDump.o 
Histogram: Histogram.o 
TestEvent: TestEvent.o 
TestTim: TestTim.o 
TimTrigs: TimTrigs.o 

$(PROGS): LDLIBS += -lTApi

%.o: %.cxx
	$(CPPCMD)

.PHONY : clean distclean all c++
clean:
	$(RM) *.o *~ core

distclean: clean
	$(RM) $(PROGS) *.d

include $(SRCS:.cxx=.d)

%.d: %.c
	$(DEPENDCMD)

%.d: %.cpp
	$(DEPENDCMD)

%.d: %.cxx
	$(DEPENDCMD)
