selftests/powerpc: Fix out-of-tree build errors
[linux-2.6-block.git] / tools / testing / selftests / powerpc / switch_endian / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 TEST_GEN_PROGS := switch_endian_test
3
4 ASFLAGS += -O2 -Wall -g -nostdlib -m64
5
6 EXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S
7
8 top_srcdir = ../../../../..
9 include ../../lib.mk
10
11 $(OUTPUT)/switch_endian_test: ASFLAGS += -I $(OUTPUT)
12 $(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S
13
14 $(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o
15         $(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@
16
17 $(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o
18         hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@