Makefile.in 3.49 KB
Newer Older
1
all: darshan-parser darshan-convert darshan-diff darshan-analyzer darshan-log-params darshan-util-lib
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 16 17 18 19 20 21 22 23 24 25

DISABLE_LDPRELOAD = @DISABLE_LDPRELOAD@
DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h

VPATH = $(srcdir)

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@ 
26
LDFLAGS=@LDFLAGS@
27 28 29

CC=@CC@
LD=@LD@
30
AR=@AR@
31 32 33 34 35 36 37 38 39 40

LIBS = -lz @LIBBZ2@

mktestdir::
	mkdir -p test

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

darshan-parser: darshan-parser.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o | uthash-1.9.2
41
	$(CC) $(CFLAGS) $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS) 
42 43

darshan-convert: darshan-convert.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o lookup3.o
44
	$(CC) $(CFLAGS)  $(LDFLAGS) $< darshan-logutils.o lookup3.o -o $@ $(LIBS)
45 46

darshan-analyzer: darshan-analyzer.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o
47
	$(CC) $(CFLAGS)  $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS)
48 49

darshan-log-params: darshan-log-params.c $(DARSHAN_LOG_FORMAT)
50
	$(CC) $(CFLAGS)  $(LDFLAGS) $< -o $@ $(LIBS)
51 52

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

darshan-diff: darshan-diff.o $(DARSHAN_LOG_FORMAT) darshan-logutils.o darshan-logutils.h
56
	$(CC) $(CFLAGS)  $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS)
57
darshan-diff.o: darshan-diff.c
58
	$(CC) $(CFLAGS) -c  $< -o $@
59
darshan-logutils.o: darshan-logutils.c
60
	$(CC) $(CFLAGS) -c  $< -o $@
61

62 63 64
darshan-util-lib: darshan-logutils.o
	ar rcs libdarshan-util.a $<

65
test/gztest: test/gztest.c mktestdir
66
	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
67 68

test/gz-bench: test/gz-bench.c mktestdir
69
	$(CC) $(CFLAGS)  $(LDFLAGS) -lz $< -o $@
70 71 72 73 74 75 76

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

install:: all
	install -d $(bindir)
	install -d $(libdir)
77
	install -d $(includedir)
78
	install -d $(pkgconfigdir)
79 80 81 82
	install -m 755 darshan-parser $(bindir)
	install -m 755 darshan-convert $(bindir)
	install -m 755 darshan-diff $(bindir)
	install -m 755 darshan-analyzer $(bindir)
83
	install -m 755 $(srcdir)/darshan-summary-per-file.sh $(bindir)
84 85 86
	install -m 755 libdarshan-util.a $(libdir)
	install -m 644 $(srcdir)/darshan-logutils.h $(includedir)
	install -m 644 $(DARSHAN_LOG_FORMAT) $(includedir)
87
	install -m 755 darshan-job-summary/bin/darshan-job-summary.pl $(bindir)
88
	install -d $(libdir)/TeX
89
	install -m 644 $(srcdir)/darshan-job-summary/lib/TeX/Encode.pm $(libdir)/TeX/
90 91
	install -d $(libdir)/Number
	install -d $(libdir)/Number/Bytes
92
	install -m 644 $(srcdir)/darshan-job-summary/lib/Number/Bytes/Human.pm $(libdir)/Number/Bytes
93
	install -d $(datarootdir)
94
	install -m 644 $(srcdir)/darshan-job-summary/share/* $(datarootdir)
95
	install -m 644 maint/darshan-util.pc $(pkgconfigdir)
96 97 98 99 100 101 102 103 104


clean::
	rm -f *.o *.a darshan-parser darshan-convert darshan-diff darshan-analyzer darshan-log-params

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