Makefile.am 3.03 KB
Newer Older
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
1 2
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
3 4 5
AM_CFLAGS = @AM_CFLAGS@ $(OPENMP_CFLAGS)
AM_LDFLAGS = -L$(libdir) -Wl,-rpath -Wl,$(libdir) @AM_LDFLAGS@ $(OPENMP_CFLAGS)
AM_FCFLAGS = @AM_FCFLAGS@ $(OPENMP_FCFLAGS)
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
6 7

# libraries
8
lib_LTLIBRARIES = libftimings-@API_VERSION@-@FCNAME@.la libftimings_perflib-@API_VERSION@-@FCNAME@.la
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
9 10

# libftimings
11
libftimings_@API_VERSION@_@FCNAME@_la_SOURCES = \
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
12
	ftimings/time.c \
13
	ftimings/resident_set_size.c \
14
	ftimings/virtual_memory.c \
15
	ftimings/highwater_mark.c \
16 17
	ftimings/ftimings_type.F90 \
	ftimings/ftimings_value.F90 \
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
18 19
	ftimings/ftimings.F90 \
	ftimings/ftimings_c_support.c
20 21

if HAVE_LIBPAPI
22
libftimings_@API_VERSION@_@FCNAME@_la_SOURCES += \
23 24 25 26
	ftimings/papi.c
endif

if HAVE_PERF
27
libftimings_@API_VERSION@_@FCNAME@_la_SOURCES += \
28 29 30
	ftimings/perf_memory_counter.c
endif

31
libftimings_@API_VERSION@_@FCNAME@_la_LDFLAGS = -version-info @FTIMINGS_SO_VERSION@
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
32

33
# perflib wrapper library
34
libftimings_perflib_@API_VERSION@_@FCNAME@_la_SOURCES = \
35
	perf_wrapper/perf_wrapper.F90
36
libftimings_perflib_@API_VERSION@_@FCNAME@_la_LDFLAGS = -version-info @FTIMINGS_SO_VERSION@
37

38
ftimings_includedir = $(includedir)/ftimings-@API_VERSION@-@FCNAME@
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
39
nobase_ftimings_include_HEADERS = ftimings.mod
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
40
ftimings_include_HEADERS = ftimings/ftimings.h ftimings/ftimings_generated.h
41
ftimings_libincludedir = $(libdir)/ftimings-@API_VERSION@-@FCNAME@/include
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
42 43

pkgconfigdir = $(libdir)/pkgconfig
44
pkgconfig_DATA = ftimings-@API_VERSION@-@FCNAME@.pc ftimings_perflib-@API_VERSION@-@FCNAME@.pc
Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
45 46

# programs
47 48 49 50 51 52 53 54 55
noinst_PROGRAMS = ftimings_@FCNAME@_example ftimings_c_example do_flops do_memory_transfer test_perflib

if HAVE_PERF
noinst_PROGRAMS += test_perf
endif

if HAVE_LIBPAPI
noinst_PROGRAMS += test_papi
endif
56

Lorenz Hüdepohl's avatar
Lorenz Hüdepohl committed
57

58
# Fortran example
59
ftimings_@FCNAME@_example_SOURCES = \
60 61 62
	examples/example.F90 \
	examples/do_flops.c \
	examples/do_memory_transfer.c
63
ftimings_@FCNAME@_example_LDADD = libftimings-@API_VERSION@-@FCNAME@.la
64
ftimings_@FCNAME@_example_LDFLAGS = -static
65

66
# C example
67 68
ftimings_c_example_SOURCES = \
	examples/c_example.c
69
ftimings_c_example_LDADD = libftimings-@API_VERSION@-@FCNAME@.la
70
ftimings_c_example_LDFLAGS = -static $(FCLIBS)
Lorenz Huedepohl's avatar
Lorenz Huedepohl committed
71

72 73

# Small test programs:
74 75

do_flops_SOURCES = \
76
	examples/do_flops.c
77 78 79
do_flops_CPPFLAGS = -DTEST_DO_FLOPS

do_memory_transfer_SOURCES = \
80
	examples/do_memory_transfer.c
81 82
do_memory_transfer_CPPFLAGS = -DTEST_DO_MEMORY_TRANSFER

83
if HAVE_PERF
84 85 86
test_perf_SOURCES = \
	ftimings/perf_memory_counter.c
test_perf_CPPFLAGS = -DTEST_PERF
87
endif
88

89
if HAVE_LIBPAPI
90 91 92
test_papi_SOURCES = \
	ftimings/papi.c
test_papi_CPPFLAGS = -DTEST_PAPI
93
endif
94

95 96
test_perflib_SOURCES = \
	examples/perflib.F90
97
test_perflib_LDADD = libftimings-@API_VERSION@-@FCNAME@.la libftimings_perflib-@API_VERSION@-@FCNAME@.la
98

99
# other files to distribute
100
filesdir = $(datadir)/@PACKAGE@-@FCNAME@/examples
101
files_DATA = examples/example.F90
102 103

include doxygen.am
104 105 106

clean-local:
	rm *.mod
107 108 109

distclean-local:
	rm config-f90.h
110 111 112 113 114

# till autotools figure out a way to version .la files we simply remove
# them again after installation
install-exec-hook:
	rm -f $(DESTDIR)$(libdir)/*.la