Makefile.in 5.37 KB
Newer Older
Philip Carns's avatar
Philip Carns committed
1
all: libdarshan-util.a darshan-posix-parser  darshan-mpiio-parser
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
DARSHAN_ENABLE_SHARED=@DARSHAN_ENABLE_SHARED@
17 18 19

VPATH = $(srcdir)

20 21 22
ifeq ($(DARSHAN_ENABLE_SHARED),1)
all: libdarshan-util.so
endif
23 24 25 26 27 28
cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@
cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@

# 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@ 
29
CFLAGS_SHARED = $(CFLAGS) -shared -fpic -DPIC 
30
LDFLAGS=@LDFLAGS@
31 32 33

CC=@CC@
LD=@LD@
34
AR=@AR@
35 36 37 38 39 40 41 42 43

LIBS = -lz @LIBBZ2@

mktestdir::
	mkdir -p test

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

44 45 46 47 48 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 $@

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
54 55 56 57 58 59
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 $@

libdarshan-util.so: darshan-logutils.po darshan-posix-logutils.po darshan-mpiio-logutils.po
60 61
	$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ $(LIBS)
	
Philip Carns's avatar
Philip Carns committed
62
libdarshan-util.a: darshan-logutils.o darshan-posix-logutils.o darshan-mpiio-logutils.o
63 64 65 66 67
	ar rcs libdarshan-util.a $^

jenkins: util/bin/jenkins.o lookup3.o
	$(CC) $(CFLAGS)  $(LDFLAGS) $< -o $@ lookup3.o $(LIBS)

68 69
darshan-posix-parser: darshan-posix-parser.c darshan-logutils.h darshan-posix-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h libdarshan-util.a | uthash-1.9.2
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) 
70

Philip Carns's avatar
Philip Carns committed
71 72 73 74
darshan-mpiio-parser: darshan-mpiio-parser.c darshan-logutils.h darshan-mpiio-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h libdarshan-util.a | uthash-1.9.2
	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) 


75 76
#darshan-parser: darshan-parser.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o | uthash-1.9.2
#	$(CC) $(CFLAGS) $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS) 
77

78 79
#darshan-convert: darshan-convert.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o lookup3.o
#	$(CC) $(CFLAGS)  $(LDFLAGS) $< darshan-logutils.o lookup3.o -o $@ $(LIBS)
80

81 82 83 84 85
#darshan-analyzer: darshan-analyzer.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o
#	$(CC) $(CFLAGS)  $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS)

#darshan-log-params: darshan-log-params.c $(DARSHAN_LOG_FORMAT)
#	$(CC) $(CFLAGS)  $(LDFLAGS) $< -o $@ $(LIBS)
86

87 88 89 90
#darshan-diff: darshan-diff.o $(DARSHAN_LOG_FORMAT) darshan-logutils.o darshan-logutils.h
#	$(CC) $(CFLAGS)  $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS)
#darshan-diff.o: darshan-diff.c
#	$(CC) $(CFLAGS) -c  $< -o $@
91

92 93
#test/gztest: test/gztest.c mktestdir
#	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
94

95 96
#test/gz-bench: test/gz-bench.c mktestdir
#	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
97 98 99 100 101 102 103

lookup3.o: lookup3.c
	$(CC) $(CFLAGS) -c $< -o $@

install:: all
	install -d $(bindir)
	install -d $(libdir)
104
	install -d $(includedir)
105
	install -d $(pkgconfigdir)
106
#	install -m 755 darshan-parser $(bindir)
Shane Snyder's avatar
Shane Snyder committed
107
	install -m 755 darshan-posix-parser $(bindir)
Philip Carns's avatar
Philip Carns committed
108
	install -m 755 darshan-mpiio-parser $(bindir)
109 110 111 112
#	install -m 755 darshan-convert $(bindir)
#	install -m 755 darshan-diff $(bindir)
#	install -m 755 darshan-analyzer $(bindir)
#	install -m 755 $(srcdir)/darshan-summary-per-file.sh $(bindir)
113
	install -m 755 libdarshan-util.a $(libdir)
114 115 116
ifeq ($(DARSHAN_ENABLE_SHARED),1)
	install -m 755 libdarshan-util.so $(libdir)
endif
117 118
#	install -m 644 $(srcdir)/darshan-logutils.h $(includedir)
#	install -m 644 $(DARSHAN_LOG_FORMAT) $(includedir)
119
#	install -m 755 darshan-job-summary/bin/darshan-job-summary.pl $(bindir)
120 121 122 123 124 125
#	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)
126
#	install -m 644 $(srcdir)/darshan-job-summary/share/* $(datarootdir)
127
	install -m 644 maint/darshan-util.pc $(pkgconfigdir)
128 129 130


clean::
Philip Carns's avatar
Philip Carns committed
131
	rm -f *.o *.a darshan-posix-parser darshan-mpiio-parser
132 133 134 135 136

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