Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # create a compressed vmlinuz image from the binary vmlinux.bin file
  3. #
  4. target = $(target_compressed_dir)
  5. src = $(src_compressed_dir)
  6. CC = gcc-cris -melf $(LINUXINCLUDE)
  7. CFLAGS = -O2
  8. LD = ld-cris
  9. OBJCOPY = objcopy-cris
  10. OBJCOPYFLAGS = -O binary --remove-section=.bss
  11. OBJECTS = $(target)/head.o $(target)/misc.o
  12. # files to compress
  13. SYSTEM = $(objtree)/vmlinux.bin
  14. all: $(target_compressed_dir)/vmlinuz
  15. $(target)/decompress.bin: $(OBJECTS)
  16. $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
  17. $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
  18. # Create vmlinuz image in top-level build directory
  19. $(target_compressed_dir)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
  20. @echo " COMPR vmlinux.bin --> vmlinuz"
  21. @cat $(target)/decompress.bin piggy.img > $(target_compressed_dir)/vmlinuz
  22. @rm -f piggy.img
  23. $(target)/head.o: $(src)/head.S
  24. $(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
  25. $(target)/misc.o: $(src)/misc.c
  26. $(CC) -D__KERNEL__ -c $< -o $@
  27. # gzip the kernel image
  28. piggy.img: $(SYSTEM)
  29. @cat $(SYSTEM) | gzip -f -9 > piggy.img
  30. $(target):
  31. mkdir -p $(target)
  32. clean:
  33. rm -f piggy.img $(objtree)/vmlinuz