Makefile.in 5.37 KB
Newer Older
1
all: lib/libdarshan-posix.a lib/libdarshan-mpi-io.a darshan-parser darshan-convert 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
includedir = $(DESTDIR)@includedir@
mandir = $(DESTDIR)@mandir@
sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@

14 15
DISABLE_LDPRELOAD = @DISABLE_LDPRELOAD@

16 17 18 19
ifndef DISABLE_LDPRELOAD
all: lib/libdarshan.so 
endif

20 21
VPATH = $(srcdir)

22 23
cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@
cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@
24

25 26
# deliberately avoid large file support for host side utilities to avoid
# potentially buggy libz 64 bit offset support
27
CFLAGS = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ 
28

29
CFLAGS_MPI = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE 
30

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

33 34 35
CC=@MPICC@
LD=@MPICC@

36 37
LIBS = -lz @LIBBZ2@

38
lib::
39
	@mkdir -p $@
40 41 42 43

mktestdir::
	mkdir -p test

44
uthash-1.9.2:
45
	tar xjvf $(srcdir)/extern/uthash-1.9.2.tar.bz2
46 47

darshan-parser: darshan-parser.c darshan.h darshan-log-format.h darshan-logutils.h darshan-logutils.o | uthash-1.9.2
48
	gcc $(CFLAGS) $(LIBS) $< darshan-logutils.o -o $@
49

50 51
darshan-convert: darshan-convert.c darshan.h darshan-log-format.h darshan-logutils.h darshan-logutils.o lib/lookup3.o
	gcc $(CFLAGS) $(LIBS) $< darshan-logutils.o lib/lookup3.o -o $@
52

53
darshan-analyzer: darshan-analyzer.c darshan.h darshan-log-format.h darshan-logutils.h darshan-logutils.o
54
	gcc $(CFLAGS) $(LIBS) $< darshan-logutils.o -o $@
55

56
darshan-log-params: darshan-log-params.c darshan-log-format.h
57
	gcc $(CFLAGS) $(LIBS) $< -o $@
58

59 60 61
jenkins: util/bin/jenkins.o lib/lookup3.o
	gcc $(CFLAGS) $(LIBS) $< -o $@ lib/lookup3.o

62
darshan-diff: darshan-diff.o darshan.h darshan-log-format.h darshan-logutils.o darshan-logutils.h
63
	gcc $(CFLAGS) $(LIBS) $< darshan-logutils.o -o $@
64 65 66 67 68 69 70 71 72 73 74
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 $@

75
lib/darshan-mpi-io.o: lib/darshan-mpi-io.c darshan.h darshan-log-format.h | lib
76
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
77

78 79 80
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 $@

81
lib/darshan-pnetcdf.o: lib/darshan-pnetcdf.c darshan.h darshan-log-format.h | lib 
82
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
83

84 85 86
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 $@

87
lib/darshan-hdf5.o: lib/darshan-hdf5.c darshan.h darshan-log-format.h | lib
88
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
89

90 91 92
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 $@

93
lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-log-format.h | lib
94
	$(CC) $(cp_zlib_include_flags) $(CFLAGS_MPI) -c $< -o $@
95

96 97 98
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 $@

99 100
lib/lookup3.o: lib/lookup3.c
	$(CC) $(CFLAGS_MPI) -c $< -o $@
101

102 103 104
lib/lookup3.po: lib/lookup3.c
	$(CC) $(CFLAGS_MPI_SHARED) -c $< -o $@

105 106
lib/lookup8.o: lib/lookup8.c
	$(CC) $(CFLAGS_MPI) -c $< -o $@
107

108 109 110
lib/lookup8.po: lib/lookup8.c
	$(CC) $(CFLAGS_MPI_SHARED) -c $< -o $@

111
%.i: %.c
112
	$(CC) -E $(CFLAGS_MPI) -c $< -o $@
113

114
lib/libdarshan-mpi-io.a: lib/darshan-mpi-io.o lib/darshan-pnetcdf.o lib/darshan-hdf5.o
115 116 117 118 119
	ar rcs $@ $^

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

120
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
121
	$(CC) $(CFLAGS_MPI_SHARED) -ldl -o $@ $^ -lpthread -lrt -lz
122

123 124 125 126
install:: all
	install -d $(libdir)
	install -m 755 lib/libdarshan-posix.a $(libdir)
	install -m 755 lib/libdarshan-mpi-io.a $(libdir)
127
ifndef DISABLE_LDPRELOAD
128
	install -m 755 lib/libdarshan.so $(libdir)
129
endif
130 131
	install -d $(bindir)
	install -m 755 darshan-parser $(bindir)
132
	install -m 755 darshan-convert $(bindir)
133
	install -m 755 darshan-diff $(bindir)
134
	install -m 755 darshan-analyzer $(bindir)
135
	install -m 755 darshan-mk-log-dirs.pl $(bindir)
136
	install -m 755 darshan-gen-cc.pl $(bindir)
Philip Carns's avatar
Philip Carns committed
137
	install -m 755 darshan-gen-cxx.pl $(bindir)
138
	install -m 755 darshan-gen-fortran.pl $(bindir)
139 140
	install -m 755 util/bin/darshan-job-summary.pl $(bindir)
	install -d $(libdir)/TeX
141
	install -m 644 $(srcdir)/util/lib/TeX/Encode.pm $(libdir)/TeX/
142 143
	install -d $(libdir)/Number
	install -d $(libdir)/Number/Bytes
144
	install -m 644 $(srcdir)/util/lib/Number/Bytes/Human.pm $(libdir)/Number/Bytes
145
	install -d $(datarootdir)
146
	install -m 644 $(srcdir)/util/share/* $(datarootdir)
147

148 149

clean::
150
	rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so darshan-parser darshan-convert darshan-diff darshan-analyzer darshan-log-params
151 152

distclean:: clean
153
	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
154
	rm -f compilers/*-V1R4 compilers/fast/*-V1R4 compilers/*-pcarns
155
	rm -rf uthash-1.9.2
156
	rm -rf autom4te.cache