1CC := $(CROSS_COMPILE)gcc 2PROGS := switch_endian_test 3 4ASFLAGS += -O2 -Wall -g -nostdlib -m64 5 6all: $(PROGS) 7 8switch_endian_test: check-reversed.S 9 10check-reversed.o: check.o 11 $(CROSS_COMPILE)objcopy -j .text --reverse-bytes=4 -O binary $< $@ 12 13check-reversed.S: check-reversed.o 14 hexdump -v -e '/1 ".byte 0x%02X\n"' $< > $@ 15 16run_tests: all 17 @-for PROG in $(PROGS); do \ 18 ./$$PROG; \ 19 done; 20 21clean: 22 rm -f $(PROGS) *.o check-reversed.S 23 24.PHONY: all run_tests clean 25