Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. # Copyright (C) 2019 Robert Call <bob@bobcall.me>
  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)/kernel.mk
  9. include $(INCLUDE_DIR)/version.mk
  10. override MAKEFLAGS=
  11. CCS_NAME:=$(VERSION_DIST_SANITIZED)-$(VERSION_NUMBER)-src
  12. CCS_BUILD_DIR:=$(BUILD_DIR)/$(CCS_NAME)
  13. ISO_BUILD_DIR:=$(CCS_BUILD_DIR)/iso
  14. all: install
  15. $(BIN_DIR)/$(CCS_NAME).tar.gz:
  16. mkdir -p $(BIN_DIR)
  17. mkdir -p $(CCS_BUILD_DIR)
  18. $(if $(CONFIG_CCS_GIT_TOPDIR),(cd $(CCS_BUILD_DIR); git clone $(TOPDIR) librecmc),(cd $(CCS_BUILD_DIR); git clone $(CONFIG_CCS_GIT_UPSTREAM) librecmc))
  19. $(CP) $(TOPDIR)/.config $(CCS_BUILD_DIR)/librecmc
  20. $(CP) -r $(TOPDIR)/dl $(CCS_BUILD_DIR)/librecmc/
  21. createiso:
  22. mkdir -p $(ISO_BUILD_DIR)/bin/$(BOARD)
  23. (cd $(CCS_BUILD_DIR); $(TAR) -czf $(ISO_BUILD_DIR)/$(CCS_NAME).tar.gz librecmc)
  24. $(CP) ./files/README $(ISO_BUILD_DIR)
  25. $(CP) $(BIN_DIR) $(ISO_BUILD_DIR)/bin/$(BOARD)
  26. $(VERSION_SED_SCRIPT) $(ISO_BUILD_DIR)/README
  27. genisoimage -J -joliet-long -r -o $(BIN_DIR)/$(CCS_NAME).iso $(ISO_BUILD_DIR)
  28. download:
  29. compile:
  30. install: clean $(BIN_DIR)/$(CCS_NAME).tar.gz createiso
  31. clean:
  32. rm -rf $(CCS_BUILD_DIR) $(BIN_DIR)/$(CCS_NAME).tar.gz $(BIN_DIR)/$(CCS_NAME)-src.iso