Makefile: create dir for vdagentd socket
[vd_agent/hramrach.git] / Makefile
blob5a678906e876a793955fc0447afdbc4ba9c7113b
1 VERSION = 0.6.3
3 DESTDIR ?=
4 sbindir ?= /sbin
5 bindir ?= /usr/bin
6 initdir ?= /etc/rc.d/init.d
7 xdgautostartdir ?= /etc/xdg/autostart
8 gdmautostartdir ?= /usr/share/gdm/autostart/LoginWindow
9 socketdir ?= /var/run/spice-vdagentd
11 CFLAGS ?= -O2 -g -Wall
12 CPPFLAGS = $(shell pkg-config --cflags spice-protocol)
13 CPPFLAGS += $(shell pkg-config --cflags dbus-1)
14 CPPFLAGS += -D_GNU_SOURCE
16 TARGETS := spice-vdagentd spice-vdagent
18 build: $(TARGETS)
20 install: build
21 install -d $(DESTDIR)$(bindir)
22 install -d $(DESTDIR)$(sbindir)
23 install -d $(DESTDIR)$(socketdir)
24 install -p -m 755 spice-vdagent $(DESTDIR)$(bindir)
25 install -p -m 755 spice-vdagentd $(DESTDIR)$(sbindir)
26 install -d $(DESTDIR)$(initdir)
27 install -p -m 755 spice-vdagentd.sh $(DESTDIR)$(initdir)/spice-vdagentd
28 install -d $(DESTDIR)$(xdgautostartdir)
29 install -d $(DESTDIR)$(gdmautostartdir)
30 desktop-file-install --dir=$(DESTDIR)$(xdgautostartdir) \
31 spice-vdagent.desktop
32 desktop-file-install --dir=$(DESTDIR)$(gdmautostartdir) \
33 spice-vdagent.desktop
35 clean:
36 rm -f $(TARGETS) *.o *~
38 spice-vdagentd: vdagentd.o vdagentd-uinput.o udscs.o vdagent-virtio-port.o console-kit.o
39 $(CC) -o $@ $^ $(shell pkg-config --libs dbus-1)
41 spice-vdagent: vdagent.o vdagent-x11.o udscs.o
42 $(CC) -o $@ $^ -lX11 -lXrandr -lXfixes
44 tag:
45 @git tag -a -m "Tag as spice-vdagent-$(VERSION)" spice-vdagent-$(VERSION)
46 @echo "Tagged as spice-vdagent-$(VERSION)"
48 archive-no-tag:
49 @git archive --format=tar --prefix=spice-vdagent-$(VERSION)/ spice-vdagent-$(VERSION) > spice-vdagent-$(VERSION).tar
50 @bzip2 -f spice-vdagent-$(VERSION).tar
52 archive: clean tag archive-no-tag