Makefile.in 10.8 KB
Newer Older
1
all: libdarshan-util.a darshan-null-logutils.o darshan-analyzer darshan-convert darshan-diff darshan-parser darshan-dxt-parser darshan-merge jenkins-hash-gen
2 3 4 5 6 7 8 9 10 11 12

DESTDIR =
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = $(DESTDIR)@datarootdir@
includedir = $(DESTDIR)@includedir@
mandir = $(DESTDIR)@mandir@
sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@
13
pkgconfigdir = $(DESTDIR)$(libdir)/pkgconfig
14 15

DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
16 17 18 19
DARSHAN_MOD_LOG_FORMATS = $(srcdir)/../darshan-posix-log-format.h $(srcdir)/../darshan-mpiio-log-format.h $(srcdir)/../darshan-hdf5-log-format.h $(srcdir)/../darshan-pnetcdf-log-format.h $(srcdir)/../darshan-bgq-log-format.h $(srcdir)/../darshan-lustre-log-format.h $(srcdir)/../darshan-stdio-log-format.h $(srcdir)/../darshan-dxt-log-format.h
DARSHAN_MOD_LOGUTIL_HEADERS = darshan-posix-logutils.h darshan-mpiio-logutils.h darshan-hdf5-logutils.h darshan-pnetcdf-logutils.h darshan-bgq-logutils.h darshan-lustre-logutils.h darshan-stdio-logutils.h darshan-dxt-logutils.h
DARSHAN_STATIC_MOD_OBJS = darshan-posix-logutils.o darshan-mpiio-logutils.o darshan-hdf5-logutils.o darshan-pnetcdf-logutils.o darshan-bgq-logutils.o darshan-lustre-logutils.o darshan-stdio-logutils.o darshan-dxt-logutils.o
DARSHAN_DYNAMIC_MOD_OBJS = darshan-posix-logutils.po darshan-mpiio-logutils.po darshan-hdf5-logutils.po darshan-pnetcdf-logutils.po darshan-bgq-logutils.po darshan-lustre-logutils.po darshan-stdio-logutils.po darshan-dxt-logutils.po
20

21
DARSHAN_ENABLE_SHARED=@DARSHAN_ENABLE_SHARED@
22 23 24

VPATH = $(srcdir)

25
ifeq ($(DARSHAN_ENABLE_SHARED),1)
26
all: libdarshan-util.so darshan-null-logutils.po
27
endif
28 29
cp_zlib_link_flags = @__DARSHAN_ZLIB_LINK_FLAGS@
cp_zlib_include_flags = @__DARSHAN_ZLIB_INCLUDE_FLAGS@
30 31 32

# deliberately avoid large file support for host side utilities to avoid
# potentially buggy libz 64 bit offset support
33
CFLAGS = -I . -I .. -I $(srcdir) -I $(srcdir)/../ -DDARSHAN_CONFIG_H=\"darshan-util-config.h\" @CFLAGS@ @CPPFLAGS@ 
34
CFLAGS_SHARED = $(CFLAGS) -shared -fpic -DPIC 
35
LDFLAGS=@LDFLAGS@
36 37 38

CC=@CC@
LD=@LD@
39
AR=@AR@
40 41 42 43 44 45 46 47 48

LIBS = -lz @LIBBZ2@

mktestdir::
	mkdir -p test

uthash-1.9.2:
	tar xjvf $(srcdir)/extern/uthash-1.9.2.tar.bz2

49 50 51 52 53
darshan-logutils.o: darshan-logutils.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-logutils.po: darshan-logutils.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

54 55 56 57 58
darshan-null-logutils.o: darshan-null-logutils.c darshan-logutils.h darshan-null-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-null-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-null-logutils.po: darshan-null-logutils.c darshan-logutils.h darshan-null-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-null-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

59 60 61 62 63
darshan-posix-logutils.o: darshan-posix-logutils.c darshan-logutils.h darshan-posix-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-posix-logutils.po: darshan-posix-logutils.c darshan-logutils.h darshan-posix-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

