Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. ###############################################################################
  2. #
  3. # MN10300 Kernel makefile system specifications
  4. #
  5. # Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  6. # Modified by David Howells (dhowells@redhat.com)
  7. #
  8. # This program is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public Licence
  10. # as published by the Free Software Foundation; either version
  11. # 2 of the Licence, or (at your option) any later version.
  12. #
  13. ###############################################################################
  14. KBUILD_DEFCONFIG := asb2303_defconfig
  15. CCSPECS := $(shell $(CC) -v 2>&1 | grep "^Reading specs from " | head -1 | cut -c20-)
  16. CCDIR := $(strip $(patsubst %/specs,%,$(CCSPECS)))
  17. KBUILD_CPPFLAGS += -nostdinc -I$(CCDIR)/include
  18. LDFLAGS :=
  19. OBJCOPYFLAGS := -O binary -R .note -R .comment -R .GCC-command-line -R .note.gnu.build-id -S
  20. #LDFLAGS_vmlinux := -Map linkmap.txt
  21. CHECKFLAGS +=
  22. PROCESSOR := unset
  23. UNIT := unset
  24. KBUILD_CFLAGS += -mam33 -DCPU=AM33 $(call cc-option,-mmem-funcs,)
  25. KBUILD_AFLAGS += -mam33 -DCPU=AM33
  26. ifeq ($(CONFIG_MN10300_CURRENT_IN_E2),y)
  27. KBUILD_CFLAGS += -ffixed-e2 -fcall-saved-e5
  28. endif
  29. ifeq ($(CONFIG_MN10300_PROC_MN103E010),y)
  30. PROCESSOR := mn103e010
  31. endif
  32. ifeq ($(CONFIG_MN10300_PROC_MN2WS0050),y)
  33. PROCESSOR := mn2ws0050
  34. endif
  35. ifeq ($(CONFIG_MN10300_UNIT_ASB2303),y)
  36. UNIT := asb2303
  37. endif
  38. ifeq ($(CONFIG_MN10300_UNIT_ASB2305),y)
  39. UNIT := asb2305
  40. endif
  41. ifeq ($(CONFIG_MN10300_UNIT_ASB2364),y)
  42. UNIT := asb2364
  43. endif
  44. head-y := arch/mn10300/kernel/head.o
  45. core-y += arch/mn10300/kernel/ arch/mn10300/mm/
  46. ifneq ($(PROCESSOR),unset)
  47. core-y += arch/mn10300/proc-$(PROCESSOR)/
  48. endif
  49. ifneq ($(UNIT),unset)
  50. core-y += arch/mn10300/unit-$(UNIT)/
  51. endif
  52. libs-y += arch/mn10300/lib/
  53. drivers-$(CONFIG_OPROFILE) += arch/mn10300/oprofile/
  54. boot := arch/mn10300/boot
  55. .PHONY: zImage
  56. KBUILD_IMAGE := $(boot)/zImage
  57. CLEAN_FILES += $(boot)/zImage
  58. CLEAN_FILES += $(boot)/compressed/vmlinux
  59. CLEAN_FILES += $(boot)/compressed/vmlinux.bin
  60. CLEAN_FILES += $(boot)/compressed/vmlinux.bin.gz
  61. zImage: vmlinux
  62. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  63. all: zImage
  64. bootstrap:
  65. $(Q)$(MAKEBOOT) bootstrap
  66. archclean:
  67. $(Q)$(MAKE) $(clean)=arch/mn10300/proc-mn103e010
  68. $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2303
  69. $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2305
  70. define archhelp
  71. echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
  72. endef
  73. #
  74. # include the appropriate processor- and unit-specific headers
  75. #
  76. KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/proc-$(PROCESSOR)/include
  77. KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/unit-$(UNIT)/include