Makefile.inc revision 1.18
11.18Smartin#	$NetBSD: Makefile.inc,v 1.18 2014/02/22 17:16:12 martin Exp $
21.9Smatt
31.13SmattARMV6= ${CPUFLAGS:M-march=armv6*} ${CPUFLAGS:M-mcpu=arm11*}
41.9SmattARMV6+= ${CFLAGS:M-march=armv6*:} ${CFLAGS:M-mcpu=arm11*}
51.9SmattARMV6+= ${CPPFLAGS:M-march=armv6*:} ${CPPFLAGS:M-mcpu=arm11*}
61.13SmattARMV7= ${CPUFLAGS:M-march=armv7*} ${CPUFLAGS:M-mcpu=cortex*}
71.13SmattARMV7+= ${CFLAGS:M-march=armv7*:} ${CFLAGS:M-mcpu=cortex*}
81.13SmattARMV7+= ${CPPFLAGS:M-march=armv7*:} ${CPPFLAGS:M-mcpu=cortex*}
91.14Smatt.if empty(CFLAGS:M-march=*) && empty(CFLAGS:M-mcpu=*) \
101.12Smatt    && empty(CPPFLAGS:M-march=*) && empty(CPPFLAGS:M-mcpu=*) \
111.12Smatt    && empty(CPUFLAGS:M-march=*) && empty(CPUFLAGS:M-mcpu=*)
121.13SmattARMV6+= ${MACHINE_ARCH:Mearmv6*}
131.13SmattARMV7+= ${MACHINE_ARCH:Mearmv7*}
141.12Smatt.endif
151.5Sad
161.8Spooka.if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
171.8Spooka	|| ${LIB} == "rump")
181.2Sad
191.13Smatt.if empty(ARMV6) && empty(ARMV7)
201.9SmattSRCS.atomic+=	atomic_add_32_cas.c atomic_add_32_nv_cas.c \
211.9Smatt		atomic_and_32_cas.c atomic_and_32_nv_cas.c \
221.9Smatt		atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
231.9Smatt		atomic_inc_32_cas.c atomic_inc_32_nv_cas.c \
241.9Smatt		atomic_or_32_cas.c atomic_or_32_nv_cas.c \
251.17Smartin		atomic_swap_32_cas.c membar_ops_nop.c
261.17Smartin
271.17Smartin.if ${LIB} == "c"
281.17SmartinSRCS.atomic+=	atomic_xor_32_cas.c atomic_xor_16_cas.c atomic_xor_8_cas.c \
291.16Smartin		atomic_sub_32_cas.c atomic_sub_16_cas.c atomic_sub_8_cas.c \
301.16Smartin		atomic_nand_32_cas.c atomic_nand_16_cas.c atomic_nand_8_cas.c \
311.16Smartin		atomic_or_16_cas.c atomic_or_8_cas.c \
321.16Smartin		atomic_and_16_cas.c atomic_and_8_cas.c \
331.16Smartin		atomic_add_16_cas.c atomic_add_8_cas.c \
341.18Smartin		atomic_swap_16_cas.c atomic_swap_8_cas.c \
351.18Smartin		atomic_cas_32_cas.c atomic_cas_16_cas.c atomic_cas_8_cas.c
361.17Smartin.endif
371.17Smartin
381.9Smatt.else
391.14Smatt.for op in add and cas nand or xor
401.14Smatt.for sz in 8 16 32 64
411.14SmattSRCS.atomic+=	atomic_${op}_${sz}.S
421.14Smatt.endfor
431.14Smatt.endfor
441.14SmattSRCS.atomic+=	atomic_dec_32.S atomic_dec_64.S
451.14SmattSRCS.atomic+=	atomic_inc_32.S atomic_inc_64.S
461.14SmattSRCS.atomic+=	atomic_swap.S atomic_swap_16.S atomic_swap_64.S
471.14SmattSRCS.atomic+=	membar_ops.S
481.14Smatt.for op in add and nand or sub xor
491.14SmattSRCS.atomic+=	sync_fetch_and_${op}_8.S
501.14Smatt.endfor
511.14Smatt.for sz in 1 2 4 8
521.14SmattSRCS.atomic+=	sync_bool_compare_and_swap_${sz}.S
531.14Smatt.endfor
541.9Smatt.endif
551.2Sad
561.5Sad.endif
571.5Sad
581.13Smatt.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread" || ${LIB} == "rump")
591.13Smatt
601.13SmattSRCS.atomic+=	atomic_simplelock.c
611.13Smatt.if empty(ARMV7)
621.13SmattCPUFLAGS.atomic_simplelock.c+=	-marm
631.13Smatt.endif
641.13Smatt
651.13Smatt.endif
661.13Smatt
671.7Sad.if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread")
681.4Sad
691.13Smatt.if empty(ARMV6) && empty(ARMV7)
701.9SmattSRCS.atomic+=	atomic_init_testset.c
711.9SmattSRCS.atomic+=	atomic_cas_up.S
721.6SscwCPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP
731.15SmattCPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_16_UP
741.15SmattCPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_8_UP
751.9Smatt.else
761.9SmattSRCS.atomic+=	atomic_init_cas.c
771.9Smatt.endif
781.4Sad
791.2Sad.endif
801.9Smatt
811.13Smatt.if !empty(ARMV6)
821.13Smatt.for f in ${SRCS.atomic:M*.S}
831.13SmattCPUFLAGS.$f+=	-marm
841.13Smatt.endfor
851.13Smatt.endif
861.13Smatt
871.9SmattSRCS+=	${SRCS.atomic}
88