1include $(top_srcdir)/Makefile.all.am
2
3# HACK WARNING: automake isn't good at supporting non-$(CC) compilers.
4# But we need to use $(MPI_CC) for the MPI stuff.  So we have this mpi stuff
5# in its own directory so we can use the following blunt instruments, which
6# override the C compiler and all the default flags.
7CC = $(MPI_CC)
8DEFS =
9DEFAULT_INCLUDES =
10CPPFLAGS =
11CFLAGS =
12LDFLAGS =
13
14EXTRA_DIST = \
15	mpiwrap_type_test.c
16
17#----------------------------------------------------------------------------
18# libmpiwrap-<platform>.so
19#----------------------------------------------------------------------------
20
21noinst_PROGRAMS  =
22if BUILD_MPIWRAP_PRI
23noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
24endif
25if BUILD_MPIWRAP_SEC
26noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
27endif
28
29if VGCONF_OS_IS_DARWIN
30noinst_DSYMS = $(noinst_PROGRAMS)
31endif
32
33
34if VGCONF_OS_IS_LINUX
35 CFLAGS_MPI  = -g -O -fno-omit-frame-pointer -Wall -fpic
36 LDFLAGS_MPI = -fpic -shared
37 MPI_FLAG_M3264_PRI = $(AM_FLAG_M3264_PRI)
38 MPI_FLAG_M3264_SEC = $(AM_FLAG_M3264_SEC)
39endif
40if VGCONF_OS_IS_DARWIN
41 CFLAGS_MPI  = -g -O -fno-omit-frame-pointer -Wall -dynamic
42 LDFLAGS_MPI = -dynamic -dynamiclib -all_load
43 MPI_FLAG_M3264_PRI = $(AM_FLAG_M3264_PRI)
44 MPI_FLAG_M3264_SEC = $(AM_FLAG_M3264_SEC)
45endif
46
47
48if BUILD_MPIWRAP_PRI
49libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_SOURCES  = libmpiwrap.c
50libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CPPFLAGS = -I../include
51libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_CFLAGS   = \
52	$(CFLAGS_MPI) $(MPI_FLAG_M3264_PRI)
53libmpiwrap_@VGCONF_ARCH_PRI@_@VGCONF_OS@_so_LDFLAGS  = $(LDFLAGS_MPI)
54endif
55if BUILD_MPIWRAP_SEC
56libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_SOURCES  = libmpiwrap.c
57libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CPPFLAGS = -I../include
58libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_CFLAGS   = \
59	$(CFLAGS_MPI) $(MPI_FLAG_M3264_SEC)
60libmpiwrap_@VGCONF_ARCH_SEC@_@VGCONF_OS@_so_LDFLAGS  = $(LDFLAGS_MPI)
61endif
62
63#----------------------------------------------------------------------------
64# General stuff
65#----------------------------------------------------------------------------
66
67all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
68
69clean-local: clean-noinst_DSYMS
70
71install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
72
73