summaryrefslogtreecommitdiff
path: root/Makefile
blob: 0f3586e557f992abb2482087fd86f4fafc70fe4e (plain)
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
VERSION = 0.6.3

DESTDIR	?= 
sbindir	?= /usr/sbin
bindir	?= /usr/bin
initdir	?= /etc/rc.d/init.d
xdgautostartdir ?= /etc/xdg/autostart
gdmautostartdir ?= /usr/share/gdm/autostart/LoginWindow
socketdir ?= /var/run/spice-vdagentd

CFLAGS	 ?= -O2 -g -Wall
CPPFLAGS  = $(shell pkg-config --cflags spice-protocol)
CPPFLAGS += $(shell pkg-config --cflags dbus-1)
CPPFLAGS += -D_GNU_SOURCE

TARGETS	:= spice-vdagentd spice-vdagent

build: $(TARGETS)

install: build
	install -d $(DESTDIR)$(bindir)
	install -d $(DESTDIR)$(sbindir)
	install -d $(DESTDIR)$(socketdir)
	install -p -m 755 spice-vdagent $(DESTDIR)$(bindir)
	install -p -m 755 spice-vdagentd $(DESTDIR)$(sbindir)
	install -d $(DESTDIR)$(initdir)
	install -p -m 755 spice-vdagentd.sh $(DESTDIR)$(initdir)/spice-vdagentd
	install -d $(DESTDIR)$(xdgautostartdir)
	install -d $(DESTDIR)$(gdmautostartdir)
	desktop-file-install --dir=$(DESTDIR)$(xdgautostartdir) \
		spice-vdagent.desktop
	desktop-file-install --dir=$(DESTDIR)$(gdmautostartdir) \
		spice-vdagent.desktop

clean:
	rm -f $(TARGETS) *.o *~

spice-vdagentd: vdagentd.o vdagentd-uinput.o udscs.o vdagent-virtio-port.o console-kit.o
	$(CC) -o $@ $^ $(shell pkg-config --libs dbus-1)

spice-vdagent: vdagent.o vdagent-x11.o udscs.o
	$(CC) -o $@ $^ -lX11 -lXrandr -lXfixes

tag:
	@git tag -a -m "Tag as spice-vdagent-$(VERSION)" spice-vdagent-$(VERSION)
	@echo "Tagged as spice-vdagent-$(VERSION)"

archive-no-tag:
	@git archive --format=tar --prefix=spice-vdagent-$(VERSION)/ spice-vdagent-$(VERSION) > spice-vdagent-$(VERSION).tar
	@bzip2 -f spice-vdagent-$(VERSION).tar

archive: clean tag archive-no-tag