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
34AUTOMAKE_OPTIONS = foreign
35
36# Use when building GCC
37ACLOCAL_AMFLAGS = -I .. -I ../config
38
39# Compiler and linker flags.
40GENERAL_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
44GENERAL_FLAGS += -fcilkplus
45
46# Always generate unwind tables
47GENERAL_FLAGS += -funwind-tables
48
49AM_CFLAGS = $(XCFLAGS) $(GENERAL_FLAGS) -std=c99
50AM_CPPFLAGS = $(GENERAL_FLAGS)
51AM_LDFLAGS = $(XLDFLAGS)
52
53# May be used by toolexeclibdir.
54gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
55
56# Target list.
57nodist_toolexeclib_HEADERS = libcilkrts.spec
58toolexeclib_LTLIBRARIES = libcilkrts.la
59
60libcilkrts_la_SOURCES =            \
61  runtime/config/$(config_dir)/cilk-abi-vla.c           \
62  runtime/config/$(config_dir)/os-unix-sysdep.c \
63  runtime/bug.cpp                  \
64  runtime/cilk-abi.c               \
65  runtime/cilk-abi-cilk-for.cpp    \
66  runtime/cilk-abi-vla-internal.c  \
67  runtime/cilk_api.c               \
68  runtime/cilk_fiber.cpp           \
69  runtime/cilk_fiber-unix.cpp      \
70  runtime/cilk_malloc.c            \
71  runtime/c_reducers.c             \
72  runtime/except-gcc.cpp           \
73  runtime/frame_malloc.c           \
74  runtime/full_frame.c             \
75  runtime/global_state.cpp         \
76  runtime/jmpbuf.c                 \
77  runtime/local_state.c            \
78  runtime/metacall_impl.c          \
79  runtime/os_mutex-unix.c          \
80  runtime/os-unix.c                \
81  runtime/pedigrees.c              \
82  runtime/record-replay.cpp        \
83  runtime/reducer_impl.cpp         \
84  runtime/scheduler.c              \
85  runtime/signal_node.c            \
86  runtime/spin_mutex.c             \
87  runtime/stats.c                  \
88  runtime/symbol_test.c            \
89  runtime/sysdep-unix.c            \
90  runtime/worker_mutex.c
91
92
93# Load the $(REVISION) value.
94include include/internal/rev.mk
95
96#libcilkrts_la_LDFLAGS  = -rpath '$(libdir)'
97libcilkrts_la_LDFLAGS = -version-info 5:0:0
98libcilkrts_la_LDFLAGS += @lt_cv_dlopen_libs@
99libcilkrts_la_LDFLAGS += $(AM_LDFLAGS)
100
101# If we're building on Linux, use the Linux version script
102if LINUX_LINKER_SCRIPT
103    libcilkrts_la_LDFLAGS += -Wl,--version-script,$(srcdir)/runtime/linux-symbols.ver
104endif
105
106# If we're building on MacOS, use the Mac versioning
107if MAC_LINKER_SCRIPT
108  libcilkrts_la_LDFLAGS += -Wl,-exported_symbols_list,$(srcdir)/runtime/mac-symbols.txt
109endif
110
111
112# Hack for Cygwin
113libcilkrts_la_LDFLAGS += -no-undefined
114
115# C/C++ header files for Cilk.
116# cilkincludedir = $(includedir)/cilk
117cilkincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include/cilk
118nodist_cilkinclude_HEADERS =       \
119  include/cilk/cilk_api.h          \
120  include/cilk/cilk_api_linux.h    \
121  include/cilk/cilk.h              \
122  include/cilk/cilk_stub.h         \
123  include/cilk/cilk_undocumented.h \
124  include/cilk/common.h            \
125  include/cilk/holder.h            \
126  include/cilk/hyperobject_base.h  \
127  include/cilk/metaprogramming.h   \
128  include/cilk/reducer_file.h      \
129  include/cilk/reducer.h           \
130  include/cilk/reducer_list.h      \
131  include/cilk/reducer_max.h       \
132  include/cilk/reducer_min.h       \
133  include/cilk/reducer_min_max.h   \
134  include/cilk/reducer_opadd.h     \
135  include/cilk/reducer_opand.h     \
136  include/cilk/reducer_opmul.h     \
137  include/cilk/reducer_opor.h      \
138  include/cilk/reducer_opxor.h     \
139  include/cilk/reducer_ostream.h   \
140  include/cilk/reducer_string.h
141
142
143# Work around what appears to be a GNU make bug handling MAKEFLAGS
144# values defined in terms of make variables, as is the case for CC and
145# friends when we are called from the top level Makefile.
146AM_MAKEFLAGS = \
147       "AR_FLAGS=$(AR_FLAGS)" \
148       "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
149       "CFLAGS=$(CFLAGS)" \
150       "CXXFLAGS=$(CXXFLAGS)" \
151       "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
152       "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
153       "INSTALL=$(INSTALL)" \
154       "INSTALL_DATA=$(INSTALL_DATA)" \
155       "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
156       "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
157       "JC1FLAGS=$(JC1FLAGS)" \
158       "LDFLAGS=$(LDFLAGS)" \
159       "LIBCFLAGS=$(LIBCFLAGS)" \
160       "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
161       "MAKE=$(MAKE)" \
162       "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
163       "PICFLAG=$(PICFLAG)" \
164       "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
165       "SHELL=$(SHELL)" \
166       "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
167       "exec_prefix=$(exec_prefix)" \
168       "infodir=$(infodir)" \
169       "libdir=$(libdir)" \
170       "prefix=$(prefix)" \
171       "includedir=$(includedir)" \
172       "AR=$(AR)" \
173       "AS=$(AS)" \
174       "LD=$(LD)" \
175       "LIBCFLAGS=$(LIBCFLAGS)" \
176       "NM=$(NM)" \
177       "PICFLAG=$(PICFLAG)" \
178       "RANLIB=$(RANLIB)" \
179       "DESTDIR=$(DESTDIR)"
180
181MAKEOVERRIDES=
182
183