Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # Copyright (C) 2006 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. LOADER := loader.bin
  9. LOADER_NAME := $(basename $(notdir $(LOADER)))
  10. LOADER_DATA :=
  11. TARGET_DIR :=
  12. ifeq ($(TARGET_DIR),)
  13. TARGET_DIR := $(KDIR)
  14. endif
  15. LOADER_BIN := $(TARGET_DIR)/$(LOADER_NAME).bin
  16. LOADER_GZ := $(TARGET_DIR)/$(LOADER_NAME).gz
  17. LOADER_ELF := $(TARGET_DIR)/$(LOADER_NAME).elf
  18. LZMA_STARTUP_ORG:= 0
  19. LZMA_TEXT_START := 0x80300000
  20. PKG_NAME := lzma-loader
  21. PKG_BUILD_DIR := $(KDIR)/$(PKG_NAME)
  22. .PHONY : loader-compile loader.bin loader.elf loader.gz
  23. $(PKG_BUILD_DIR)/.prepared:
  24. mkdir $(PKG_BUILD_DIR)
  25. $(CP) ./src/* $(PKG_BUILD_DIR)/
  26. touch $@
  27. loader-compile: $(PKG_BUILD_DIR)/.prepared
  28. $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE="$(TARGET_CROSS)" \
  29. LZMA_STARTUP_ORG=$(LZMA_STARTUP_ORG) \
  30. LZMA_TEXT_START=$(LZMA_TEXT_START) \
  31. LOADER_DATA=$(LOADER_DATA) \
  32. CONFIG_BOARD=$(CONFIG_BOARD) \
  33. CONFIG_PASS_KARGS=$(CONFIG_PASS_KARGS) \
  34. clean all
  35. loader.gz: $(PKG_BUILD_DIR)/loader.bin
  36. gzip -nc9 $< > $(LOADER_GZ)
  37. loader.elf: $(PKG_BUILD_DIR)/loader.elf
  38. $(CP) $< $(LOADER_ELF)
  39. loader.bin: $(PKG_BUILD_DIR)/loader.bin
  40. $(CP) $< $(LOADER_BIN)
  41. download:
  42. prepare: $(PKG_BUILD_DIR)/.prepared
  43. compile: loader-compile
  44. install:
  45. clean:
  46. rm -rf $(PKG_BUILD_DIR)