Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. include $(INCLUDE_DIR)/image.mk
  9. define Build/Clean
  10. $(MAKE) -C dfboot clean
  11. $(MAKE) -C u-boot clean
  12. endef
  13. define Build/Compile
  14. $(MAKE) -C dfboot compile
  15. $(MAKE) -C u-boot compile
  16. $(KDIR)/u-boot-1.1.4/tools/ubparams
  17. cp params $(KDIR)
  18. endef
  19. define Image/Prepare
  20. cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage
  21. cp $(KDIR)/dfboot/dfboot.bin $(KDIR)/dfboot.bin
  22. cp $(KDIR)/dfboot/dfbptest.bin $(KDIR)/dfbptest.bin
  23. cp $(KDIR)/u-boot-1.1.4/u-boot.bin $(KDIR)/u-boot.bin
  24. dd if=$(KDIR)/u-boot.bin of=$(KDIR)/u-boot.block bs=100k count=1 conv=sync
  25. cat $(KDIR)/u-boot.block $(KDIR)/params > $(KDIR)/u-boot.full
  26. endef
  27. define Image/BuildKernel
  28. cp $(KDIR)/uImage $(BIN_DIR)/openwrt-$(BOARD)-uImage
  29. endef
  30. define Image/Build
  31. dd if=$(KDIR)/uImage of=$(KDIR)/uImage.block bs=8448 conv=sync
  32. dd if=$(KDIR)/root.squashfs of=$(KDIR)/root.block bs=8448 conv=sync
  33. cat $(KDIR)/uImage.block $(KDIR)/root.block > $(KDIR)/knlroot.bin
  34. $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD).trx -f $(KDIR)/dfboot.bin -f$(KDIR)/u-boot.full -f$(KDIR)/knlroot.bin
  35. cp $(KDIR)/dfbptest.bin $(BIN_DIR)
  36. $(call Image/Build/$(1),$(1))
  37. endef
  38. $(eval $(call BuildImage))