Makefile.in 3.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
all: checkpath lib/libdarshan-posix.a lib/libdarshan-mpi-io.a darshan-parser darshan-diff test/gztest test/gz-bench 

DESTDIR =
srcdir = @srcdir@
prefix = @prefix@
datarootdir = @datarootdir@
exec_prefix = @exec_prefix@
includedir = $(DESTDIR)@includedir@
mandir = $(DESTDIR)@mandir@
sbindir = $(DESTDIR)@sbindir@
bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@

VPATH = $(srcdir)

darshan_lib_path = @darshan_lib_path@
17 18
cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@
cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

CFLAGS = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -Wall
CC=@MPICC@
LD=@MPICC@

checkpath::
ifneq ($(darshan_lib_path),$(libdir)) 
	@echo "Error: <libdir> must match <prefix>/lib, don't use --libdir!"
	@exit 1
endif

mklibdir::
	mkdir -p lib

mktestdir::
	mkdir -p test

darshan-parser: darshan-parser.c darshan.h darshan-log-format.h
	gcc $(CFLAGS) -lz $< -o $@

darshan-diff: darshan-diff.o darshan.h darshan-log-format.h darshan-logutils.o darshan-logutils.h
	gcc $(CFLAGS) -lz $< darshan-logutils.o -o $@
darshan-diff.o: darshan-diff.c
	gcc $(CFLAGS) -c  $< -o $@
darshan-logutils.o: darshan-logutils.c
	gcc $(CFLAGS) -c  $< -o $@

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

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

52 53
lib/darshan-mpi-io.o: lib/darshan-mpi-io.c darshan.h darshan-log-format.h mklibdir
	$(CC) $(cp_zlib_include_flags) $(CFLAGS) -c $< -o $@
54

55 56
lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-log-format.h mklibdir
	$(CC) $(cp_zlib_include_flags) $(CFLAGS) -c $< -o $@
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73

lookup3.o: lookup3.c

lookup8.o: lookup8.c

lib/libdarshan-mpi-io.a: lib/darshan-mpi-io.o
	ar rcs $@ $^

lib/libdarshan-posix.a: lib/darshan-posix.o lib/lookup3.o lib/lookup8.o
	ar rcs $@ $^

install:: all
	install -d $(libdir)
	install -m 755 lib/libdarshan-posix.a $(libdir)
	install -m 755 lib/libdarshan-mpi-io.a $(libdir)
	install -d $(bindir)
	install -m 755 darshan-parser $(bindir)
74
	install -m 755 darshan-diff $(bindir)
75
	install -m 755 darshan-mk-log-dirs.pl $(bindir)
76
	install -m 755 darshan-gen-cc.pl $(bindir)
77 78 79 80 81 82 83 84 85
	install -m 755 compilers/mpicc-trace-bgp $(bindir)/mpicc
	install -m 755 compilers/mpicxx-trace-bgp $(bindir)/mpicxx
	install -m 755 compilers/mpif77-trace-bgp $(bindir)/mpif77
	install -m 755 compilers/mpif90-trace-bgp $(bindir)/mpif90
	install -m 755 compilers/mpixlc-trace-bgp $(bindir)/mpixlc
	install -m 755 compilers/mpixlcxx-trace-bgp $(bindir)/mpixlcxx
	install -m 755 compilers/mpixlf2003-trace-bgp $(bindir)/mpixlf2003
	install -m 755 compilers/mpixlf77-trace-bgp $(bindir)/mpixlf77
	install -m 755 compilers/mpixlf90-trace-bgp $(bindir)/mpixlf90
86 87 88 89 90 91 92
	install -m 755 compilers/mpixlf95-trace-bgp $(bindir)/mpixlf95
	install -m 755 compilers/mpixlc_r-trace-bgp $(bindir)/mpixlc_r
	install -m 755 compilers/mpixlcxx_r-trace-bgp $(bindir)/mpixlcxx_r
	install -m 755 compilers/mpixlf2003_r-trace-bgp $(bindir)/mpixlf2003_r
	install -m 755 compilers/mpixlf77_r-trace-bgp $(bindir)/mpixlf77_r
	install -m 755 compilers/mpixlf90_r-trace-bgp $(bindir)/mpixlf90_r
	install -m 755 compilers/mpixlf95_r-trace-bgp $(bindir)/mpixlf95_r
93
	install -m 755 $(srcdir)/darshan-pmpi-filter.sh $(bindir)
94 95 96

clean::
	rm -f *.o *.a lib/*.o lib/*.a darshan-parser darshan-diff