Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. # lx25/arch/cris/arch-v32/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinux image from the original vmlinux files and romfs
  5. #
  6. target = $(target_compressed_dir)
  7. src = $(src_compressed_dir)
  8. CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
  9. CFLAGS = -O2
  10. LD = gcc-cris -mlinux -march=v32 -nostdlib
  11. OBJCOPY = objcopy-cris
  12. OBJCOPYFLAGS = -O binary --remove-section=.bss
  13. OBJECTS = $(target)/head.o $(target)/misc.o
  14. # files to compress
  15. SYSTEM = $(objtree)/vmlinux.bin
  16. all: vmlinuz
  17. $(target)/decompress.bin: $(OBJECTS)
  18. $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
  19. $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
  20. $(objtree)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
  21. cat $(target)/decompress.bin piggy.img > $(objtree)/vmlinuz
  22. rm -f piggy.img
  23. cp $(objtree)/vmlinuz $(src)
  24. $(target)/head.o: $(src)/head.S
  25. $(CC) -D__ASSEMBLY__ -c $< -o $@
  26. # gzip the kernel image
  27. piggy.img: $(SYSTEM)
  28. cat $(SYSTEM) | gzip -f -9 > piggy.img
  29. clean:
  30. rm -f piggy.img $(objtree)/vmlinuz vmlinuz.o decompress.o decompress.bin $(OBJECTS)