Home | History | Annotate | Line # | Download | only in atomic
Makefile.inc revision 1.20
      1 #	$NetBSD: Makefile.inc,v 1.20 2016/02/27 19:18:29 joerg Exp $
      2 
      3 .include <bsd.own.mk>
      4 
      5 # This is called with MACHINE=sparc64 && MACHINE_ARCH=sparc when building
      6 # 32 bit kernels for ultrasparc hardware
      7 .if ${MACHINE} == "sparc64"
      8 
      9 SPARC64DIR=	${.PARSEDIR}/../../sparc64/atomic
     10 .PATH.c: ${SPARC64DIR}
     11 .PATH.S: ${SPARC64DIR}
     12 
     13 .include "${SPARC64DIR}/Makefile.inc"
     14 
     15 .if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
     16 	|| ${LIB} == "rump")
     17 SRCS+=	atomic_nand_64_cas.c atomic_xor_64_cas.c atomic_sub_64_cas.c \
     18 	atomic_cas_64_cas.c
     19 .endif
     20 
     21 .else
     22 
     23 . if defined(LIB)
     24 
     25 .  if (${LIB} == "kern" || ${LIB} == "c"  || ${LIB} == "pthread"	\
     26     || ${LIB} == "rump")
     27 SRCS+=	atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \
     28 	atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
     29 	atomic_inc_32_cas.c atomic_inc_32_nv_cas.c atomic_or_32_cas.c \
     30 	atomic_or_32_nv_cas.c atomic_swap_32_cas.c membar_ops.S	\
     31 	atomic_cas_32_cas.c atomic_nand_32_cas.c atomic_sub_32_cas.c	\
     32 	atomic_xor_32_cas.c
     33 .  endif
     34 
     35 .  if ${LIB} == "c"
     36 SRCS+=	atomic_nand_16_cas.c atomic_nand_8_cas.c	\
     37 	atomic_and_16_cas.c atomic_and_8_cas.c		\
     38 	atomic_xor_16_cas.c atomic_xor_8_cas.c		\
     39 	atomic_add_16_cas.c atomic_add_8_cas.c		\
     40 	atomic_cas_16_cas.c atomic_cas_8_cas.c		\
     41 	atomic_sub_16_cas.c atomic_sub_8_cas.c		\
     42 	atomic_or_16_cas.c atomic_or_8_cas.c		\
     43 	atomic_swap_16_cas.c atomic_swap_8_cas.c	\
     44 	atomic_c11_compare_exchange_cas_32.c		\
     45 	atomic_c11_compare_exchange_cas_16.c		\
     46 	atomic_c11_compare_exchange_cas_8.c \
     47 	atomic_load.c atomic_store.c
     48 .  endif
     49 
     50 .  if (${LIB} == "kern" || ${LIB} == "rump")
     51 SRCS+=	atomic_cas.S
     52 .  endif
     53 
     54 .  if (${LIB} == "c" || ${LIB} == "pthread")
     55 CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP -D__HAVE_ASM_ATOMIC_CAS_16_UP	\
     56 	-D__HAVE_ASM_ATOMIC_CAS_8_UP
     57 SRCS+=	atomic_init_testset.c atomic_cas_up.S
     58 .  endif
     59 
     60 . endif
     61 
     62 .endif
     63