Philip Carns's avatar
Philip Carns committed
64 65 66 67 68
darshan-mpiio-logutils.o: darshan-mpiio-logutils.c darshan-logutils.h darshan-mpiio-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-mpiio-logutils.po: darshan-mpiio-logutils.c darshan-logutils.h darshan-mpiio-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

69 70 71 72 73
darshan-hdf5-logutils.o: darshan-hdf5-logutils.c darshan-logutils.h darshan-hdf5-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-hdf5-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-hdf5-logutils.po: darshan-hdf5-logutils.c darshan-logutils.h darshan-hdf5-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-hdf5-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

74 75 76 77 78
darshan-pnetcdf-logutils.o: darshan-pnetcdf-logutils.c darshan-logutils.h darshan-pnetcdf-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-pnetcdf-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-pnetcdf-logutils.po: darshan-pnetcdf-logutils.c darshan-logutils.h darshan-pnetcdf-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-pnetcdf-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

79 80 81 82 83
darshan-bgq-logutils.o: darshan-bgq-logutils.c darshan-logutils.h darshan-bgq-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-bgq-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-bgq-logutils.po: darshan-bgq-logutils.c darshan-logutils.h darshan-bgq-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-bgq-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

84 85 86 87 88
darshan-lustre-logutils.o: darshan-lustre-logutils.c darshan-logutils.h darshan-lustre-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-lustre-logutils.po: darshan-lustre-logutils.c darshan-logutils.h darshan-lustre-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

89 90 91 92 93
darshan-stdio-logutils.o: darshan-stdio-logutils.c darshan-logutils.h darshan-stdio-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-stdio-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS) -c  $< -o $@
darshan-stdio-logutils.po: darshan-stdio-logutils.c darshan-logutils.h darshan-stdio-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-stdio-log-format.h | uthash-1.9.2
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

94
darshan-dxt-logutils.o: darshan-dxt-logutils.c darshan-logutils.h darshan-dxt-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-dxt-log-format.h | uthash-1.9.2
95
	$(CC) $(CFLAGS) -c  $< -o $@
96
darshan-dxt-logutils.po: darshan-dxt-logutils.c darshan-logutils.h darshan-dxt-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-dxt-log-format.h | uthash-1.9.2
97 98
	$(CC) $(CFLAGS_SHARED) -c  $< -o $@

99
libdarshan-util.a: darshan-logutils.o $(DARSHAN_STATIC_MOD_OBJS)
100
	ar rcs libdarshan-util.a $^
101

102
libdarshan-util.so: darshan-logutils.po $(DARSHAN_DYNAMIC_MOD_OBJS) 
103 104
	$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ $(LIBS)
	
105 106
jenkins-hash-gen: jenkins-hash-gen.c lookup3.o
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
107

108 109 110 111
lookup3.o: lookup3.c
	$(CC) $(CFLAGS) -c $< -o $@

darshan-analyzer: darshan-analyzer.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
112
	$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS)
113

114
darshan-convert: darshan-convert.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a lookup3.o | uthash-1.9.2
115
	$(CC) $(CFLAGS) $(LDFLAGS) $< lookup3.o libdarshan-util.a -o $@ $(LIBS)
116

117 118
darshan-diff: darshan-diff.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
	$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS) 
119

Shane Snyder's avatar
Shane Snyder committed
120
darshan-parser: darshan-parser.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
121
	$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS) 
Shane Snyder's avatar
Shane Snyder committed
122

123 124 125
darshan-dxt-parser: darshan-dxt-parser.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
	$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS) 

Shane Snyder's avatar
Shane Snyder committed
126
darshan-merge: darshan-merge.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
127
	$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS)
128

129 130
#test/gztest: test/gztest.c mktestdir
#	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
131

132 133
#test/gz-bench: test/gz-bench.c mktestdir
#	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
134 135 136 137

install:: all
	install -d $(bindir)
	install -d $(libdir)
138
	install -d $(includedir)
139
	install -d $(pkgconfigdir)
140 141
	install -m 755 darshan-analyzer $(bindir)
	install -m 755 darshan-convert $(bindir)
142
	install -m 755 darshan-diff $(bindir)
