Makefile 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. # Copyright (C) 2010 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. PKG_NAME := loader
  9. PKG_VERSION := 0.05
  10. PKG_BUILD_DIR := $(KDIR)/$(PKG_NAME)-$(PKG_VERSION)$(LOADER_TYPE)
  11. $(PKG_BUILD_DIR)/.prepared:
  12. mkdir $(PKG_BUILD_DIR)
  13. $(CP) ./src/* $(PKG_BUILD_DIR)/
  14. touch $@
  15. $(PKG_BUILD_DIR)/lzma.elf: $(PKG_BUILD_DIR)/.prepared $(PKG_BUILD_DIR)/vmlinux.lzma
  16. PATH="$(TARGET_PATH)" $(MAKE) -C $(PKG_BUILD_DIR) \
  17. CC="$(TARGET_CC)" CROSS_COMPILE="$(TARGET_CROSS)"
  18. $(PKG_BUILD_DIR)/vmlinux.lzma: $(KDIR)/vmlinux.lzma
  19. $(CP) $< $@
  20. $(KDIR)/loader$(LOADER_TYPE).elf: $(PKG_BUILD_DIR)/lzma.elf
  21. $(CP) $< $@
  22. $(KDIR)/loader$(LOADER_TYPE).bin: $(PKG_BUILD_DIR)/lzma.bin
  23. $(CP) $< $@
  24. download:
  25. prepare: $(PKG_BUILD_DIR)/.prepared
  26. compile: $(KDIR)/loader$(LOADER_TYPE).elf $(KDIR)/loader$(LOADER_TYPE).bin
  27. install:
  28. clean:
  29. rm -rf $(PKG_BUILD_DIR)
  30. rm -f $(KDIR)/loader.elf
  31. rm -f $(KDIR)/loader.bin