Makefile.in 5.41 KB
Newer Older
1
all: checkpath lib/libdarshan-posix.a lib/libdarshan-mpi-io.a darshan-parser darshan-diff darshan-analyzer test/gztest test/gz-bench darshan-log-params
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

DESTDIR =
srcdir = @srcdir@
prefix = @prefix@
datarootdir = @datarootdir@
exec_prefix = @exec_prefix@
includedir = $(DESTDIR)@includedir@
mandir = $(DESTDIR)@mandir@
sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@

VPATH = $(srcdir)

darshan_lib_path = @darshan_lib_path@
17 18
cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@
cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@
19

20 21 22 23
# deliberately avoid large file support for host side utilities to avoid
# potentially buggy libz 64 bit offset support
CFLAGS = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -Wall

24
CFLAGS_MPI = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE -Wall
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
CC=@MPICC@
LD=@MPICC@

checkpath::
ifneq ($(darshan_lib_path),$(libdir)) 
	@echo "Error: <libdir> must match <prefix>/lib, don't use --libdir!"
	@exit 1
endif

mklibdir::
	mkdir -p lib

mktestdir::
	mkdir -p test

40
darshan-parser: darshan-parser.c darshan.h darshan-log-format.h darshan-logutils.h darshan-logutils.o
41
	gcc $(CFLAGS) -lz $< darshan-logutils.o -o $@
42

43
darshan-analyzer: darshan-analyzer.c darshan.h darshan-log-format.h darshan-logutils.h darshan-logutils.o
44
	gcc $(CFLAGS) -lz $< darshan-logutils.o -o $@
45

46 47 48
darshan-log-params: darshan-log-params.c darshan-log-format.h
	gcc $(CFLAGS) -lz $< -o $@

49 50 51 52 53 54 55 56 57 58 59 60 61
darshan-diff: darshan-diff.o darshan.h darshan-log-format.h darshan-logutils.o darshan-logutils.h
	gcc $(CFLAGS) -lz $< darshan-logutils.o -o $@
darshan-diff.o: darshan-diff.c
	gcc $(CFLAGS) -c  $< -o $@
darshan-logutils.o: darshan-logutils.c
	gcc $(CFLAGS) -c  $< -o $@

test/gztest: test/gztest.c mktestdir
	gcc $(CFLAGS) -lz $< -o $@

test/gz-bench: test/gz-bench.c mktestdir
	gcc $(CFLAGS) -lz $< -o $@

62
lib/darshan-mpi-io.o: lib/darshan-mpi-io.c darshan.h darshan-log-format.h mklibdir
63
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
64

65
lib/darshan-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h darshan-log-format.h mklibdir
66
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
67

68
lib/darshan-hdf5.o: lib/darshan-hdf5.c darshan.h darshan-log-format.h mklibdir
69
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
70

71
lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-log-format.h mklibdir
72
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
73

74 75
lib/lookup3.o: lib/lookup3.c
	$(CC) $(CFLAGS_MPI) -c $< -o $@
76

77 78
lib/lookup8.o: lib/lookup8.c
	$(CC) $(CFLAGS_MPI) -c $< -o $@
79

80
lib/libdarshan-mpi-io.a: lib/darshan-mpi-io.o lib/darshan-pnetcdf.o lib/darshan-hdf5.o
81 82 83 84 85 86 87 88 89 90
	ar rcs $@ $^

lib/libdarshan-posix.a: lib/darshan-posix.o lib/lookup3.o lib/lookup8.o
	ar rcs $@ $^

install:: all
	install -d $(libdir)
	install -m 755 lib/libdarshan-posix.a $(libdir)
	install -m 755 lib/libdarshan-mpi-io.a $(libdir)
	install -d $(bindir)
91
	install -d $(bindir)/fast
92
	install -m 755 darshan-parser $(bindir)
93
	install -m 755 darshan-diff $(bindir)
94
	install -m 755 darshan-analyzer $(bindir)