Shane Snyder's avatar
Shane Snyder committed
143
	install -m 755 darshan-parser $(bindir)
144
	install -m 755 darshan-dxt-parser $(bindir)
Shane Snyder's avatar
Shane Snyder committed
145
	install -m 755 darshan-merge $(bindir)
146
	install -m 755 $(srcdir)/darshan-summary-per-file.sh $(bindir)
147
	install -m 755 libdarshan-util.a $(libdir)
148 149 150
ifeq ($(DARSHAN_ENABLE_SHARED),1)
	install -m 755 libdarshan-util.so $(libdir)
endif
151
	install -m 644 $(srcdir)/darshan-logutils.h $(includedir)
152 153 154 155 156
	install -m 644 $(srcdir)/darshan-posix-logutils.h $(includedir)
	install -m 644 $(srcdir)/darshan-mpiio-logutils.h $(includedir)
	install -m 644 $(srcdir)/darshan-hdf5-logutils.h $(includedir)
	install -m 644 $(srcdir)/darshan-pnetcdf-logutils.h $(includedir)
	install -m 644 $(srcdir)/darshan-bgq-logutils.h $(includedir)
Shane Snyder's avatar
Shane Snyder committed
157
	install -m 644 $(srcdir)/darshan-null-logutils.h $(includedir)
158
	install -m 644 $(srcdir)/darshan-lustre-logutils.h $(includedir)
159
	install -m 644 $(srcdir)/darshan-stdio-logutils.h $(includedir)
160
	install -m 644 $(srcdir)/darshan-dxt-logutils.h $(includedir)
161
	install -m 644 $(srcdir)/../darshan-null-log-format.h $(includedir)
162 163 164 165 166
	install -m 644 $(srcdir)/../darshan-posix-log-format.h $(includedir)
	install -m 644 $(srcdir)/../darshan-mpiio-log-format.h $(includedir)
	install -m 644 $(srcdir)/../darshan-hdf5-log-format.h $(includedir)
	install -m 644 $(srcdir)/../darshan-pnetcdf-log-format.h $(includedir)
	install -m 644 $(srcdir)/../darshan-bgq-log-format.h $(includedir)
167
	install -m 644 $(srcdir)/../darshan-lustre-log-format.h $(includedir)
168
	install -m 644 $(srcdir)/../darshan-stdio-log-format.h $(includedir)
169
	install -m 644 $(srcdir)/../darshan-dxt-log-format.h $(includedir)
170 171
	install -d $(includedir)/uthash-1.9.2
	install -d $(includedir)/uthash-1.9.2/src
Shane Snyder's avatar
Shane Snyder committed
172
	install -m 644 uthash-1.9.2/src/uthash.h $(includedir)/uthash-1.9.2/src/
173
	install -m 644 $(DARSHAN_LOG_FORMAT) $(includedir)
174 175 176 177 178 179 180 181
	install -m 755 darshan-job-summary/bin/darshan-job-summary.pl $(bindir)
	install -d $(libdir)/TeX
	install -m 644 $(srcdir)/darshan-job-summary/lib/TeX/Encode.pm $(libdir)/TeX/
	install -d $(libdir)/Number
	install -d $(libdir)/Number/Bytes
	install -m 644 $(srcdir)/darshan-job-summary/lib/Number/Bytes/Human.pm $(libdir)/Number/Bytes
	install -d $(datarootdir)
	install -m 644 $(srcdir)/darshan-job-summary/share/* $(datarootdir)
182
	install -m 644 maint/darshan-util.pc $(pkgconfigdir)
183 184 185


clean::
186
	rm -f *.o *.po *.a *.so darshan-analyzer darshan-convert darshan-diff darshan-parser darshan-dxt-parser darshan-merge jenkins-hash-gen
187 188

distclean:: clean
Shane Snyder's avatar
Shane Snyder committed
189
	rm -f darshan-util-config.h aclocal.m4 autom4te.cache/* config.status config.log Makefile darshan-job-summary/bin/darshan-job-summary.pl maint/darshan-util.pc
190 191
	rm -rf uthash-1.9.2
	rm -rf autom4te.cache