blob: 7308ddade84e85872d8656dac29599872589c0ee [file] [log] [blame]
nethercote4388a402004-09-01 23:20:49 +00001include $(top_srcdir)/Makefile.all.am
njne68d7c02005-09-27 20:27:04 +00002include $(top_srcdir)/Makefile.core.am
njn7a6e7462002-11-09 17:53:30 +00003
njn7a6e7462002-11-09 17:53:30 +00004bin_PROGRAMS = valgrind-listener
5
sewardj8cbd68c2006-10-17 21:04:15 +00006noinst_SCRIPTS = gen-mdg DotToScc.hs Merge3Way.hs primes.c \
sewardjbe134452006-02-06 04:19:30 +00007 gsl16test gsl16-badfree.patch gsl16-wavelet.patch \
sewardja3689612007-03-26 15:27:01 +00008 gsl19test \
sewardj452fba82006-07-06 01:54:34 +00009 ppcfround.c ppc64shifts.c libmpiwrap.c mpiwrap_type_test.c \
sewardj1eff82b2006-10-17 00:56:43 +000010 aix5_VKI_info.c libmpiwrap_aix5.exp \
11 aix5_proc_self_sysent.c \
sewardj452fba82006-07-06 01:54:34 +000012 posixtestsuite-1.5.1-diff-results \
13 posixtestsuite-1.5.1-diff.txt
njn47167fd2005-06-26 14:43:01 +000014
njn94260f22005-07-02 17:36:11 +000015EXTRA_DIST = $(noinst_SCRIPTS)
16
sewardj01262142006-01-04 01:20:28 +000017
18#------------------------- listener -----------------------
19# Build valgrind_listener for the primary target only.
20#
nethercote4388a402004-09-01 23:20:49 +000021valgrind_listener_SOURCES = valgrind-listener.c
njn7a6e7462002-11-09 17:53:30 +000022
sewardj01262142006-01-04 01:20:28 +000023valgrind_listener_CPPFLAGS = $(AM_CPPFLAGS_PRI)
24valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI)
25valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
26valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI)
27#
28#----------------------------------------------------------
29
30
sewardj80637752006-03-02 13:48:21 +000031#------------------------- mpi wrappers -----------------------
sewardj1eff82b2006-10-17 00:56:43 +000032# Build libmpiwrap.so for the primary target, and for the secondary
33# target if relevant.
sewardj0ad46092006-03-02 17:09:16 +000034#
35# This is really horrible.
36#
sewardj1eff82b2006-10-17 00:56:43 +000037# Don't let automake install this, since it puts the .so's in the
38# wrong place. Instead install them ourselves in the right
sewardj80637752006-03-02 13:48:21 +000039# place using the install-exec-local target below.
40#
sewardj0ad46092006-03-02 17:09:16 +000041# Also, automake isn't good at supporting non-$(CC) compilers.
42# But we need to use $(MPI_CC) here. Hence the nasty hack of
sewardj1eff82b2006-10-17 00:56:43 +000043# directly saying how to build libmpiwrap-*.so, instead of
sewardj0ad46092006-03-02 17:09:16 +000044# using automake's standard gunk.
45#
sewardj1eff82b2006-10-17 00:56:43 +000046if VGO_AIX5
47 HACKY_FLAGS_PRI = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \
48 -qflag=w:w \
49 `echo $(AM_FLAG_M3264_PRI) | sed s/maix/q/g`
50 HACKY_FLAGS_SEC = -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \
51 -qflag=w:w \
52 `echo $(AM_FLAG_M3264_SEC) | sed s/maix/q/g`
53else
54 HACKY_FLAGS_PRI = -g -O -fno-omit-frame-pointer -Wall -fpic -shared \
55 $(AM_FLAG_M3264_PRI)
56 HACKY_FLAGS_SEC = -g -O -fno-omit-frame-pointer -Wall -fpic -shared \
57 $(AM_FLAG_M3264_SEC)
58endif
59
60
61## First, we have to say how to build the .so's ..
62##
63noinst_PROGRAMS =
64if BUILD_MPIWRAP_PRI
65noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_PRI@.so
66libmpiwrap-@VG_PLATFORM_PRI@.so: libmpiwrap.c
67 $(MPI_CC) $(HACKY_FLAGS_PRI) \
sewardj1a85e602006-03-08 15:26:10 +000068 -I../include \
sewardj1eff82b2006-10-17 00:56:43 +000069 -o libmpiwrap-@VG_PLATFORM_PRI@.so libmpiwrap.c
70endif
71if BUILD_MPIWRAP_SEC
72noinst_PROGRAMS += libmpiwrap-@VG_PLATFORM_SEC@.so
73libmpiwrap-@VG_PLATFORM_SEC@.so: libmpiwrap.c
74 $(MPI_CC) $(HACKY_FLAGS_SEC) \
75 -I../include \
76 -o libmpiwrap-@VG_PLATFORM_SEC@.so libmpiwrap.c
77endif
78
79
80## And here we say how to install them.
81##
82# The following install hack is serialised by "libmpiwrap.so".
83# Hence force -j 1.
84.NOTPARALLEL:
sewardj80637752006-03-02 13:48:21 +000085
86install-exec-local:
sewardj1eff82b2006-10-17 00:56:43 +000087if BUILD_MPIWRAP_PRI
sewardj80637752006-03-02 13:48:21 +000088# convert (eg) X86_LINUX to x86-linux
89# really should use sed here, rather than assume tr is available
90 pD=`echo @VG_PLATFORM_PRI@ | tr A-Z_ a-z-` ; \
sewardjc6691252006-12-10 02:26:50 +000091 $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \
sewardj1eff82b2006-10-17 00:56:43 +000092 rm -f ./libmpiwrap.so; \
93 cp ./libmpiwrap-@VG_PLATFORM_PRI@.so ./libmpiwrap.so; \
94 $(INSTALL_PROGRAM) ./libmpiwrap.so \
95 $(DESTDIR)$(valdir)/$$pD; \
96 rm -f ./libmpiwrap.so
sewardj80637752006-03-02 13:48:21 +000097endif
sewardj1eff82b2006-10-17 00:56:43 +000098if BUILD_MPIWRAP_SEC
99 pD=`echo @VG_PLATFORM_SEC@ | tr A-Z_ a-z-` ; \
100 $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \
101 rm -f ./libmpiwrap.so; \
102 cp ./libmpiwrap-@VG_PLATFORM_SEC@.so ./libmpiwrap.so; \
103 $(INSTALL_PROGRAM) ./libmpiwrap.so \
104 $(DESTDIR)$(valdir)/$$pD; \
105 rm -f ./libmpiwrap.so
106endif
107
108
sewardj775a3682007-03-08 01:52:37 +0000109## And some hacks to keep 'make dist' happy.
sewardj1eff82b2006-10-17 00:56:43 +0000110## It would seem that using nodist_SOURCES is the right fix, but
111## I can't figure out how to do it.
112##
sewardj1eff82b2006-10-17 00:56:43 +0000113#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_PRI@.c
sewardj775a3682007-03-08 01:52:37 +0000114#nodist_SOURCES = libmpiwrap-@VG_PLATFORM_SEC@.c
115
sewardj1eff82b2006-10-17 00:56:43 +0000116libmpiwrap-.c:
117 rm -f libmpiwrap-.c
118 touch libmpiwrap-.c
sewardj775a3682007-03-08 01:52:37 +0000119
120libmpiwrap-@VG_PLATFORM_PRI@.c:
121 rm -f libmpiwrap-@VG_PLATFORM_PRI@.c
122 touch libmpiwrap-@VG_PLATFORM_PRI@.c
123
124if VGP_HAVE_SECONDARY
sewardj1eff82b2006-10-17 00:56:43 +0000125libmpiwrap-@VG_PLATFORM_SEC@.c:
126 rm -f libmpiwrap-@VG_PLATFORM_SEC@.c
127 touch libmpiwrap-@VG_PLATFORM_SEC@.c
128endif
129
sewardj775a3682007-03-08 01:52:37 +0000130## cleanery
131clean-local:
132 rm -f libmpiwrap-.c \
133 libmpiwrap-@VG_PLATFORM_PRI@.c libmpiwrap-@VG_PLATFORM_SEC@.c
134
sewardj80637752006-03-02 13:48:21 +0000135#
136#----------------------------------------------------------
137