linux-appimage.mk 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Linux Appimage - 通用 Linux 平台 Appimage 构建方案
  2. include linux-universal.mk
  3. CPUS=$(shell nproc)
  4. builddir := build/linux-appimage
  5. # sourcedir := .
  6. # CMAKE_DEBUG := -DCMAKE_BUILD_TYPE=Debug
  7. # CMAKE_RELEASE := -DCMAKE_BUILD_TYPE=Release
  8. CMAKE_OPTIONS := -DUSE_LINUX_APPIMAGE=ON $(CMAKE_OPTIONS)
  9. # -------------------------------- Appimage Build Tools -------------------------------- #
  10. # Appimage 的构建流 --
  11. # 在 Makefile 进行构建目标构建 Appimage (要求提供工具的绝对路径,然后可依次进行linuxdeployqt, genrate-appimage)
  12. # 来自于 https://github.com/probonopd/linuxdeployqt 的 linuxdeployqt
  13. # 来自于 https://github.com/AppImage/AppImageKit 的 appimagetool
  14. # 来自于 https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git 托管存储的工具
  15. # 或指定你所想存放克隆项目的位置
  16. BUNDLE_LINUXDEPLOYQT := $(shell pwd)/$(builddir)/bundle-linuxdeployqt
  17. download-bundle-linuxdeploytools:
  18. -git clone https://gitlink.org.cn/zinface/bundle-linuxdeployqt.git $(BUNDLE_LINUXDEPLOYQT)
  19. LINUXDEPLOYQT := "$(BUNDLE_LINUXDEPLOYQT)/linuxdeployqt-continuous-x86_64.AppImage"
  20. APPIMAGETOOL := "$(BUNDLE_LINUXDEPLOYQT)/appimagetool-x86_64.AppImage"
  21. # 追加 Appimagetool、linuxdeployqt 构建配置
  22. CMAKE_OPTIONS := -DLINUXDEPLOYQT=$(LINUXDEPLOYQT) -DAPPIMAGETOOL=$(APPIMAGETOOL) $(CMAKE_OPTIONS)
  23. linuxdeploy: download-bundle-linuxdeploytools
  24. cmake -B$(builddir) $(CMAKE_OPTIONS)
  25. cmake --build $(builddir) -- linuxdeploy
  26. genrate-appimage:
  27. cmake -B$(builddir) $(CMAKE_OPTIONS)
  28. cmake --build $(builddir) -- appimage
  29. package: linux-universal-release linuxdeploy genrate-appimage
  30. linux-build-options:
  31. @echo $(CMAKE_OPTIONS)
  32. # 此配置为构建 linux Appimage 通用版本构建