xref: /linux/tools/testing/selftests/powerpc/stringloops/Makefile (revision 37496845c812db2a470d51088a59ee38156e8058)
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
29521adf53SAnton Blanchard
30*37496845SMadhavan Srinivasan# The loops are all 64-bit code
31*37496845SMadhavan SrinivasanCFLAGS += -I$(CURDIR)
32*37496845SMadhavan Srinivasan
33*37496845SMadhavan SrinivasanASFLAGS = $(CFLAGS)
34*37496845SMadhavan Srinivasan
3588baa78dSbamvor.zhangjian@huawei.com$(TEST_GEN_PROGS): $(EXTRA_SOURCES)
36