linux/tools/testing/selftests/powerpc/switch_endian/Makefile
Michael Ellerman 266bac361d selftests/powerpc/switch_endian: Fix out-of-tree build
For the out-of-tree build to work we need to tell switch_endian_test
to look for check-reversed.S in $(OUTPUT).

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-10-31 23:56:21 +11:00

19 lines
546 B
Makefile

# SPDX-License-Identifier: GPL-2.0
TEST_GEN_PROGS := switch_endian_test
ASFLAGS += -O2 -Wall -g -nostdlib -m64
EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S
top_srcdir = ../../../../..
include ../../lib.mk
$(OUTPUT)/switch_endian_test: ASFLAGS += -I $(OUTPUT)
$(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S
$(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o
$(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@
$(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o
hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@