Added Cilk runtime library (libcilkrts) into GCC.
[gcc.git] / libcilkrts / Makefile.am
1 # @copyright
2 # Copyright (C) 2011, 2013, Intel Corporation
3 # All rights reserved.
4 #
5 # @copyright
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 #
10 # * Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
12 # * Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in
14 # the documentation and/or other materials provided with the
15 # distribution.
16 # * Neither the name of Intel Corporation nor the names of its
17 # contributors may be used to endorse or promote products derived
18 # from this software without specific prior written permission.
19 #
20 # @copyright
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
31 # WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 # POSSIBILITY OF SUCH DAMAGE.
33
34 AUTOMAKE_OPTIONS = foreign
35
36 # Use when building GCC
37 ACLOCAL_AMFLAGS = -I .. -I ../config
38
39 # Compiler and linker flags.
40 GENERAL_FLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/runtime -I$(top_srcdir)/runtime/config/$(config_dir) -DIN_CILK_RUNTIME=1
41 GENERAL_FLAGS += -D_Cilk_spawn="" -D_Cilk_sync="" -D_Cilk_for=for
42
43 # Enable Intel Cilk Plus extension
44 GENERAL_FLAGS += -fcilkplus
45
46 AM_CFLAGS = $(GENERAL_FLAGS) -std=c99
47 AM_CPPFLAGS = $(GENERAL_FLAGS)
48 AM_LDFLAGS = -lpthread -ldl
49
50 # Target list.
51 toolexeclib_LTLIBRARIES = libcilkrts.la
52
53 libcilkrts_la_SOURCES = \
54 runtime/config/$(config_dir)/cilk-abi-vla.c \
55 runtime/config/$(config_dir)/os-unix-sysdep.c \
56 runtime/bug.cpp \
57 runtime/cilk-abi.c \
58 runtime/cilk-abi-cilk-for.cpp \
59 runtime/cilk-abi-vla-internal.c \
60 runtime/cilk_api.c \
61 runtime/cilk_fiber.cpp \
62 runtime/cilk_fiber-unix.cpp \
63 runtime/cilk_malloc.c \
64 runtime/c_reducers.c \
65 runtime/except-gcc.cpp \
66 runtime/frame_malloc.c \
67 runtime/full_frame.c \
68 runtime/global_state.cpp \
69 runtime/jmpbuf.c \
70 runtime/local_state.c \
71 runtime/metacall_impl.c \
72 runtime/os_mutex-unix.c \
73 runtime/os-unix.c \
74 runtime/pedigrees.c \
75 runtime/record-replay.cpp \
76 runtime/reducer_impl.cpp \
77 runtime/scheduler.c \
78 runtime/signal_node.c \
79 runtime/spin_mutex.c \
80 runtime/stats.c \
81 runtime/symbol_test.c \
82 runtime/sysdep-unix.c \
83 runtime/worker_mutex.c
84
85
86 # Load the $(REVISION) value.
87 include include/internal/rev.mk
88
89 #libcilkrts_la_LDFLAGS = -rpath '$(libdir)'
90 libcilkrts_la_LDFLAGS = -version-info 5:0:0
91 libcilkrts_la_LDFLAGS += -lpthread -ldl
92
93 # If we're building on Linux, use the Linux version script
94 if LINUX_LINKER_SCRIPT
95 libcilkrts_la_LDFLAGS += -Wl,--version-script,$(srcdir)/runtime/linux-symbols.ver
96 endif
97
98 # If we're building on MacOS, use the Mac versioning
99 if MAC_LINKER_SCRIPT
100 libcilkrts_la_LDFLAGS += -Wl,-exported_symbols_list,$(srcdir)/runtime/mac-symbols.txt
101 endif
102
103
104 # Hack for Cygwin
105 libcilkrts_la_LDFLAGS += -no-undefined
106
107 # C/C++ header files for Cilk.
108 cilkincludedir = $(includedir)/cilk
109 cilkinclude_HEADERS = \
110 include/cilk/cilk_api.h \
111 include/cilk/cilk_api_linux.h \
112 include/cilk/cilk.h \
113 include/cilk/cilk_stub.h \
114 include/cilk/cilk_undocumented.h \
115 include/cilk/common.h \
116 include/cilk/holder.h \
117 include/cilk/hyperobject_base.h \
118 include/cilk/metaprogramming.h \
119 include/cilk/reducer_file.h \
120 include/cilk/reducer.h \
121 include/cilk/reducer_list.h \
122 include/cilk/reducer_max.h \
123 include/cilk/reducer_min.h \
124 include/cilk/reducer_min_max.h \
125 include/cilk/reducer_opadd.h \
126 include/cilk/reducer_opand.h \
127 include/cilk/reducer_opmul.h \
128 include/cilk/reducer_opor.h \
129 include/cilk/reducer_opxor.h \
130 include/cilk/reducer_ostream.h \
131 include/cilk/reducer_string.h
132
133
134 # Work around what appears to be a GNU make bug handling MAKEFLAGS
135 # values defined in terms of make variables, as is the case for CC and
136 # friends when we are called from the top level Makefile.
137 AM_MAKEFLAGS = \
138 "AR_FLAGS=$(AR_FLAGS)" \
139 "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
140 "CFLAGS=$(CFLAGS)" \
141 "CXXFLAGS=$(CXXFLAGS)" \
142 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
143 "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
144 "INSTALL=$(INSTALL)" \
145 "INSTALL_DATA=$(INSTALL_DATA)" \
146 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
147 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
148 "JC1FLAGS=$(JC1FLAGS)" \
149 "LDFLAGS=$(LDFLAGS)" \
150 "LIBCFLAGS=$(LIBCFLAGS)" \
151 "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
152 "MAKE=$(MAKE)" \
153 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
154 "PICFLAG=$(PICFLAG)" \
155 "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
156 "SHELL=$(SHELL)" \
157 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
158 "exec_prefix=$(exec_prefix)" \
159 "infodir=$(infodir)" \
160 "libdir=$(libdir)" \
161 "prefix=$(prefix)" \
162 "includedir=$(includedir)" \
163 "AR=$(AR)" \
164 "AS=$(AS)" \
165 "LD=$(LD)" \
166 "LIBCFLAGS=$(LIBCFLAGS)" \
167 "NM=$(NM)" \
168 "PICFLAG=$(PICFLAG)" \
169 "RANLIB=$(RANLIB)" \
170 "DESTDIR=$(DESTDIR)"
171
172 MAKEOVERRIDES=
173