Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # Copyright (C) 2008-2011 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/image.mk
  9. KERNEL_LOADADDR = 0x80060000
  10. DEVICE_VARS += BOARDNAME CMDLINE CONSOLE IMAGE_SIZE LOADER_TYPE
  11. ifeq ($(SUBTARGET),generic)
  12. include ./generic.mk
  13. include ./generic-legacy-devices.mk
  14. include ./generic-tp-link.mk
  15. include ./generic-ubnt.mk
  16. endif
  17. ifeq ($(SUBTARGET),tiny)
  18. include ./tiny.mk
  19. include ./tiny-tp-link.mk
  20. include ./tiny-legacy-devices.mk
  21. include ./tiny-senao.mk
  22. endif
  23. ifeq ($(SUBTARGET),nand)
  24. include ./nand.mk
  25. endif
  26. ifeq ($(SUBTARGET),mikrotik)
  27. include ./mikrotik.mk
  28. endif
  29. include ./legacy.mk
  30. define Build/loader-common
  31. rm -rf $@.src
  32. $(MAKE) -C lzma-loader \
  33. PKG_BUILD_DIR="$@.src" \
  34. TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
  35. BOARD="$(BOARDNAME)" \
  36. LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
  37. $(1) compile loader.$(LOADER_TYPE)
  38. mv "$@.$(LOADER_TYPE)" "$@"
  39. rm -rf $@.src
  40. endef
  41. define Build/loader-kernel
  42. $(call Build/loader-common,LOADER_DATA="$@")
  43. endef
  44. define Build/loader-kernel-cmdline
  45. $(call Build/loader-common,LOADER_DATA="$@" KERNEL_CMDLINE="$(CMDLINE)")
  46. endef
  47. define Device/Default
  48. BOARDNAME :=
  49. DEVICE_PROFILE = $$(BOARDNAME)
  50. PROFILES = Default Minimal $$(DEVICE_PROFILE)
  51. MTDPARTS :=
  52. BLOCKSIZE := 64k
  53. CONSOLE := ttyS0,115200
  54. CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE))
  55. KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
  56. COMPILE :=
  57. IMAGES := sysupgrade.bin
  58. IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  59. endef
  60. $(eval $(call BuildImage))