Makefile
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:7k
源码类别:

嵌入式Linux

开发平台:

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