Makefile 844 B

12345678910111213141516171819202122232425262728293031323334
  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/gzip
  20. gzip -f9n $(BIN_DIR)/$(IMG_ROOTFS)-$(1).img
  21. endef
  22. $(eval $(call Image/gzip-ext4-padded-squashfs))
  23. define Image/Build
  24. $(call Image/Build/$(1))
  25. $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_ROOTFS)-$(1).img
  26. $(call Image/Build/gzip/$(1))
  27. endef
  28. $(eval $(call BuildImage))