Makefile.in 7.97 KB
Newer Older
1
all: libdarshan-util.a darshan-null-logutils.o darshan-analyzer darshan-convert darshan-diff darshan-parser darshan-stitch-logs 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
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
DARSHAN_MOD_LOGUTIL_HEADERS = darshan-posix-logutils.h darshan-mpiio-logutils.h darshan-hdf5-logutils.h darshan-pnetcdf-logutils.h

19
DARSHAN_ENABLE_SHARED=@DARSHAN_ENABLE_SHARED@
20 21 22

VPATH = $(srcdir)

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

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

CC=@CC@
LD=@LD@
37
AR=@AR@
38 39 40 41 42 43 44 45 46

LIBS = -lz @LIBBZ2@

mktestdir::
	mkdir -p test

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

47 48 49 50 51
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 $@

52 53 54 55 56
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 $@

57 58 59 60 61
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
62 63 64 65 66
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 $@

67 68 69 70 71
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 $@

72 73 74 75 76
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 $@

77 78 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 $@


libdarshan-util.so: darshan-logutils.po darshan-posix-logutils.po darshan-mpiio-logutils.po darshan-hdf5-logutils.po darshan-pnetcdf-logutils.po darshan-bgq-logutils.po
84 85
	$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ $(LIBS)
	
86
libdarshan-util.a: darshan-logutils.o darshan-posix-logutils.o darshan-mpiio-logutils.o darshan-hdf5-logutils.o darshan-pnetcdf-logutils.o darshan-bgq-logutils.o
87 88
	ar rcs libdarshan-util.a $^

89 90
jenkins-hash-gen: jenkins-hash-gen.c lookup3.o
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
91

92 93 94 95 96 97
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
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)

98
darshan-convert: darshan-convert.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) libdarshan-util.a lookup3.o | uthash-1.9.2
Shane Snyder's avatar
Shane Snyder committed
99
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
100

101 102
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) 
103

Shane Snyder's avatar
Shane Snyder committed
104 105 106
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
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) 

107 108 109
darshan-stitch-logs: darshan-stitch-logs.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) libdarshan-util.a | uthash-1.9.2
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)

110 111
#test/gztest: test/gztest.c mktestdir
#	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
112

113 114
#test/gz-bench: test/gz-bench.c mktestdir
#	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
115 116 117 118

install:: all
	install -d $(bindir)
	install -d $(libdir)
119
	install -d $(includedir)
120
	install -d $(pkgconfigdir)
121 122
	install -m 755 darshan-analyzer $(bindir)
	install -m 755 darshan-convert $(bindir)
123
#	install -m 755 darshan-diff $(bindir)
Shane Snyder's avatar
Shane Snyder committed
124
	install -m 755 darshan-parser $(bindir)
125
	install -m 755 $(srcdir)/darshan-summary-per-file.sh $(bindir)
126
	install -m 755 libdarshan-util.a $(libdir)
127 128 129
ifeq ($(DARSHAN_ENABLE_SHARED),1)
	install -m 755 libdarshan-util.so $(libdir)
endif
130
	install -m 644 $(srcdir)/darshan-logutils.h $(includedir)
131 132 133 134 135 136 137 138 139 140 141 142 143
	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)
	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)
	install -d $(includedir)/uthash-1.9.2
	install -d $(includedir)/uthash-1.9.2/src
	install -m 644 uthash-1.9.2/src/uthash.h $(includedir)/uthash-1.9.2/src/
144
	install -m 644 $(DARSHAN_LOG_FORMAT) $(includedir)
145 146 147 148 149 150 151 152
	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)
153
	install -m 644 maint/darshan-util.pc $(pkgconfigdir)
154 155 156


clean::
157
	rm -f *.o *.po *.a *.so darshan-analyzer darshan-convert darshan-parser darshan-stitch-logs jenkins-hash-gen
158 159 160 161 162

distclean:: clean
	rm -f darshan-runtime-config.h aclocal.m4 autom4te.cache/* config.status config.log Makefile util/bin/darshan-job-summary.pl
	rm -rf uthash-1.9.2
	rm -rf autom4te.cache