Makefile.in 3.37 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 26 27 28

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@ 

CC=@CC@
LD=@LD@
29
AR=@AR@
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

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
	gcc $(CFLAGS) $< darshan-logutils.o -o $@ $(LIBS) 

darshan-convert: darshan-convert.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o lookup3.o
	gcc $(CFLAGS) $< darshan-logutils.o lookup3.o -o $@ $(LIBS)

darshan-analyzer: darshan-analyzer.c $(DARSHAN_LOG_FORMAT) darshan-logutils.h darshan-logutils.o
	gcc $(CFLAGS) $< darshan-logutils.o -o $@ $(LIBS)

darshan-log-params: darshan-log-params.c $(DARSHAN_LOG_FORMAT)
	gcc $(CFLAGS) $< -o $@ $(LIBS)

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

darshan-diff: darshan-diff.o $(DARSHAN_LOG_FORMAT) darshan-logutils.o darshan-logutils.h
	gcc $(CFLAGS) $< darshan-logutils.o -o $@ $(LIBS)
darshan-diff.o: darshan-diff.c
	gcc $(CFLAGS) -c  $< -o $@
darshan-logutils.o: darshan-logutils.c
	gcc $(CFLAGS) -c  $< -o $@

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

64 65 66 67 68 69 70 71 72 73 74 75
test/gztest: test/gztest.c mktestdir
	gcc $(CFLAGS) -lz $< -o $@

test/gz-bench: test/gz-bench.c mktestdir
	gcc $(CFLAGS) -lz $< -o $@

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

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


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