xref: /freebsd-12.1/gnu/lib/libgomp/Makefile (revision 25faff34)
1# $FreeBSD$
2
3GCCDIR=	${.CURDIR}/../../../contrib/gcc
4GCCLIB=	${.CURDIR}/../../../contrib/gcclibs
5SRCDIR=	${GCCLIB}/libgomp
6
7.PATH: ${SRCDIR} ${SRCDIR}/config/posix
8
9LIB=		gomp
10SHLIB_MAJOR=	1
11
12SRCS=	alloc.c barrier.c critical.c env.c \
13	error.c iter.c loop.c ordered.c parallel.c sections.c \
14	single.c team.c work.c lock.c mutex.c proc.c sem.c \
15	bar.c time.c fortran.c
16SRCS+=	gstdint.h libgomp_f.h omp.h omp_lib.h
17
18INCS+=	omp.h
19
20CFLAGS+= -DHAVE_CONFIG_H
21CFLAGS+= -I${.CURDIR} -I. -I${SRCDIR} -I${SRCDIR}/config/posix
22
23VERSION_MAP=	${SRCDIR}/libgomp.map
24
25# Target-specific OpenMP configuration
26.if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \
27    ${MACHINE_CPUARCH} == powerpc || \
28    (${MACHINE_CPUARCH} == mips && \
29	(!defined(TARGET_ABI) || ${TARGET_ABI} != "n64"))
30OMP_LOCK_ALIGN	=	4
31OMP_LOCK_KIND=		4
32OMP_LOCK_SIZE=		4
33OMP_NEST_LOCK_ALIGN=	4
34OMP_NEST_LOCK_KIND=	8
35OMP_NEST_LOCK_SIZE=	8
36.else
37OMP_LOCK_ALIGN	=	8
38OMP_LOCK_KIND=		8
39OMP_LOCK_SIZE=		8
40OMP_NEST_LOCK_ALIGN=	8
41OMP_NEST_LOCK_KIND=	8
42OMP_NEST_LOCK_SIZE=	16
43.endif
44
45gstdint.h:
46	echo  '#include <sys/types.h>'	>  ${.TARGET}
47	echo  '#include <stdint.h>'	>> ${.TARGET}
48CLEANFILES+= gstdint.h
49
50.for HFILE in libgomp_f.h omp.h omp_lib.h
51${HFILE}: ${SRCDIR}/${HFILE}.in
52	sed -e 's/@OMP_LOCK_ALIGN@/${OMP_LOCK_ALIGN}/g' \
53	    -e 's/@OMP_LOCK_KIND@/${OMP_LOCK_KIND}/g' \
54	    -e 's/@OMP_LOCK_SIZE@/${OMP_LOCK_SIZE}/g' \
55	    -e 's/@OMP_NEST_LOCK_ALIGN@/${OMP_NEST_LOCK_ALIGN}/g' \
56	    -e 's/@OMP_NEST_LOCK_KIND@/${OMP_NEST_LOCK_KIND}/g' \
57	    -e 's/@OMP_NEST_LOCK_SIZE@/${OMP_NEST_LOCK_SIZE}/g' \
58	    < ${.ALLSRC} > ${.TARGET}
59CLEANFILES+= ${HFILE}
60.endfor
61
62.include <bsd.lib.mk>
63