Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15530487
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: 嵌入式

2011-01-22 17:09:14

在vendor/xxxxx/AndroidBoard.mk中追加如下一行
include $(LOCAL_PATH)/kernel.mk
然后将kernel.mk脚本放到该xxxxx目录下 kernel.mk.rar 
  1. ifneq ($(TARGET_NO_KERNEL),true)

  2. BOARD_KERNEL_BASE ?= 0x0
  3. KERNEL_PATH ?= kernel
  4. KERNEL_CPU ?= at91rm9200dk
  5. KERNEL_CONFIG ?= $(KERNEL_CPU)_defconfig
  6. KERNEL_OUTPUT ?= $(shell pwd)/$(TARGET_OUT_INTERMEDIATES)/KERNEL#$(KERNEL_PATH)#$(HOME)/xxxxluther.gliethttpxxxxx

  7. TARGET_OUT_INTERMEDIATES ?= out/target/luther.gliethttp.product/obj
  8. HOST_PREBUILT_TAG ?= linux-x86
  9. ifeq ($(strip $(CROSS_COMPILE)),)
  10. KERNEL_CROSS_COMPILE_PATH = $(shell pwd)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin/
  11. KERNEL_CROSS_COMPILE := arm-eabi-
  12. else
  13. KERNEL_CROSS_COMPILE_PATH = ./
  14. KERNEL_CROSS_COMPILE := $(CROSS_COMPILE)
  15. endif
  16. MAKE_JOBS ?= 8
  17. TARGET_ARCH ?= arm

  18. KERNEL_DOTCONFIG_DEP = $(KERNEL_PATH)/arch/$(TARGET_ARCH)/configs/$(KERNEL_CONFIG)
  19. KERNEL_DOTCONFIG = $(KERNEL_OUTPUT)/.config
  20. TARGET_PREBUILT_KERNEL = $(KERNEL_OUTPUT)/arch/$(TARGET_ARCH)/boot/Image

  21. ifeq (,$(shell [ -f $(KERNEL_PATH)/init/main.c ] && echo 'y'))
  22. define kernel-make
  23. echo >/dev/null 2>&1
  24. endef
  25. else
  26. #$(shell rm -f $(TARGET_PREBUILT_KERNEL) 2>&1 >/dev/null)
  27. ifneq ($(KERNEL_OUTPUT),$(KERNEL_PATH))
  28. define kernel-make
  29. export PATH=$(KERNEL_CROSS_COMPILE_PATH):${PATH}; \
  30. $(MAKE) -j$(MAKE_JOBS) -C $(KERNEL_PATH) \
  31.     ARCH=$(TARGET_ARCH) \
  32.     CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) \
  33.     O=$(KERNEL_OUTPUT) \
  34.     $(if $(SHOW_COMMANDS),V=1)
  35. endef
  36. else
  37. define kernel-make
  38. export PATH=$(KERNEL_CROSS_COMPILE_PATH):${PATH}; \
  39. $(MAKE) -j$(MAKE_JOBS) -C $(KERNEL_PATH) \
  40.     ARCH=$(TARGET_ARCH) \
  41.     CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) \
  42.     $(if $(SHOW_COMMANDS),V=1)
  43. endef
  44. endif
  45. endif

  46. $(TARGET_PREBUILT_KERNEL): KERNEL_EXIST $(KERNEL_DOTCONFIG)
  47.     $(hide) $(kernel-make) zImage modules

  48. $(KERNEL_DOTCONFIG): $(KERNEL_DOTCONFIG_DEP)
  49.     @mkdir -p $(KERNEL_OUTPUT)
  50.     @if [ ! -f $(KERNEL_OUTPUT)/.config ]; then \
  51.         echo "creating kernel config -- $(KERNEL_CONFIG)"; \
  52.         $(kernel-make) $(KERNEL_CONFIG); \
  53.     else \
  54.         echo ".config is ready"; \
  55.     fi

  56. KERNEL_EXIST:
  57.     @if [ "$(KERNEL_PATH)" != "$(KERNEL_OUTPUT)" ] && \
  58.         [ -f $(KERNEL_PATH)/.config -o -d $(KERNEL_PATH)/include/config ]; then \
  59.         echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; \
  60.         echo; \
  61.         echo "Force clean $(shell pwd)/$(KERNEL_PATH)"; \
  62.         echo; \
  63.         echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; \
  64.         cd $(KERNEL_PATH); $(MAKE) -j$(MAKE_JOBS) mrproper; cd - 2>&1 >/dev/null; \
  65.     fi

  66. $(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
  67.     # $(transform-prebuilt-to-target)
  68.     $(copy-file-to-target)

  69. kernel: $(INSTALLED_KERNEL_TARGET)

  70. #ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET)

  71. endif

阅读(5123) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~