patchme 1.0 KB

123456789101112131415161718192021222324252627282930
  1. # master confi.mk
  2. echo "CROSS_COMPILE = powerpc-linux-" >>include/config.mk
  3. # patch the examples/Makefile to ignore return value from OBJCOPY
  4. sed -e 's/$(OBJCOPY)/-&/' < examples/Makefile > examples/makefile
  5. # add a built target for mkimage on the target architecture
  6. sed -e 's/^all:.*$/all: .depend envcrc mkimage mkimage.ppc/' < tools/Makefile > tools/makefile
  7. cat <<EOF >>tools/makefile
  8. mkimage.ppc : mkimage.o.ppc crc32.o.ppc
  9. powerpc-linux-gcc -msoft-float -Wall -Wstrict-prototypes -o \$@ \$^
  10. powerpc-linux-strip $@
  11. XFLAGS="-D__KERNEL__ -I../include -DCONFIG_4xx -Wall -Wstict-prototypes"
  12. mkimage.o.ppc: mkimage.c
  13. powerpc-linux-gcc -msoft-float -Wall -I../include -c -o \$@ \$^
  14. crc32.o.ppc: crc32.c
  15. powerpc-linux-gcc -msoft-float -Wall -I../include -c -o \$@ \$^
  16. EOF
  17. # make an image by default out of the u-boot image
  18. sed -e 's/^all:.*$/all: u-boot.image /' < Makefile > makefile
  19. cat <<EOF >>makefile
  20. u-boot.image: u-boot.bin
  21. tools/mkimage -A ppc -O linux -T firmware -C none -a 0 -e 0 -n U-Boot -d \$^ \$@
  22. EOF