-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
69 lines (50 loc) · 2.24 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ifneq ($(OS),Windows_NT)
default: help
NAME := libvirt
SPECFILE := libvirt.spec libvirt-python.spec
include Makefile.common
.PHONY: verify-sources get-sources clean-sources clean
mrproper: clean
-rm -fr rpm/* srpm/*
else
# Windows build start here
# This script uses three variables that contain Windows environment paths:
# MINGW_DIR should contain path to mingw environment (normally in chroot, prepared in Makefile.windows)
# PYTHON_DIR should contain python install path in chroot
# WIN_PATH is the search path used for configure/make, it should contain msys/mingw binaries and python directory
VERSION := $(or $(file <version),$(error Cannot determine version))
URL := https://libvirt.org/sources/$(mainturl)libvirt-$(VERSION).tar.xz
SRC_FILE := $(notdir $(URL))
get-sources: $(SRC_FILE)
UNTRUSTED_SUFF := .UNTRUSTED
ifeq ($(FETCH_CMD),)
$(error "You can not run this Makefile without having FETCH_CMD defined")
endif
$(SRC_FILE).asc:
$(FETCH_CMD) $@ $(URL).asc
$(SRC_FILE): $(SRC_FILE).asc import-keys
$(FETCH_CMD) $@$(UNTRUSTED_SUFF) $(URL)
gpgv --keyring vmm-xen-trustedkeys.gpg $< $@$(UNTRUSTED_SUFF) 2>/dev/null || \
{ echo "Wrong signature on $@$(UNTRUSTED_SUFF)!"; exit 1; }
mv $@$(UNTRUSTED_SUFF) $@
.PHONY: import-keys
import-keys:
@if [ -n "$$GNUPGHOME" ]; then rm -f "$$GNUPGHOME/core-libvirt-trustedkeys.gpg"; fi
@gpg --no-auto-check-trustdb --no-default-keyring --keyring core-libvirt-trustedkeys.gpg -q --import *-key.asc
.PHONY: verify-sources
verify-sources:
@true
# TODO: compile libvirt-python, apply patches.python
all:
tar xf $(SRC_FILE)
cd libvirt-$(VERSION) && ../apply-patches ../series-qubes.conf ../patches.qubes
if test -r libvirt-external-driver.patch; then \
patch -d libvirt-$(VERSION) -p1 < libvirt-external-driver.patch; fi
cd libvirt-$(VERSION) && autoreconf
# exported variables below should be initialized by the script that prepares windows build environment
export PATH='$(WIN_PATH)'; export MINGW_DIR='$(MINGW_DIR)'; export PYTHON_DIR='$(PYTHON_DIR)'; cd libvirt-$(VERSION) && ../win-run-configure
export PATH='$(WIN_PATH)'; cd libvirt-$(VERSION) && make -j$(NUMBER_OF_PROCESSORS)
msi:
candle -arch x64 -dversion=$(VERSION) installer.wxs
light -b libvirt-$(VERSION) -o core-libvirt.msm installer.wixobj
endif