Makefile.inc revision 1.21
1# $NetBSD: Makefile.inc,v 1.21 2014/03/04 06:36:41 matt Exp $ 2 3.ifnmake obj 4.include "${NETBSDSRCDIR}/common/lib/libc/arch/arm/features.mk" 5.endif 6 7.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \ 8 || ${LIB} == "rump") 9 10.if "${FEAT_LDREX}" == "no" 11SRCS.atomic+= atomic_add_32_cas.c atomic_add_32_nv_cas.c \ 12 atomic_and_32_cas.c atomic_and_32_nv_cas.c \ 13 atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \ 14 atomic_inc_32_cas.c atomic_inc_32_nv_cas.c \ 15 atomic_or_32_cas.c atomic_or_32_nv_cas.c \ 16 atomic_swap_32_cas.c membar_ops_nop.c 17 18.if ${LIB} == "c" 19SRCS.atomic+= atomic_xor_32_cas.c atomic_xor_16_cas.c atomic_xor_8_cas.c \ 20 atomic_sub_32_cas.c atomic_sub_16_cas.c atomic_sub_8_cas.c \ 21 atomic_nand_32_cas.c atomic_nand_16_cas.c atomic_nand_8_cas.c \ 22 atomic_or_16_cas.c atomic_or_8_cas.c \ 23 atomic_and_16_cas.c atomic_and_8_cas.c \ 24 atomic_add_16_cas.c atomic_add_8_cas.c \ 25 atomic_swap_16_cas.c atomic_swap_8_cas.c \ 26 atomic_cas_32_cas.c atomic_cas_16_cas.c atomic_cas_8_cas.c 27.endif 28 29.else 30.for op in add and cas nand or xor 31.for sz in 8 16 32 64 32SRCS.atomic+= atomic_${op}_${sz}.S 33.endfor 34.endfor 35SRCS.atomic+= atomic_dec_32.S atomic_dec_64.S 36SRCS.atomic+= atomic_inc_32.S atomic_inc_64.S 37SRCS.atomic+= atomic_sub_64.S 38SRCS.atomic+= atomic_swap.S atomic_swap_16.S atomic_swap_64.S 39SRCS.atomic+= membar_ops.S 40.for op in add and nand or sub xor 41SRCS.atomic+= sync_fetch_and_${op}_8.S 42.endfor 43.for sz in 1 2 4 8 44SRCS.atomic+= sync_bool_compare_and_swap_${sz}.S 45.endfor 46.endif 47 48.endif 49 50.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread" || ${LIB} == "rump") 51 52SRCS.atomic+= atomic_simplelock.c 53.if "${FEAT_THUMB2}" == "no" 54CPUFLAGS.atomic_simplelock.c+= -marm 55.endif 56 57.endif 58 59.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread") 60 61.if "${FEAT_LDREX}" == "no" 62SRCS.atomic+= atomic_init_testset.c 63SRCS.atomic+= atomic_cas_up.S 64CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP 65CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_16_UP 66CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_8_UP 67.if "${FEAT_EABI}" == "yes" && "${FEAT_LDRD}" == "yes" 68CPPFLAGS+= -D__HAVE_ATOMIC_CAS_64_UP -D__HAVE_ASM_ATOMIC_CAS_64_UP 69.endif 70.else 71SRCS.atomic+= atomic_init_cas.c 72.endif #FEAT_LDREX 73 74.endif #LIB 75 76.if "${FEAT_THUMB2}" == "no" 77.for f in ${SRCS.atomic:M*.S} 78CPUFLAGS.$f+= -marm 79.endfor 80.endif 81 82SRCS+= ${SRCS.atomic} 83