Makefile 726 B

12345678910111213141516171819202122232425262728
  1. #
  2. # Copyright (C) 2016-2017 Yousong Zhou <[email protected]>
  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 Image/BuildKernel
  10. $(foreach k,$(filter zImage Image,$(KERNELNAME)), \
  11. cp $(KDIR)/$(KERNELNAME) $(BIN_DIR)/$(IMG_PREFIX)-$(k) \
  12. )
  13. endef
  14. define Image/Build/Initramfs
  15. $(foreach k,$(filter zImage Image,$(KERNELNAME)), \
  16. cp $(KDIR)/$(k)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(k)-initramfs \
  17. )
  18. endef
  19. define Image/Build
  20. $(call Image/Build/$(1))
  21. dd if=$(KDIR)/root.$(1) bs=128k conv=sync | \
  22. gzip -9n >$(BIN_DIR)/$(IMG_PREFIX)-root.$(1).gz
  23. endef
  24. $(eval $(call BuildImage))