kernel.mk 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ##make -f kernel.mk TARGET=g02 INSTALL_ROOT=../xxxx/root/
  2. TOP=$(PWD)
  3. TARGET_OUT_TOP?= $(ANDROID_PRODUCT_OUT)
  4. INSTALL_ROOT ?= $(TARGET_OUT_TOP)/root/
  5. RECOVERY_ROOT?= $(shell echo $(INSTALL_ROOT) | sed 's?ref/root/?ref/recovery/root/?g')
  6. IMAGE_ROOT?= $(TARGET_OUT_TOP)
  7. #TARGET?=$(TARGET_PRODUCT:%ref=%)
  8. TARGET?=$(TARGET_PRODUCT:%ref=%)
  9. MOD_DIR=$(TOP)/.out/modules
  10. default:all
  11. MMAKE?=make -j 7
  12. .PHONE:=preconfig
  13. preconfig:
  14. # make meson_ref$(TARGET)_defconfig
  15. make meson6_$(TARGET)_defconfig
  16. .config_orig:preconfig
  17. cp .config .config_orig
  18. config_uImage:.config_orig
  19. echo root=$(INSTALL_ROOT)
  20. sed 's?CONFIG_INITRAMFS_SOURCE=".*"?CONFIG_INITRAMFS_SOURCE=\"$(INSTALL_ROOT)\"?g' $< > $<.tmp
  21. cp -f $<.tmp $@
  22. config_uImage_recovery:.config_orig
  23. echo root=$(RECOVERY_ROOT)
  24. sed 's?CONFIG_INITRAMFS_SOURCE=".*"?CONFIG_INITRAMFS_SOURCE=\"$(RECOVERY_ROOT)\"?g' $< > $<.tmp
  25. cp -f $<.tmp $@
  26. # CONFIG_INITRAMFS_SOURCE="../out/target/product/f02ref/root/"
  27. pmodules:config_uImage
  28. cp -f config_uImage .config
  29. mkdir -p $(MOD_DIR)
  30. $(MMAKE) modules MOD_INS_DIR=$(MOD_DIR)
  31. cp -f $(MOD_DIR)/mali.ko $(RECOVERY_ROOT)/boot/
  32. cp -f $(MOD_DIR)/ump.ko $(RECOVERY_ROOT)/boot/
  33. puImage:config_uImage
  34. cp -f config_uImage .config
  35. $(MMAKE) uImage
  36. cp arch/arm/boot/uImage uImage
  37. puImage_recovery:config_uImage_recovery
  38. cp -f config_uImage_recovery .config
  39. $(MMAKE) uImage
  40. cp arch/arm/boot/uImage uImage_recovery
  41. modules:config_uImage pmodules
  42. uImage:config_uImage puImage
  43. uImage_recovery:modules config_uImage_recovery puImage_recovery
  44. stepbuild:preconfig config_uImage puImage pmodules puImage config_uImage_recovery puImage_recovery
  45. all:stepbuild
  46. install:all
  47. cp -f uImage $(IMAGE_ROOT)/
  48. cp -f uImage_recovery $(IMAGE_ROOT)/
  49. cp -f $(MOD_DIR)/*.ko $(IMAGE_ROOT)/system/lib/