Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # linux/arch/unicore32/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinuz image from the original vmlinux
  5. #
  6. # This file is subject to the terms and conditions of the GNU General Public
  7. # License. See the file "COPYING" in the main directory of this archive
  8. # for more details.
  9. #
  10. # Copyright (C) 2001~2010 GUAN Xue-tao
  11. #
  12. ccflags-y := -fpic -fno-builtin
  13. asflags-y := -Wa,-march=all
  14. OBJS := misc.o
  15. # font.c and font.o
  16. CFLAGS_font.o := -Dstatic=
  17. $(obj)/font.c: $(srctree)/drivers/video/console/font_8x8.c
  18. $(call cmd,shipped)
  19. # piggy.S and piggy.o
  20. suffix_$(CONFIG_KERNEL_GZIP) := gzip
  21. suffix_$(CONFIG_KERNEL_BZIP2) := bz2
  22. suffix_$(CONFIG_KERNEL_LZO) := lzo
  23. suffix_$(CONFIG_KERNEL_LZMA) := lzma
  24. $(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
  25. $(call if_changed,$(suffix_y))
  26. SEDFLAGS_piggy = s/DECOMP_SUFFIX/$(suffix_y)/
  27. $(obj)/piggy.S: $(obj)/piggy.S.in
  28. @sed "$(SEDFLAGS_piggy)" < $< > $@
  29. $(obj)/piggy.o: $(obj)/piggy.$(suffix_y) $(obj)/piggy.S FORCE
  30. targets := vmlinux vmlinux.lds font.o font.c head.o misc.o \
  31. piggy.$(suffix_y) piggy.o piggy.S \
  32. # Make sure files are removed during clean
  33. extra-y += piggy.gzip piggy.bz2 piggy.lzo piggy.lzma
  34. # ?
  35. LDFLAGS_vmlinux += -p
  36. # Report unresolved symbol references
  37. LDFLAGS_vmlinux += --no-undefined
  38. # Delete all temporary local symbols
  39. LDFLAGS_vmlinux += -X
  40. # Next argument is a linker script
  41. LDFLAGS_vmlinux += -T
  42. # For uidivmod
  43. $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head.o $(obj)/piggy.o \
  44. $(obj)/misc.o FORCE
  45. $(call if_changed,ld)
  46. @:
  47. # We now have a PIC decompressor implementation. Decompressors running
  48. # from RAM should not define ZTEXTADDR. Decompressors running directly
  49. # from ROM or Flash must define ZTEXTADDR (preferably via the config)
  50. ZTEXTADDR := 0x03000000
  51. ZBSSADDR := ALIGN(4)
  52. SEDFLAGS_lds = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
  53. $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/unicore32/boot/Makefile $(KCONFIG_CONFIG)
  54. @sed "$(SEDFLAGS_lds)" < $< > $@