Keep timestamps when installing files
[vd_agent.git] / Makefile
blob31cd768c470474b9adc263447de873728d001ac5
2 DESTDIR ?=
3 sbindir ?= /sbin
4 udevdir ?= /lib/udev/rules.d
5 xdgautostartdir ?= /etc/xdg/autostart
6 gdmautostartdir ?= /usr/share/gdm/autostart/LoginWindow
8 CFLAGS ?= -O2 -g -Wall
9 CPPFLAGS = $(shell pkg-config --cflags spice-protocol)
10 CPPFLAGS += $(shell pkg-config --cflags dbus-1)
11 CPPFLAGS += -D_GNU_SOURCE
13 TARGETS := spice-vdagentd spice-vdagent
15 build: $(TARGETS)
17 install: build
18 install -d $(DESTDIR)$(sbindir)
19 install -p -m 755 $(TARGETS) $(DESTDIR)$(sbindir)
20 install -d $(DESTDIR)$(udevdir)
21 install -p -m 644 *.rules $(DESTDIR)$(udevdir)
22 install -d $(DESTDIR)$(xdgautostartdir)
23 install -d $(DESTDIR)$(gdmautostartdir)
24 desktop-file-install --dir=$(DESTDIR)$(xdgautostartdir) \
25 spice-vdagent.desktop
26 desktop-file-install --dir=$(DESTDIR)$(gdmautostartdir) \
27 spice-vdagent.desktop
29 clean:
30 rm -f $(TARGETS) *.o *~
32 spice-vdagentd: vdagentd.o vdagentd-uinput.o udscs.o vdagent-virtio-port.o console-kit.o
33 $(CC) -o $@ $^ $(shell pkg-config --libs dbus-1)
35 spice-vdagent: vdagent.o vdagent-x11.o udscs.o
36 $(CC) -o $@ $^ -lX11 -lXrandr -lXfixes