95
	install -m 755 darshan-mk-log-dirs.pl $(bindir)
96
	install -m 755 darshan-gen-cc.pl $(bindir)
Philip Carns's avatar
Philip Carns committed
97
	install -m 755 darshan-gen-cxx.pl $(bindir)
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
	install -m 755 compilers/mpicc-trace-bgp-V1R4 $(bindir)/mpicc
	install -m 755 compilers/mpicxx-trace-bgp-V1R4 $(bindir)/mpicxx
	install -m 755 compilers/mpif77-trace-bgp-V1R4 $(bindir)/mpif77
	install -m 755 compilers/mpif90-trace-bgp-V1R4 $(bindir)/mpif90
	install -m 755 compilers/mpixlc-trace-bgp-V1R4 $(bindir)/mpixlc
	install -m 755 compilers/mpixlcxx-trace-bgp-V1R4 $(bindir)/mpixlcxx
	install -m 755 compilers/mpixlf2003-trace-bgp-V1R4 $(bindir)/mpixlf2003
	install -m 755 compilers/mpixlf77-trace-bgp-V1R4 $(bindir)/mpixlf77
	install -m 755 compilers/mpixlf90-trace-bgp-V1R4 $(bindir)/mpixlf90
	install -m 755 compilers/mpixlf95-trace-bgp-V1R4 $(bindir)/mpixlf95
	install -m 755 compilers/mpixlc_r-trace-bgp-V1R4 $(bindir)/mpixlc_r
	install -m 755 compilers/mpixlcxx_r-trace-bgp-V1R4 $(bindir)/mpixlcxx_r
	install -m 755 compilers/mpixlf2003_r-trace-bgp-V1R4 $(bindir)/mpixlf2003_r
	install -m 755 compilers/mpixlf77_r-trace-bgp-V1R4 $(bindir)/mpixlf77_r
	install -m 755 compilers/mpixlf90_r-trace-bgp-V1R4 $(bindir)/mpixlf90_r
	install -m 755 compilers/mpixlf95_r-trace-bgp-V1R4 $(bindir)/mpixlf95_r
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
	install -m 755 compilers/mpicc-trace-bgp-V1R4 $(bindir)/fast/mpicc
	install -m 755 compilers/mpicxx-trace-bgp-V1R4 $(bindir)/fast/mpicxx
	install -m 755 compilers/mpif77-trace-bgp-V1R4 $(bindir)/fast/mpif77
	install -m 755 compilers/mpif90-trace-bgp-V1R4 $(bindir)/fast/mpif90
	install -m 755 compilers/mpixlc-trace-bgp-V1R4 $(bindir)/fast/mpixlc
	install -m 755 compilers/mpixlcxx-trace-bgp-V1R4 $(bindir)/fast/mpixlcxx
	install -m 755 compilers/mpixlf2003-trace-bgp-V1R4 $(bindir)/fast/mpixlf2003
	install -m 755 compilers/mpixlf77-trace-bgp-V1R4 $(bindir)/fast/mpixlf77
	install -m 755 compilers/mpixlf90-trace-bgp-V1R4 $(bindir)/fast/mpixlf90
	install -m 755 compilers/mpixlf95-trace-bgp-V1R4 $(bindir)/fast/mpixlf95
	install -m 755 compilers/mpixlc_r-trace-bgp-V1R4 $(bindir)/fast/mpixlc_r
	install -m 755 compilers/mpixlcxx_r-trace-bgp-V1R4 $(bindir)/fast/mpixlcxx_r
	install -m 755 compilers/mpixlf2003_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf2003_r
	install -m 755 compilers/mpixlf77_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf77_r
	install -m 755 compilers/mpixlf90_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf90_r
	install -m 755 compilers/mpixlf95_r-trace-bgp-V1R4 $(bindir)/fast/mpixlf95_r
130 131

clean::
132
	rm -f *.o *.a lib/*.o lib/*.a darshan-parser darshan-diff darshan-analyzer