xref: /linux/tools/testing/selftests/powerpc/stringloops/Makefile (revision ff2632d7d08edc11e8bd0629e9fcfebab25c78b4)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
21bb07b59SChristophe LeroyEXTRA_SOURCES := ../harness.c
31bb07b59SChristophe Leroy
41bb07b59SChristophe Leroybuild_32bit = $(shell if ($(CC) $(CFLAGS) -m32 -o /dev/null memcmp.c >/dev/null 2>&1) then echo "1"; fi)
51bb07b59SChristophe Leroy
6f0abbfd8SChristophe LeroyTEST_GEN_PROGS := memcmp_64 strlen
71bb07b59SChristophe Leroy
8872d11bcSMichael Ellerman$(OUTPUT)/memcmp_64: memcmp.c ../utils.c
91bb07b59SChristophe Leroy$(OUTPUT)/memcmp_64: CFLAGS += -m64 -maltivec
101bb07b59SChristophe Leroy
111bb07b59SChristophe Leroyifeq ($(build_32bit),1)
121bb07b59SChristophe Leroy$(OUTPUT)/memcmp_32: memcmp.c
131bb07b59SChristophe Leroy$(OUTPUT)/memcmp_32: CFLAGS += -m32
141bb07b59SChristophe Leroy
151bb07b59SChristophe LeroyTEST_GEN_PROGS += memcmp_32
161bb07b59SChristophe Leroyendif
171bb07b59SChristophe Leroy
18f0abbfd8SChristophe Leroy$(OUTPUT)/strlen: strlen.c string.c
19f0abbfd8SChristophe Leroy
20396ab6abSChristophe Leroyifeq ($(build_32bit),1)
21396ab6abSChristophe Leroy$(OUTPUT)/strlen_32: strlen.c
22396ab6abSChristophe Leroy$(OUTPUT)/strlen_32: CFLAGS += -m32
23396ab6abSChristophe Leroy
24396ab6abSChristophe LeroyTEST_GEN_PROGS += strlen_32
25396ab6abSChristophe Leroyendif
26396ab6abSChristophe Leroy
277e0cf1c9SMichael Ellermantop_srcdir = ../../../../..
286faeeea4SMichael Ellermaninclude ../../lib.mk
29*108e5e68SMadhavan Srinivasaninclude ../flags.mk
30521adf53SAnton Blanchard
3137496845SMadhavan Srinivasan# The loops are all 64-bit code
3237496845SMadhavan SrinivasanCFLAGS += -I$(CURDIR)
3337496845SMadhavan Srinivasan
3437496845SMadhavan SrinivasanASFLAGS = $(CFLAGS)
3537496845SMadhavan Srinivasan
3688baa78dSbamvor.zhangjian@huawei.com$(TEST_GEN_PROGS): $(EXTRA_SOURCES)
37