Implement non-blocking transfer operations for SMP runtime.
[official-gcc.git] / libgupc / Makefile.am
blob7c9186d45997f71d1a3723382535a545b1cf9817
1 # Process this file with automake to produce Makefile.in
3  WARN_CFLAGS =
4 if LIBGUPC_SMP_RUNTIME
5   targ_runtime_dir = smp
6   WARN_CFLAGS += -W -Wall -Wwrite-strings -Wstrict-prototypes -Werror
7   INC_CFLAGS =
8 endif
9 if LIBGUPC_PORTALS4_RUNTIME
10   targ_runtime_dir = portals4
11   WARN_CFLAGS += -W -Wall -Wwrite-strings -Wstrict-prototypes -Werror
12   PORTALS4_IFLAG  = @portals4inc@
13   INC_CFLAGS = $(PORTALS4_IFLAG)
14 endif
16 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
18 ## May be used by toolexeclibdir.
19 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
21 gcc_objdir = $(MULTIBUILDTOP)../../$(host_subdir)/gcc
23 config_path = @config_path@
25 upc_crtstuff_mak = $(top_srcdir)/@upc_crtstuff_mak@
27 libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
29 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
31 LINK = $(LIBTOOL) --tag CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
32         $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LTLDFLAGS) -o $@
35 UPC_HDRS = include/upc_atomic.h include/upc_castable.h \
36            include/gasp.h include/gasp_upc.h include/gcc-upc.h \
37            include/pupc.h include/upc_collective.h include/upc.h \
38            include/upc_nb.h \
39            include/upc_relaxed.h include/upc_strict.h \
40            include/upc_tick.h include/upc_types.h
42 libsubinclude_HEADERS = $(UPC_HDRS)
43 nodist_noinst_HEADERS =
44 nodist_libsubinclude_HEADERS =
47 IN_LIB_CPPFLAGS  = -DIN_GCC -DIN_TARGET_LIBS
48 AM_CPPFLAGS = $(IN_LIB_CPPFLAGS)
49 AM_CFLAGS = $(WARN_CFLAGS) $(INC_CFLAGS)
50 AM_UPCFLAGS = $(WARN_CFLAGS) $(INC_CFLAGS) -fno-strict-aliasing
53 SUBDIRS = testsuite
56 if LIBGUPC_GENERIC_COLLECTIVES
57   collectives_dir = $(addprefix $(top_srcdir)/, collectives)
58 else
59   collectives_dir =
60 endif
62 search_path =   $(addprefix $(top_srcdir)/config/, $(config_path)) \
63                 $(addprefix $(top_srcdir)/, $(targ_runtime_dir)) \
64                 $(collectives_dir) \
65                 $(addprefix $(top_srcdir)/, include) \
66                 $(top_srcdir)
68 vpath % $(strip $(search_path))
70 AM_CPPFLAGS += $(addprefix -I, $(search_path))
71 AM_CPPFLAGS += $(addprefix -isystem, '.')
72 AM_CPPFLAGS += @bfdinc@
73 AM_CFLAGS += $(XCFLAGS)
74 AM_UPCFLAGS += $(XCFLAGS)
75 AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
77 ### Explicit build rules
79 LIBGUPC_SRCDIR = $(top_srcdir)/$(targ_runtime_dir)
81 MOSTLYCLEANFILES =
82 UPC_RUNTIME_SRC =
84 EXTRA_DIST = gen-inline-libgupc.pl gen-upc-ld-script.pl
86 LIBGUPC_COLL_SRCDIR = $(top_srcdir)/collectives
87 LIBGUPC_INC_SRCDIR = $(top_srcdir)/include
88 LIBGUPC_PORTALS4_SRCDIR = $(top_srcdir)/portals4
89 LIBGUPC_SMP_SRCDIR = $(top_srcdir)/smp
90 UPC_OPS_DEF = $(LIBGUPC_INC_SRCDIR)/upc_ops.def
91 UPC_TYPES_DEF = $(LIBGUPC_INC_SRCDIR)/upc_types.def
93 EXTRA_DIST += $(UPC_OPS_DEFS) $(UPC_TYPES_DEF)
95 AUTOGEN = autogen
97 if LIBGUPC_SMP_RUNTIME
99 EXTRA_DIST += smp/gcc-upc-lib.in
101 if LIBGUPC_PTHREADS
102 libgupc_pt = libgupc_pt.la
103 else
104 libgupc_pt =
105 endif
107 # Even though we're using vpath, we have to qualify the
108 # filenames with "smp/", because the libgupc_pt.la rules
109 # won't find the dependents because the name of the target
110 # doesn't match (ie, upc_access.c compiles into pt_upc_access_pt.lo)
112 if LIBGUPC_AFFINITY
113   UPC_AFFINITY_SUP = smp/upc_affinity.c
114 else
115   UPC_AFFINITY_SUP = smp/upc_affinity_stub.c
116 endif
117 if LIBGUPC_GUM
118   UPC_GUM_SUP = smp/upc_gum.c
119 else
120   UPC_GUM_SUP =
121 endif
122 if LIBGUPC_NUMA
123   UPC_NUMA_SUP = smp/upc_numa.c
124 else
125   UPC_NUMA_SUP = smp/upc_numa_stub.c
126 endif
127 UPC_BACKTRACE_SUP =
128 if LIBGUPC_BACKTRACE
129   UPC_BACKTRACE_SUP += smp/upc_backtrace.h smp/upc_backtrace.c
130 endif
132 if MAINTAINER_MODE
134 UPC_ATOMIC_DEF = $(LIBGUPC_SMP_SRCDIR)/upc_atomic.def
135 UPC_ATOMIC_TPL = $(LIBGUPC_SMP_SRCDIR)/upc_atomic.tpl
136 UPC_ATOMIC_UPC = $(LIBGUPC_SMP_SRCDIR)/upc_atomic.upc
138 EXTRA_DIST += $(UPC_ATOMIC_DEF) $(UPC_ATOMIC_TPL)
140 $(UPC_ATOMIC_UPC): $(UPC_ATOMIC_DEF) $(UPC_ATOMIC_TPL) \
141                         $(UPC_OP_DEF) $(UPC_TYPE_DEF)
142         cd $(LIBGUPC_SMP_SRCDIR); \
143         $(AUTOGEN) -L ../include upc_atomic.def
144 endif
146 UPC_RUNTIME_SRC += smp/upc_access.c smp/upc_accessg.c smp/upc_access.h \
147         smp/upc_addr.c smp/upc_affinity.h $(UPC_AFFINITY_SUP) \
148         smp/upc_allocg.upc smp/upc_alloc.upc \
149         smp/upc_atomic.upc \
150         $(UPC_BACKTRACE_SUP) \
151         smp/upc_barrier.upc smp/upc_castable.upc smp/upc_config.h \
152         smp/upc_debug.h smp/upc_debug.c \
153         smp/upc_defs.h smp/upc_gasp.c $(UPC_GUM_SUP) smp/upc_libg.c \
154         smp/upc_lib.h smp/upc_lock.upc smp/upc_lock.h \
155         smp/upc_lock_sup.h smp/upc_lock_sup.c \
156         smp/upc_main.c smp/upc_mem.c smp/upc_mem.h \
157         smp/upc_nb.upc smp/upc_numa.h $(UPC_NUMA_SUP) \
158         smp/upc_pgm_info.c smp/upc_pts.h smp/upc_pupc.c \
159         smp/upc_pupc.h smp/upc_sup.h smp/upc_sync.h smp/upc_sysdep.c \
160         smp/upc_sysdep.h smp/upc_tick.c smp/upc_vm.c
162 UPC_RUNTIME_SRC_INLINE = config.h smp/upc_access.c smp/upc_access.h \
163         smp/upc_config.h smp/upc_defs.h smp/upc_mem.h smp/upc_pts.h \
164         smp/upc_sup.h smp/upc_sync.h
166 endif   ### LIBGUPC_SMP_RUNTIME ####
168 if LIBGUPC_PORTALS4_RUNTIME
170 EXTRA_DIST += portals4/gcc-upc-lib.in
172 UPC_RUNTIME_SRC += portals4/gupcr_access.c portals4/gupcr_access.h \
173         portals4/gupcr_addr.c \
174         portals4/gupcr_alloc.upc portals4/gupcr_alloc.h \
175         portals4/gupcr_atomic.upc \
176         portals4/gupcr_atomic_sup.h portals4/gupcr_atomic_sup.c \
177         portals4/gupcr_barrier.h portals4/gupcr_barrier.c \
178         portals4/gupcr_broadcast.h portals4/gupcr_broadcast.c \
179         portals4/gupcr_castable.upc \
180         portals4/gupcr_clock.c \
181         portals4/gupcr_coll_sup.h portals4/gupcr_coll_sup.c \
182         portals4/gupcr_config.h portals4/gupcr_defs.h \
183         portals4/gupcr_env.c portals4/gupcr_gmem.h portals4/gupcr_gmem.c \
184         portals4/gupcr_lib.h \
185         portals4/gupcr_lock.upc portals4/gupcr_lock.h \
186         portals4/gupcr_lock_sup.c portals4/gupcr_lock_sup.h \
187         portals4/gupcr_main.c \
188         portals4/gupcr_nb.upc \
189         portals4/gupcr_nb_sup.c portals4/gupcr_nb_sup.h \
190         portals4/gupcr_node.c portals4/gupcr_node.h \
191         portals4/gupcr_mem.c portals4/gupcr_portals.c \
192         portals4/gupcr_pgm_info.c portals4/gupcr_pts.h \
193         portals4/gupcr_runtime.h portals4/gupcr_runtime.c \
194         portals4/gupcr_shutdown.h portals4/gupcr_shutdown.c \
195         portals4/gupcr_sup.h portals4/gupcr_sync.h \
196         portals4/gupcr_tick.c \
197         portals4/gupcr_utils.h portals4/gupcr_utils.c
199 UPC_RUNTIME_SRC_INLINE = config.h portals4/gupcr_access.c \
200         portals4/gupcr_access.h portals4/gupcr_config.h \
201         portals4/gupcr_defs.h portals4/gupcr_gmem.h \
202         portals4/gupcr_node.h \
203         portals4/gupcr_portals.h portals4/gupcr_pts.h \
204         portals4/gupcr_sup.h portals4/gupcr_sync.h \
205         portals4/gupcr_utils.h
207 if LIBGUPC_NODE_LOCAL_MEM_POSIX
208   UPC_RUNTIME_SRC += portals4/gupcr_node_mem_posix.c
209 endif
210 if LIBGUPC_NODE_LOCAL_MEM_MMAP
211   UPC_RUNTIME_SRC += portals4/gupcr_node_mem_mmap.c
212 endif
214 include doxygen-include.am
215 MOSTLYCLEANFILES += $(DX_CLEANFILES)
216 EXTRA_DIST += $(DX_CONFIG)
218 # Portals runtime only partialy uses generic collectives
220 # We need full pathnames here, because vpath won't find
221 # the files if they don't exist yet.
222 UPC_COLL_PREFIX_REDUCE_UPC = $(LIBGUPC_COLL_SRCDIR)/upc_coll_prefix_reduce.upc
223 UPC_COLL_REDUCE_UPC = $(LIBGUPC_PORTALS4_SRCDIR)/gupcr_coll_reduce.upc
225 if MAINTAINER_MODE
226 $(UPC_COLL_PREFIX_REDUCE_UPC): gen-upc-coll-reduce.pl \
227                                upc_coll_prefix_reduce.in
228         $(PERL) $+ > $@
230 $(UPC_COLL_REDUCE_UPC): gen-upc-coll-reduce.pl gupcr_coll_reduce.in
231         $(PERL) $+ > $@
232 endif
234 UPC_RUNTIME_SRC += \
235         portals4/upc_coll.h portals4/gupcr_coll_broadcast.upc \
236         portals4/gupcr_coll_init.upc $(UPC_COLL_REDUCE_UPC)
238 UPC_COLLECTIVES_SRC = \
239         collectives/upc_coll_err.upc collectives/upc_coll_exchange.upc \
240         collectives/upc_coll_gather_all.upc collectives/upc_coll_gather.upc \
241         collectives/upc_coll_permute.upc $(UPC_COLL_PREFIX_REDUCE_UPC) \
242         collectives/upc_coll_scatter.upc collectives/upc_coll_sort.upc
244 UPC_RUNTIME_SRC += $(UPC_COLLECTIVES_SRC)
246 EXTRA_DIST += gen-upc-coll-reduce.pl \
247              upc_coll_prefix_reduce.in \
248              gupcr_coll_reduce.in
250 endif   ### LIBGUPC_PORTALS_RUNTIME ####
252 if LIBGUPC_GENERIC_COLLECTIVES
254 # We need full pathnames here, because vpath won't find
255 # the files if they don't exist yet.
256 UPC_COLL_PREFIX_REDUCE_UPC = $(LIBGUPC_COLL_SRCDIR)/upc_coll_prefix_reduce.upc
257 UPC_COLL_REDUCE_UPC = $(LIBGUPC_COLL_SRCDIR)/upc_coll_reduce.upc
259 if MAINTAINER_MODE
260 $(UPC_COLL_PREFIX_REDUCE_UPC): gen-upc-coll-reduce.pl \
261                                upc_coll_prefix_reduce.in
262         $(PERL) $+ > $@
264 $(UPC_COLL_REDUCE_UPC): gen-upc-coll-reduce.pl upc_coll_reduce.in
265         $(PERL) $+ > $@
266 endif
268 UPC_COLLECTIVES_SRC = collectives/upc_coll_broadcast.upc \
269         collectives/upc_coll_err.upc collectives/upc_coll_exchange.upc \
270         collectives/upc_coll_gather_all.upc collectives/upc_coll_gather.upc \
271         collectives/upc_coll.h collectives/upc_coll_init.upc \
272         collectives/upc_coll_permute.upc $(UPC_COLL_PREFIX_REDUCE_UPC) \
273         $(UPC_COLL_REDUCE_UPC) collectives/upc_coll_scatter.upc \
274         collectives/upc_coll_sort.upc
276 UPC_RUNTIME_SRC += $(UPC_COLLECTIVES_SRC)
278 EXTRA_DIST += gen-upc-coll-reduce.pl \
279              upc_coll_prefix_reduce.in \
280              upc_coll_reduce.in
282 endif
284 toolexeclib_LTLIBRARIES = libgupc.la $(libgupc_pt)
285 nodist_toolexeclib_HEADERS = upc-crtbegin.spec libgupc.spec upc-crtend.spec
287 gcc-upc-lib.h: gen-inline-libgupc.pl gcc-upc-lib.in \
288                $(UPC_RUNTIME_SRC_INLINE)
289         $(PERL) $+ > $@
291 libsubinclude_HEADERS += gcc-upc-lib.h
293 BUILT_SOURCES = gcc-upc-lib.h
295 if LIBGUPC_LINK_SCRIPT
296 UPC_LINK_SCRIPT = gupc.ld
297 $(UPC_LINK_SCRIPT): gen-upc-ld-script.pl
298         -$(CC) $(LDFLAGS) -Xlinker --verbose -x none /dev/null 2>&1 | \
299          $(PERL) $+ > $@
300 BUILT_SOURCES += $(UPC_LINK_SCRIPT)
301 else
302 UPC_LINK_SCRIPT =
303 endif
304 nodist_toolexeclib_HEADERS += $(UPC_LINK_SCRIPT)
307 libgupc_la_SOURCES = $(UPC_RUNTIME_SRC)
308 libgupc_version_info = -version-info $(libtool_VERSION)
309 libgupc_la_LDFLAGS = $(libgupc_version_info)
310 libgupc_la_LINK = $(LINK) $(libgupc_la_LDFLAGS)
311 libgupc_la_LIBADD = \
312         ../libatomic/libatomic_convenience.la
313 libgupc_la_DEPENDENCIES = $(libgupc_la_LIBADD)
315 if LIBGUPC_PTHREADS
316 nodist_libgupc_pt_la_SOURCES = $(UPC_RUNTIME_SRC)
317 libgupc_pt_la_LIBADD =
318 libgupc_pt_la_DEPENDENCIES = $(libgupc_pt_la_LIBADD)
319 libgupc_pt_la_CPPFLAGS = $(AM_CPPFLAGS) -DGUPCR_USE_PTHREADS=1
320 libgupc_pt_la_UPCFLAGS = $(AM_UPCFLAGS) -fupc-pthreads-model-tls
321 libgupc_pt_la_LINK = $(libgupc_la_LINK)
322 endif
324 if LIBGUPC_CRTSTUFF
326 toolexeclib_DATA = @upc_crtstuff_objs@
328 include $(gcc_objdir)/libgcc.mvars
329 include $(upc_crtstuff_mak)
331 endif
333 # Automake Documentation:
334 # If your package has Texinfo files in many directories, you can use the
335 # variable TEXINFO_TEX to tell Automake where to find the canonical
336 # `texinfo.tex' for your package. The value of this variable should be
337 # the relative path from the current `Makefile.am' to `texinfo.tex'.
338 TEXINFO_TEX   = ../../gcc/doc/include/texinfo.tex
340 # Defines info, dvi, pdf and html targets
341 MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
342 info_TEXINFOS = libgupc.texi
344 # AM_CONDITIONAL on configure option --generated-files-in-srcdir
345 if GENINSRC
346 STAMP_GENINSRC = stamp-geninsrc
347 else
348 STAMP_GENINSRC =
349 endif
351 # AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
352 if BUILD_INFO
353 STAMP_BUILD_INFO = stamp-build-info
354 else
355 STAMP_BUILD_INFO =
356 endif
358 all-local: $(STAMP_GENINSRC)
360 stamp-geninsrc: libgupc.info
361         cp -p $(top_builddir)/libgupc.info $(srcdir)/libgupc.info
362         @touch $@
364 libgupc.info: $(STAMP_BUILD_INFO)
366 stamp-build-info: libgupc.texi
367         $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -o libgupc.info $(srcdir)/libgupc.texi
368         @touch $@
370 CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) libgupc.info \
371         $(nodist_toolexeclib_HEADERS) gupc.ld gcc-upc-lib.h
372 MAINTAINERCLEANFILES = $(srcdir)/libgupc.info