Makefile.in 5.52 KB
Newer Older
1
all: lib/libdarshan.a lib/darshan-null.o
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

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@
LDFLAGS = @LDFLAGS@
CC = @CC@
LD = @LD@

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

21
ifndef DISABLE_LDPRELOAD
22
all: lib/libdarshan.so lib/darshan-null.po
23
endif
24
25
26
27

VPATH = $(srcdir)

CFLAGS = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I ../ -I $(srcdir) -I$(srcdir)/../ @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE 
28
#
29
30
31
32
33
34
35
CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir) -I$(srcdir)/../ @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE -shared -fpic -DPIC -DDARSHAN_PRELOAD

LIBS = -lz @LIBBZ2@

lib::
	@mkdir -p $@

Shane Snyder's avatar
Shane Snyder committed
36
lib/darshan-core-init-finalize.o: lib/darshan-core-init-finalize.c darshan.h darshan-core.h $(DARSHAN_LOG_FORMAT) | lib
37
38
	$(CC) $(CFLAGS) -c $< -o $@

Shane Snyder's avatar
Shane Snyder committed
39
40
41
42
43
44
45
lib/darshan-core-init-finalize.po: lib/darshan-core-init-finalize.c darshan.h darshan-core.h $(DARSHAN_LOG_FORMAT) | lib
	$(CC) $(CFLAGS_SHARED) -c $< -o $@

lib/darshan-core.o: lib/darshan-core.c darshan.h darshan-core.h $(DARSHAN_LOG_FORMAT) | lib
	$(CC) $(CFLAGS) -c $< -o $@

lib/darshan-core.po: lib/darshan-core.c darshan.h darshan-core.h $(DARSHAN_LOG_FORMAT) | lib
46
47
	$(CC) $(CFLAGS_SHARED) -c $< -o $@

48
49
50
lib/darshan-common.o: lib/darshan-common.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
	$(CC) $(CFLAGS) -c $< -o $@

51
52
53
lib/darshan-common.po: lib/darshan-common.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
	$(CC) $(CFLAGS_SHARED) -c $< -o $@

54
lib/darshan-null.o: lib/darshan-null.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-null-log-format.h | lib
55
	$(CC) $(CFLAGS) -c $< -o $@
56

57
lib/darshan-null.po: lib/darshan-null.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-null-log-format.h | lib
58
	$(CC) $(CFLAGS_SHARED) -c $< -o $@
59

60
lib/darshan-posix.o: lib/darshan-posix.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib
Philip Carns's avatar
Philip Carns committed
61
62
	$(CC) $(CFLAGS) -c $< -o $@

63
64
65
66
67
68
69
lib/darshan-posix.po: lib/darshan-posix.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib
	$(CC) $(CFLAGS_SHARED) -c $< -o $@

lib/darshan-mpiio.o: lib/darshan-mpiio.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h | lib
	$(CC) $(CFLAGS) -c $< -o $@

lib/darshan-mpiio.po: lib/darshan-mpiio.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h | lib
Philip Carns's avatar
Philip Carns committed
70
71
	$(CC) $(CFLAGS_SHARED) -c $< -o $@

Kevin Harms's avatar
Kevin Harms committed
72
73
74
75
76
77
78
79
80
81
#
# BG/Q module
#
lib/darshan-bgq.o: lib/darshan-bgq.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h | lib
	$(CC) $(CFLAGS) -c $< -o $@

lib/darshan-bgq.po: lib/darshan-bgq.c darshan.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mpiio-log-format.h | lib
	$(CC) $(CFLAGS_SHARED) -c $< -o $@


82
83
84
lib/lookup3.o: lib/lookup3.c
	$(CC) $(CFLAGS) -c $< -o $@

85
86
lib/lookup3.po: lib/lookup3.c
	$(CC) $(CFLAGS_SHARED) -c $< -o $@
87
88
89
90

lib/lookup8.o: lib/lookup8.c
	$(CC) $(CFLAGS) -c $< -o $@

91
92
lib/lookup8.po: lib/lookup8.c
	$(CC) $(CFLAGS_SHARED) -c $< -o $@
93

94
95
#%.i: %.c
#	$(CC) -E $(CFLAGS) -c $< -o $@
96

Kevin Harms's avatar
Kevin Harms committed
97
lib/libdarshan.a: lib/darshan-core-init-finalize.o lib/darshan-core.o lib/darshan-common.o lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-bgq.o lib/lookup3.o lib/lookup8.o
98
99
	ar rcs $@ $^

Kevin Harms's avatar
Kevin Harms committed
100
lib/libdarshan.so: lib/darshan-core-init-finalize.po lib/darshan-core.po lib/darshan-common.po lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-bgq.po lib/lookup3.po lib/lookup8.po
101
	$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl
102
103
104

install:: all
	install -d $(libdir)
105
	install -m 755 lib/libdarshan.a $(libdir)
106
107
108
ifndef DISABLE_LDPRELOAD
	install -m 755 lib/libdarshan.so $(libdir)
endif
109
	install -d $(bindir)
110
	install -m 755 darshan-mk-log-dirs.pl $(bindir)
111
	install -m 755 darshan-gen-cc.pl $(bindir)
112
113
	install -m 755 darshan-gen-cxx.pl $(bindir)
	install -m 755 darshan-gen-fortran.pl $(bindir)
114
	install -m 755 darshan-config $(bindir)
115
116
117
118
119
120
121
122
123
124
125
	install -d $(datarootdir)/craype-1.x/modulefiles/darshan
	install -m 755 share/craype-1.x/darshan-module $(datarootdir)/craype-1.x/modulefiles/darshan/$(DARSHAN_VERSION)
	install -d $(datarootdir)/craype-2.x/modulefiles/darshan
	install -m 755 share/craype-2.x/darshan-module $(datarootdir)/craype-2.x/modulefiles/darshan/$(DARSHAN_VERSION)
	install -d $(datarootdir)/mpi-profile
	install -m 755 share/mpi-profile/darshan-cc.conf $(datarootdir)/mpi-profile/darshan-cc.conf
	install -m 755 share/mpi-profile/darshan-cxx.conf $(datarootdir)/mpi-profile/darshan-cxx.conf
	install -m 755 share/mpi-profile/darshan-f.conf $(datarootdir)/mpi-profile/darshan-f.conf
	install -m 755 share/mpi-profile/darshan-bg-cc.conf $(datarootdir)/mpi-profile/darshan-bg-cc.conf
	install -m 755 share/mpi-profile/darshan-bg-cxx.conf $(datarootdir)/mpi-profile/darshan-bg-cxx.conf
	install -m 755 share/mpi-profile/darshan-bg-f.conf $(datarootdir)/mpi-profile/darshan-bg-f.conf
126
	install -m 644 darshan-base-ld-opts $(datarootdir)/darshan-base-ld-opts
Shane Snyder's avatar
Shane Snyder committed
127
	install -m 644 $(srcdir)/darshan-posix-ld-opts $(datarootdir)/darshan-posix-ld-opts
128
129
	install -d $(libdir)/pkgconfig
	install -m 644 lib/pkgconfig/darshan-runtime.pc $(libdir)/pkgconfig/darshan-runtime.pc
130
131
132
133
134

clean::
	rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so 

distclean:: clean
135
	rm -f darshan-runtime-config.h darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-gen-cc.pl darshan-mk-log-dirs.pl darshan-config darshan-base-ld-opts aclocal.m4 autom4te.cache/* config.status config.log Makefile 
136
	rm -rf autom4te.cache