xref: /linux/tools/testing/selftests/powerpc/stringloops/Makefile (revision ff2632d7d08edc11e8bd0629e9fcfebab25c78b4)
1# SPDX-License-Identifier: GPL-2.0
2EXTRA_SOURCES := ../harness.c
3
4build_32bit = $(shell if ($(CC) $(CFLAGS) -m32 -o /dev/null memcmp.c >/dev/null 2>&1) then echo "1"; fi)
5
6TEST_GEN_PROGS := memcmp_64 strlen
7
8$(OUTPUT)/memcmp_64: memcmp.c ../utils.c
9$(OUTPUT)/memcmp_64: CFLAGS += -m64 -maltivec
10
11ifeq ($(build_32bit),1)
12$(OUTPUT)/memcmp_32: memcmp.c
13$(OUTPUT)/memcmp_32: CFLAGS += -m32
14
15TEST_GEN_PROGS += memcmp_32
16endif
17
18$(OUTPUT)/strlen: strlen.c string.c
19
20ifeq ($(build_32bit),1)
21$(OUTPUT)/strlen_32: strlen.c
22$(OUTPUT)/strlen_32: CFLAGS += -m32
23
24TEST_GEN_PROGS += strlen_32
25endif
26
27top_srcdir = ../../../../..
28include ../../lib.mk
29include ../flags.mk
30
31# The loops are all 64-bit code
32CFLAGS += -I$(CURDIR)
33
34ASFLAGS = $(CFLAGS)
35
36$(TEST_GEN_PROGS): $(EXTRA_SOURCES)
37