Makefile
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:6k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #
  2. # arch/arm/Makefile
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License.  See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. # Copyright (C) 1995-2001 by Russell King
  9. LINKFLAGS :=-p -X -T arch/arm/vmlinux.lds
  10. GZFLAGS :=-9
  11. CFLAGS +=-fno-common -pipe
  12. ifeq ($(CONFIG_DEBUG_INFO),y)
  13. CFLAGS +=-g
  14. endif
  15. # Select CPU dependent flags.  Note that order of declaration is important;
  16. # the options further down the list override previous items.
  17. #
  18. # Note!  For APCS-26 YOU MUST HAVE AN APCS-26 LIBGCC.A
  19. #
  20. apcs-y :=-mapcs-32
  21. apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3 -Os
  22. # This selects which instruction set is used.
  23. arch-y :=
  24. arch-$(CONFIG_CPU_32v3) :=-march=armv3
  25. arch-$(CONFIG_CPU_32v4) :=-march=armv4
  26. arch-$(CONFIG_CPU_32v5) :=-march=armv5
  27. # This selects how we optimise for the processor.
  28. tune-y :=
  29. tune-$(CONFIG_CPU_ARM610) :=-mtune=arm610
  30. tune-$(CONFIG_CPU_ARM710) :=-mtune=arm710
  31. tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi
  32. tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi
  33. tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi
  34. tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
  35. tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
  36. tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100
  37. CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float
  38. CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float
  39. AFLAGS +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float
  40. ifeq ($(CONFIG_CPU_26),y)
  41. PROCESSOR  = armo
  42.   ifeq ($(CONFIG_ROM_KERNEL),y)
  43.     DATAADDR  = 0x02080000
  44.     TEXTADDR  = 0x03800000
  45.     LDSCRIPT  = arch/arm/vmlinux-armo-rom.lds.in
  46.   else
  47.     TEXTADDR  = 0x02080000
  48.     LDSCRIPT  = arch/arm/vmlinux-armo.lds.in
  49.   endif
  50. endif
  51. ifeq ($(CONFIG_CPU_32),y)
  52. PROCESSOR  = armv
  53. TEXTADDR  = 0xC0008000
  54. LDSCRIPT  = arch/arm/vmlinux-armv.lds.in
  55. endif
  56. ifeq ($(CONFIG_ARCH_ARCA5K),y)
  57. MACHINE  = arc
  58. endif
  59. ifeq ($(CONFIG_ARCH_RPC),y)
  60. MACHINE  = rpc
  61. endif
  62. ifeq ($(CONFIG_ARCH_EBSA110),y)
  63. MACHINE  = ebsa110
  64. CFLAGS_3c589_cs :=-DISA_SIXTEEN_BIT_PERIPHERAL
  65. export CFLAGS_3c589_cs
  66. endif
  67. ifeq ($(CONFIG_ARCH_CLPS7500),y)
  68. MACHINE  = clps7500
  69. INCDIR  = cl7500
  70. endif
  71. ifeq ($(CONFIG_FOOTBRIDGE),y)
  72. MACHINE  = footbridge
  73. INCDIR  = ebsa285
  74. endif
  75. ifeq ($(CONFIG_ARCH_CO285),y)
  76. TEXTADDR  = 0x60008000
  77. MACHINE  = footbridge
  78. INCDIR  = ebsa285
  79. endif
  80. ifeq ($(CONFIG_ARCH_FTVPCI),y)
  81. MACHINE  = ftvpci
  82. INCDIR  = nexuspci
  83. endif
  84. ifeq ($(CONFIG_ARCH_TBOX),y)
  85. MACHINE  = tbox
  86. endif
  87. ifeq ($(CONFIG_ARCH_SHARK),y)
  88. MACHINE  = shark
  89. endif
  90. ifeq ($(CONFIG_ARCH_SA1100),y)
  91. ifeq ($(CONFIG_SA1111),y)
  92. # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
  93. TEXTADDR  = 0xc0208000
  94. endif
  95. MACHINE  = sa1100
  96. endif
  97. ifeq ($(CONFIG_ARCH_L7200),y)
  98. MACHINE  = l7200
  99. endif
  100. ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
  101. MACHINE  = integrator
  102. endif
  103. ifeq ($(CONFIG_ARCH_MX1ADS),y)
  104. MACHINE  = mx1ads
  105. endif
  106. ifeq ($(CONFIG_ARCH_CAMELOT),y)
  107. MACHINE          = epxa10db
  108. endif
  109. ifeq ($(CONFIG_ARCH_CLPS711X),y)
  110. TEXTADDR  = 0xc0028000
  111. MACHINE  = clps711x
  112. endif
  113. ifeq ($(CONFIG_ARCH_FORTUNET),y)
  114. TEXTADDR  = 0xc0008000
  115. endif
  116. ifeq ($(CONFIG_ARCH_ANAKIN),y)
  117. MACHINE  = anakin
  118. endif
  119. export MACHINE PROCESSOR TEXTADDR GZFLAGS CFLAGS_BOOT
  120. # Only set INCDIR if its not already defined above
  121. # Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
  122. ifeq ($(origin INCDIR), undefined)
  123. INCDIR := $(MACHINE)
  124. endif
  125. ifeq ($(origin DATAADDR), undefined)
  126. DATAADDR := .
  127. endif
  128. # If we have a machine-specific directory, then include it in the build.
  129. MACHDIR := arch/arm/mach-$(MACHINE)
  130. ifeq ($(MACHDIR),$(wildcard $(MACHDIR)))
  131. SUBDIRS += $(MACHDIR)
  132. CORE_FILES := $(MACHDIR)/$(MACHINE).o $(CORE_FILES)
  133. endif
  134. HEAD := arch/arm/kernel/head-$(PROCESSOR).o 
  135.    arch/arm/kernel/init_task.o
  136. SUBDIRS += arch/arm/kernel arch/arm/mm arch/arm/lib arch/arm/nwfpe
  137. CORE_FILES := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
  138. LIBS := arch/arm/lib/lib.a $(LIBS)
  139. ifeq ($(CONFIG_FPE_NWFPE),y)
  140. LIBS := arch/arm/nwfpe/math-emu.o $(LIBS)
  141. endif
  142. # Only include fastfpe if it is part of the kernel tree.
  143. FASTFPE := arch/arm/fastfpe
  144. ifeq ($(FASTFPE),$(wildcard $(FASTFPE)))
  145. SUBDIRS += $(FASTFPE)
  146. ifeq ($(CONFIG_FPE_FASTFPE),y)
  147. LIBS := arch/arm/fastfpe/fast-math-emu.o $(LIBS)
  148. endif
  149. endif
  150. ifeq ($(findstring y,$(CONFIG_ARCH_CLPS7500) $(CONFIG_ARCH_L7200)),y)
  151. SUBDIRS += drivers/acorn/char
  152. DRIVERS += drivers/acorn/char/acorn-char.o
  153. endif
  154. MAKEBOOT  = $(MAKE) -C arch/$(ARCH)/boot
  155. MAKETOOLS  = $(MAKE) -C arch/$(ARCH)/tools
  156. # The following is a hack to get 'constants.h' up
  157. # to date before starting compilation
  158. $(patsubst %,_dir_%, $(SUBDIRS)): maketools
  159. $(patsubst %,_modsubdir_%,$(MOD_DIRS)): maketools
  160. symlinks: archsymlinks
  161. archsymlinks:
  162. $(RM) include/asm-arm/arch include/asm-arm/proc
  163. (cd include/asm-arm; ln -sf arch-$(INCDIR) arch; ln -sf proc-$(PROCESSOR) proc)
  164. vmlinux: arch/arm/vmlinux.lds
  165. arch/arm/vmlinux.lds: $(LDSCRIPT) dummy
  166. @sed 's/TEXTADDR/$(TEXTADDR)/;s/DATAADDR/$(DATAADDR)/' $(LDSCRIPT) >$@
  167. arch/arm/kernel arch/arm/mm arch/arm/lib: dummy
  168. $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
  169. bzImage zImage zinstall Image bootpImage install: vmlinux
  170. @$(MAKEBOOT) $@
  171. CLEAN_FILES += 
  172. arch/arm/vmlinux.lds
  173. MRPROPER_FILES += 
  174. arch/arm/tools/constants.h* 
  175. include/asm-arm/arch 
  176. include/asm-arm/proc 
  177. include/asm-arm/constants.h* 
  178. include/asm-arm/mach-types.h
  179. # We use MRPROPER_FILES and CLEAN_FILES now
  180. archmrproper:
  181. @/bin/true
  182. archclean:
  183. @$(MAKEBOOT) clean
  184. archdep: scripts/mkdep archsymlinks
  185. @$(MAKETOOLS) dep
  186. @$(MAKEBOOT) dep
  187. # we need version.h
  188. maketools: checkbin include/linux/version.h
  189. @$(MAKETOOLS) all
  190. # Ensure this is ld "2.9.4" or later
  191. NEW_LINKER := $(shell $(LD) --gc-sections --version >/dev/null 2>&1; echo $$?)
  192. ifneq ($(NEW_LINKER),0)
  193. checkbin:
  194. @echo '*** ${VERSION}.${PATCHLEVEL} kernels no longer build correctly with old versions of binutils.'
  195. @echo '*** Please upgrade your binutils to 2.9.5.'
  196. @false
  197. else
  198. checkbin:
  199. @true
  200. endif
  201. # My testing targets (that short circuit a few dependencies)
  202. zImg:; @$(MAKEBOOT) zImage
  203. Img:; @$(MAKEBOOT) Image
  204. i:; @$(MAKEBOOT) install
  205. zi:; @$(MAKEBOOT) zinstall
  206. bp:; @$(MAKEBOOT) bootpImage
  207. #
  208. # Configuration targets.  Use these to select a
  209. # configuration for your architecture
  210. %_config:
  211. @( 
  212. CFG=$(@:_config=); 
  213. if [ -f arch/arm/def-configs/$$CFG ]; then 
  214.   [ -f .config ] && mv -f .config .config.old; 
  215.   cp arch/arm/def-configs/$$CFG .config; 
  216.   echo "*** Default configuration for $$CFG installed"; 
  217.   echo "*** Next, you may run 'make oldconfig'"; 
  218. else 
  219.   echo "$$CFG does not exist"; 
  220. fi; 
  221. )