xref: /OK3568_Linux_fs/kernel/tools/testing/selftests/powerpc/switch_endian/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
2*4882a593SmuzhiyunTEST_GEN_PROGS := switch_endian_test
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunASFLAGS += -O2 -Wall -g -nostdlib -m64
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunEXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S
7*4882a593Smuzhiyun
8*4882a593Smuzhiyuntop_srcdir = ../../../../..
9*4882a593Smuzhiyuninclude ../../lib.mk
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun$(OUTPUT)/switch_endian_test: ASFLAGS += -I $(OUTPUT)
12*4882a593Smuzhiyun$(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun$(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o
15*4882a593Smuzhiyun	$(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun$(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o
18*4882a593Smuzhiyun	hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@
19