xref: /freebsd/lib/libomp/Makefile (revision a0409676120c1e558d0ade943019934e0f15118d)
1# $FreeBSD$
2
3.include <bsd.compiler.mk>
4
5SHLIB_NAME=	libomp.so
6
7OMPSRC=		${SRCTOP}/contrib/llvm-project/openmp/runtime/src
8ITTSRC=		${OMPSRC}/thirdparty/ittnotify
9.PATH:		${OMPSRC}
10.PATH:		${ITTSRC}
11
12SRCS+=		ittnotify_static.cpp
13SRCS+=		kmp_affinity.cpp
14SRCS+=		kmp_alloc.cpp
15SRCS+=		kmp_atomic.cpp
16SRCS+=		kmp_barrier.cpp
17SRCS+=		kmp_cancel.cpp
18SRCS+=		kmp_csupport.cpp
19SRCS+=		kmp_debug.cpp
20SRCS+=		kmp_dispatch.cpp
21SRCS+=		kmp_environment.cpp
22SRCS+=		kmp_error.cpp
23SRCS+=		kmp_ftn_cdecl.cpp
24SRCS+=		kmp_ftn_extra.cpp
25SRCS+=		kmp_global.cpp
26SRCS+=		kmp_gsupport.cpp
27SRCS+=		kmp_i18n.cpp
28SRCS+=		kmp_io.cpp
29SRCS+=		kmp_itt.cpp
30SRCS+=		kmp_lock.cpp
31SRCS+=		kmp_runtime.cpp
32SRCS+=		kmp_sched.cpp
33SRCS+=		kmp_settings.cpp
34SRCS+=		kmp_str.cpp
35SRCS+=		kmp_taskdeps.cpp
36SRCS+=		kmp_tasking.cpp
37SRCS+=		kmp_threadprivate.cpp
38SRCS+=		kmp_utility.cpp
39SRCS+=		kmp_version.cpp
40SRCS+=		kmp_wait_release.cpp
41SRCS+=		ompt-general.cpp
42SRCS+=		z_Linux_asm.S
43SRCS+=		z_Linux_util.cpp
44INCS+=		omp.h
45
46WARNS?=		1
47
48CFLAGS+=	-D__STDC_CONSTANT_MACROS
49CFLAGS+=	-D__STDC_FORMAT_MACROS
50CFLAGS+=	-D__STDC_LIMIT_MACROS
51CFLAGS+=	-I${.CURDIR}
52CFLAGS+=	-I${OMPSRC}
53CFLAGS+=	-I${ITTSRC}
54CFLAGS+=	-ffunction-sections
55CFLAGS+=	-fdata-sections
56CXXFLAGS+=	-fvisibility-inlines-hidden
57CXXFLAGS+=	-fno-exceptions
58CXXFLAGS+=	-fno-rtti
59CXXSTD=		c++11
60
61.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 90000
62# When targeting i386, clang 9.0.0 produces a new warning about large atomic
63# operations "possibly incurring significant performance penalties", but there
64# is not much we can do about it.
65CWARNFLAGS+=	-Wno-atomic-alignment
66.endif
67
68LDFLAGS+=	-Wl,--warn-shared-textrel
69LDFLAGS+=	-Wl,--gc-sections
70LDFLAGS+=	-Wl,-z,noexecstack
71LDFLAGS+=	-Wl,-fini=__kmp_internal_end_fini
72LDFLAGS+=	-Wl,-soname,libomp.so
73
74VERSION_MAP=	${OMPSRC}/exports_so.txt
75
76LIBADD+=	pthread
77LIBADD+=	m
78
79SYMLINKS+=	${SHLIB_NAME} ${LIBDIR}/libgomp.so
80
81.include <bsd.lib.mk>
82