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

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

#Flags
CPPFLAGS += $(ROOTINCLUDES)
LDLIBS +=  $(ROOTLIBS)

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

all: c++

c++: libArchiving.so install

#Do nothing
java:

install: install_lib install_headers

distclean: clean
	-rm *.d
clean:
	-rm -f *.o libArchiving.so

install_lib: $(LibDir)/libArchiving.so

install_headers: $(IncludeDir)/archiving $(addprefix $(IncludeDir)/archiving/,$(HDRS))

#Real targets
libArchiving.so: $(OBJS)
	$(LIBCMD)

$(LibDir)/libArchiving.so: libArchiving.so
	$(CPCMD)

$(IncludeDir)/archiving/%.h: %.h
	$(CPCMD)

$(IncludeDir)/archiving:
	$(MKDIR)	

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



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

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