Makefile.in 4.88 KB
Newer Older
1
all: lib/libdarshan-posix.a lib/libdarshan-mpi-io.a lib/libdarshan.so darshan-parser darshan-diff darshan-analyzer darshan-log-params
2 3 4 5 6

DESTDIR =
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
7
datarootdir = $(DESTDIR)@datarootdir@
8 9 10 11 12 13 14 15
includedir = $(DESTDIR)@includedir@
mandir = $(DESTDIR)@mandir@
sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@

VPATH = $(srcdir)

16 17
cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@
cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@
18

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

23
CFLAGS_MPI = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE 
24

25
CFLAGS_MPI_SHARED = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE -shared -fpic -DPIC -DDARSHAN_PRELOAD
26

27 28 29
CC=@MPICC@
LD=@MPICC@

30
lib::
31
	@mkdir -p $@
32 33 34 35

mktestdir::
	mkdir -p test

36
uthash-1.9.2:
37
	tar xjvf $(srcdir)/extern/uthash-1.9.2.tar.bz2
38 39

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

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

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

48 49 50 51 52 53 54 55 56 57 58 59 60
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 $@

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

64 65 66
lib/darshan-mpi-io.po: lib/darshan-mpi-io.c darshan.h darshan-log-format.h | lib
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI_SHARED) -c $< -o $@

67
lib/darshan-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h darshan-log-format.h | lib 
68
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
69

70 71 72
lib/darshan-pnetcdf.po: lib/darshan-pnetcdf.c darshan.h darshan-log-format.h | lib 
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI_SHARED) -c $< -o $@

73
lib/darshan-hdf5.o: lib/darshan-hdf5.c darshan.h darshan-log-format.h | lib
74
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
75

76 77 78
lib/darshan-hdf5.po: lib/darshan-hdf5.c darshan.h darshan-log-format.h | lib
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI_SHARED) -c $< -o $@

79
lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-log-format.h | lib
80
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
81

82 83 84
lib/darshan-posix.po: lib/darshan-posix.c darshan.h darshan-log-format.h | lib
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI_SHARED) -c $< -o $@

85 86
lib/lookup3.o: lib/lookup3.c
	$(CC) $(CFLAGS_MPI) -c $< -o $@
87

88 89 90
lib/lookup3.po: lib/lookup3.c
	$(CC) $(CFLAGS_MPI_SHARED) -c $< -o $@

91 92
lib/lookup8.o: lib/lookup8.c
	$(CC) $(CFLAGS_MPI) -c $< -o $@
93

94 95 96
lib/lookup8.po: lib/lookup8.c
	$(CC) $(CFLAGS_MPI_SHARED) -c $< -o $@

97
%.i: %.c
98
	$(CC) -E $(CFLAGS_MPI) -c $< -o $@
99

100
lib/libdarshan-mpi-io.a: lib/darshan-mpi-io.o lib/darshan-pnetcdf.o lib/darshan-hdf5.o
101 102 103 104 105
	ar rcs $@ $^

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

106
lib/libdarshan.so: lib/darshan-mpi-io.po lib/darshan-pnetcdf.po lib/darshan-hdf5.po lib/darshan-posix.po lib/lookup3.po lib/lookup8.po
107
	gcc $(CFLAGS_MPI_SHARED) -ldl -o $@ $^ -lpthread -lrt -lz
108

109 110 111 112
install:: all
	install -d $(libdir)
	install -m 755 lib/libdarshan-posix.a $(libdir)
	install -m 755 lib/libdarshan-mpi-io.a $(libdir)
113
	install -m 755 lib/libdarshan.so $(libdir)
114 115
	install -d $(bindir)
	install -m 755 darshan-parser $(bindir)
116
	install -m 755 darshan-diff $(bindir)
117
	install -m 755 darshan-analyzer $(bindir)
118
	install -m 755 darshan-mk-log-dirs.pl $(bindir)
119
	install -m 755 darshan-gen-cc.pl $(bindir)
Philip Carns's avatar
Philip Carns committed
120
	install -m 755 darshan-gen-cxx.pl $(bindir)
121
	install -m 755 darshan-gen-fortran.pl $(bindir)
122 123
	install -m 755 util/bin/darshan-job-summary.pl $(bindir)
	install -d $(libdir)/TeX
124
	install -m 644 $(srcdir)/util/lib/TeX/Encode.pm $(libdir)/TeX/
125 126
	install -d $(libdir)/Number
	install -d $(libdir)/Number/Bytes
127
	install -m 644 $(srcdir)/util/lib/Number/Bytes/Human.pm $(libdir)/Number/Bytes
128
	install -d $(datarootdir)
129
	install -m 644 $(srcdir)/util/share/* $(datarootdir)
130

131 132

clean::
133
	rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so darshan-parser darshan-diff darshan-analyzer darshan-log-params
134 135

distclean:: clean
136
	rm -f darshan-config.h darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-gen-cc.pl darshan-mk-log-dirs.pl aclocal.m4 autom4te.cache/* config.status config.log Makefile util/bin/darshan-job-summary.pl
137
	rm -f compilers/*-V1R4 compilers/fast/*-V1R4 compilers/*-pcarns
138
	rm -rf uthash-1.9.2
139
	rm -rf autom4te.cache