#change the name of the program here
NAME=template_threaded

#add extra cc file to compile here
EXTRA_SRC=

###############################################################3
#below only boring default stuff
#only change it if you know what you are doing ;-)

#what should be done by default
all: $(NAME)

#if VOTCALDLIB is defined we add it to PKG_CONFIG_PATH
ifeq "$(origin VOTCASHARE)" "undefined"
  $(error "VOTCASHARE not found, please source VOTCARC")
endif

#get CPPFLAGS and LDFLAGS from pkg-config
CPPFLAGS=`pkg-config --cflags libvotca_csg`
LIBS=`pkg-config --libs libvotca_csg`

#for static binaries uncomment the next 3 lines
#CPPFLAGS=`pkg-config --static --cflags libvotca_csg`
#LDFLAGS=-static
#LIBS=`pkg-config --static --libs libvotca_csg`

#generate a list of object (.o) files
OBJS=$(patsubst %.cc,%.o,$(NAME).cc $(EXTRA_SRC))

#main program depend on all objects, rest is done by implicit rules
$(NAME): $(OBJS)
	${CXX} ${LDFLAGS} -o ${NAME} ${OBJS} ${LIBS}

#clean up rule
clean:
	rm -f $(NAME) $(OBJS)

#all, clean are phony rules, e.g. they should always run
.PHONY: all clean
