xref: /openbmc/linux/tools/testing/selftests/powerpc/switch_endian/Makefile (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
288baa78dSbamvor.zhangjian@huawei.comTEST_GEN_PROGS := switch_endian_test
34cd968efSMichael Ellerman
44cd968efSMichael EllermanASFLAGS += -O2 -Wall -g -nostdlib -m64
54cd968efSMichael Ellerman
6a8ba798bSbamvor.zhangjian@huawei.comEXTRA_CLEAN = $(OUTPUT)/*.o $(OUTPUT)/check-reversed.S
780d443e8Sbamvor.zhangjian@huawei.com
87e0cf1c9SMichael Ellermantop_srcdir = ../../../../..
988baa78dSbamvor.zhangjian@huawei.cominclude ../../lib.mk
104cd968efSMichael Ellerman
11*266bac36SMichael Ellerman$(OUTPUT)/switch_endian_test: ASFLAGS += -I $(OUTPUT)
12a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/switch_endian_test: $(OUTPUT)/check-reversed.S
134cd968efSMichael Ellerman
14a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/check-reversed.o: $(OUTPUT)/check.o
154cd968efSMichael Ellerman	$(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@
164cd968efSMichael Ellerman
17a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/check-reversed.S: $(OUTPUT)/check-reversed.o
184cd968efSMichael Ellerman	hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@
19