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

Package=SctDataDisplayer

#Lists of source files
HDRS := $(wildcard *.h)
SRCS := $(wildcard *.cpp)
OBJS := $(SRCS:.cpp=.o)
BINS := DataDisplayer

#Flags
CPPFLAGS += $(ROOTINCLUDES)

# note that the rootlibs were removed since they cause problems with exception handling.
LDLIBS += -lSctData -lSct -lSummaryWriter $(shell root-config --glibs)

#Phony Targets
.PHONY: all c++ java install clean distclean 

all: c++ java
c++: $(BINS) install
java: 
install: $(BinDir)/$(BINS)
distclean: clean
	-rm -f *.cc *.hh *.cppidl *.d
clean:
	-rm -f *.o $(BINS)

#Real targets
$(BINS): $(OBJS) 
	$(BINCMD)

#Patterns
%.o: %.cpp
	$(CPPCMD)

%.o: %.cc
	$(CPPCMD)

$(BinDir)/%: %
	$(CPCMD)

$(IncludeDir)/$(Package)/%: %
	$(CPCMD)

#Pre-requisites
$(IncludeDir)/$(Package):
	$(MKDIR)

#dependencies
%.d: %.cpp
	$(DEPENDCMD)

ifeq ($(INCLUDEDEPENDANCIES),)
include $(SRCS:.cpp=.d)
endif

