Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 -S
  20. #LDFLAGS_vmlinux := -Map linkmap.txt
  21. CHECKFLAGS +=
  22. PROCESSOR := unset
  23. UNIT := unset
  24. KBUILD_CFLAGS += -mam33 -mmem-funcs -DCPU=AM33
  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_UNIT_ASB2303),y)
  33. UNIT := asb2303
  34. endif
  35. ifeq ($(CONFIG_MN10300_UNIT_ASB2305),y)
  36. UNIT := asb2305
  37. endif
  38. head-y := arch/mn10300/kernel/head.o arch/mn10300/kernel/init_task.o
  39. core-y += arch/mn10300/kernel/ arch/mn10300/mm/
  40. ifneq ($(PROCESSOR),unset)
  41. core-y += arch/mn10300/proc-$(PROCESSOR)/
  42. endif
  43. ifneq ($(UNIT),unset)
  44. core-y += arch/mn10300/unit-$(UNIT)/
  45. endif
  46. libs-y += arch/mn10300/lib/
  47. drivers-$(CONFIG_OPROFILE) += arch/mn10300/oprofile/
  48. boot := arch/mn10300/boot
  49. .PHONY: zImage
  50. KBUILD_IMAGE := $(boot)/zImage
  51. CLEAN_FILES += $(boot)/zImage
  52. CLEAN_FILES += $(boot)/compressed/vmlinux
  53. CLEAN_FILES += $(boot)/compressed/vmlinux.bin
  54. CLEAN_FILES += $(boot)/compressed/vmlinux.bin.gz
  55. zImage: vmlinux
  56. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  57. all: zImage
  58. bootstrap:
  59. $(Q)$(MAKEBOOT) bootstrap
  60. archclean:
  61. $(Q)$(MAKE) $(clean)=arch/mn10300/proc-mn103e010
  62. $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2303
  63. $(Q)$(MAKE) $(clean)=arch/mn10300/unit-asb2305
  64. define archhelp
  65. echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
  66. endef
  67. # If you make sure the .S files get compiled with debug info,
  68. # uncomment the following to disable optimisations
  69. # that are unhelpful whilst debugging.
  70. ifdef CONFIG_DEBUG_INFO
  71. #KBUILD_CFLAGS += -O1
  72. KBUILD_AFLAGS += -Wa,--gdwarf2
  73. endif
  74. #
  75. # include the appropriate processor- and unit-specific headers
  76. #
  77. KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/proc-$(PROCESSOR)/include
  78. KBUILD_CPPFLAGS += -I$(srctree)/arch/mn10300/unit-$(UNIT)/include