prefix = /usr
exec_prefix = ${prefix}
PACKAGE_TARNAME = papi
datadir = ${prefix}/share/${PACKAGE_TARNAME}
testlibdir = ../testlib
INCLUDE = -I. -I${prefix}/include -I$(testlibdir)
LIBDIR  = ${prefix}/lib/x86_64-linux-gnu
PAPILIB = -lpapi
TESTLIB = $(testlibdir)/libtestlib.a
LDFLAGS = -ldl
CC	= cc
F77	= gfortran
CC_R	= $(CC) -pthread
CFLAGS	= -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DSTATIC_PAPI_EVENTS_TABLE -DPEINCLUDE=\"/usr/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS  -Wall 
OMPCFLGS = -fopenmp
UTILOBJS = $(TESTLIB)

tests: $(NAME)_tests

install:
	@echo "$(NAME) tests (DATADIR) being installed in: \"$(DATADIR)\""; 
	-mkdir -p $(DATADIR)/$(NAME)/tests
	-chmod go+rx $(DATADIR)
	-chmod go+rx $(DATADIR)/$(NAME)/tests
	-find . -perm -100 -type f -exec cp {} $(DATADIR)/$(NAME)/tests \;
	-chmod go+rx $(DATADIR)/$(NAME)/*
	-find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/$(NAME)/tests \;
	-cp Makefile $(DATADIR)/$(NAME)/tests
	-cp ../../Makefile_comp_tests $(DATADIR)

$(TESTLIB):
	$(MAKE) -C $(testlibdir)
