Makefile 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. RPMS_DIR=rpm/
  2. VERSION := $(shell cat version)
  3. DIST_DOM0 ?= fc18
  4. OS ?= Linux
  5. PYTHON ?= python3
  6. ifeq ($(OS),Linux)
  7. DATADIR ?= /var/lib/qubes
  8. STATEDIR ?= /var/run/qubes
  9. LOGDIR ?= /var/log/qubes
  10. FILESDIR ?= /usr/share/qubes
  11. else ifeq ($(OS),Windows_NT)
  12. DATADIR ?= c:/qubes
  13. STATEDIR ?= c:/qubes/state
  14. LOGDIR ?= c:/qubes/log
  15. FILESDIR ?= c:/program files/Invisible Things Lab/Qubes
  16. endif
  17. help:
  18. @echo "make rpms -- generate binary rpm packages"
  19. @echo "make rpms-dom0 -- generate binary rpm packages for Dom0"
  20. @echo "make update-repo-current -- copy newly generated rpms to qubes yum repo"
  21. @echo "make update-repo-current-testing -- same, but to -current-testing repo"
  22. @echo "make update-repo-unstable -- same, but to -testing repo"
  23. @echo "make update-repo-installer -- copy dom0 rpms to installer repo"
  24. @echo "make clean -- cleanup"
  25. rpms: rpms-dom0
  26. rpms-vm:
  27. @true
  28. rpms-dom0:
  29. rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-dom0.spec
  30. rpmbuild --define "_rpmdir $(RPMS_DIR)" -bb rpm_spec/core-dom0-doc.spec
  31. rpm --addsign \
  32. $(RPMS_DIR)/x86_64/qubes-core-dom0-$(VERSION)*.rpm \
  33. $(RPMS_DIR)/noarch/qubes-core-dom0-doc-$(VERSION)*rpm
  34. clean:
  35. make -C dispvm clean
  36. all:
  37. $(PYTHON) setup.py build
  38. # make all -C tests
  39. # Currently supported only on xen
  40. ifeq ($(BACKEND_VMM),xen)
  41. make all -C dispvm
  42. endif
  43. install:
  44. ifeq ($(OS),Linux)
  45. $(MAKE) install -C linux/systemd
  46. $(MAKE) install -C linux/aux-tools
  47. $(MAKE) install -C linux/system-config
  48. endif
  49. $(PYTHON) setup.py install -O1 --skip-build --root $(DESTDIR)
  50. ln -s qvm-device $(DESTDIR)/usr/bin/qvm-pci
  51. ln -s qvm-device $(DESTDIR)/usr/bin/qvm-usb
  52. # $(MAKE) install -C tests
  53. $(MAKE) install -C relaxng
  54. mkdir -p $(DESTDIR)/etc/qubes
  55. ifeq ($(BACKEND_VMM),xen)
  56. # Currently supported only on xen
  57. cp etc/qmemman.conf $(DESTDIR)/etc/qubes/
  58. endif
  59. $(MAKE) install -C dispvm
  60. mkdir -p $(DESTDIR)/etc/qubes-rpc/policy
  61. mkdir -p $(DESTDIR)/usr/libexec/qubes
  62. cp qubes-rpc-policy/qubes.FeaturesRequest.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.FeaturesRequest
  63. cp qubes-rpc-policy/qubes.Filecopy.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.Filecopy
  64. cp qubes-rpc-policy/qubes.OpenInVM.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.OpenInVM
  65. cp qubes-rpc-policy/qubes.OpenURL.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.OpenURL
  66. cp qubes-rpc-policy/qubes.VMShell.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.VMShell
  67. cp qubes-rpc-policy/qubes.NotifyUpdates.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.NotifyUpdates
  68. cp qubes-rpc-policy/qubes.NotifyTools.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.NotifyTools
  69. cp qubes-rpc-policy/qubes.GetImageRGBA.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.GetImageRGBA
  70. cp qubes-rpc-policy/qubes.GetRandomizedTime.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.GetRandomizedTime
  71. cp qubes-rpc-policy/qubes.NotifyTools.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.NotifyTools
  72. cp qubes-rpc-policy/qubes.NotifyUpdates.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.NotifyUpdates
  73. cp qubes-rpc-policy/qubes.OpenInVM.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.OpenInVM
  74. cp qubes-rpc-policy/qubes.VMShell.policy $(DESTDIR)/etc/qubes-rpc/policy/qubes.VMShell
  75. cp qubes-rpc/qubes.FeaturesRequest $(DESTDIR)/etc/qubes-rpc/
  76. cp qubes-rpc/qubes.GetRandomizedTime $(DESTDIR)/etc/qubes-rpc/
  77. cp qubes-rpc/qubes.NotifyTools $(DESTDIR)/etc/qubes-rpc/
  78. cp qubes-rpc/qubes.NotifyUpdates $(DESTDIR)/etc/qubes-rpc/
  79. cp qubes-rpc/qubes-notify-updates $(DESTDIR)/usr/libexec/qubes/
  80. cp qubes-rpc/qubes-notify-tools $(DESTDIR)/usr/libexec/qubes/
  81. mkdir -p "$(DESTDIR)$(FILESDIR)"
  82. cp -r templates "$(DESTDIR)$(FILESDIR)/templates"
  83. rm -f "$(DESTDIR)$(FILESDIR)/templates/README"
  84. mkdir -p $(DESTDIR)$(DATADIR)
  85. mkdir -p $(DESTDIR)$(DATADIR)/vm-templates
  86. mkdir -p $(DESTDIR)$(DATADIR)/appvms
  87. mkdir -p $(DESTDIR)$(DATADIR)/servicevms
  88. mkdir -p $(DESTDIR)$(DATADIR)/vm-kernels
  89. mkdir -p $(DESTDIR)$(DATADIR)/backup
  90. mkdir -p $(DESTDIR)$(DATADIR)/dvmdata
  91. mkdir -p $(DESTDIR)$(STATEDIR)
  92. mkdir -p $(DESTDIR)$(LOGDIR)
  93. msi:
  94. rm -rf destinstdir
  95. mkdir -p destinstdir
  96. $(MAKE) install \
  97. DESTDIR=$(PWD)/destinstdir \
  98. PYTHON_SITEPATH=/site-packages \
  99. FILESDIR=/pfiles \
  100. BINDIR=/bin \
  101. DATADIR=/qubes \
  102. STATEDIR=/qubes/state \
  103. LOGDIR=/qubes/log
  104. # icons placeholder
  105. mkdir -p destinstdir/icons
  106. for i in blue gray green yellow orange black purple red; do touch destinstdir/icons/$$i.png; done
  107. candle -arch x64 -dversion=$(VERSION) installer.wxs
  108. light -b destinstdir -o core-admin.msm installer.wixobj
  109. rm -rf destinstdir