Makefile.am 3.5 KB
Newer Older
D
Daniel P. Berrange 已提交
1 2 3
## Process this file with automake to produce Makefile.in

INCLUDES = @LIBXML_CFLAGS@
4
UUID=$(shell uuidgen)
D
Daniel P. Berrange 已提交
5

6
sbin_PROGRAMS = libvirt_qemud
D
Daniel P. Berrange 已提交
7

8 9
libvirt_qemud_SOURCES = \
		qemud.c internal.h \
D
Daniel P. Berrange 已提交
10 11
                driver.c driver.h \
                dispatch.c dispatch.h \
12
                conf.c conf.h \
13
                bridge.c bridge.h \
14
                iptables.c iptables.h \
15
                uuid.c uuid.h \
16 17 18
		buf.c buf.h \
		protocol.h protocol.c \
		remote_protocol.h remote_protocol.c \
D
Daniel P. Berrange 已提交
19 20
		remote.c \
                event.c event.h
D
Daniel P. Berrange 已提交
21 22 23
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
libvirt_qemud_CFLAGS = \
        -I$(top_srcdir)/include -I$(top_builddir)/include $(LIBXML_CFLAGS) \
24
        $(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
25
        -DSYSCONF_DIR="\"$(sysconfdir)\"" \
26 27
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
28
libvirt_qemud_LDFLAGS = $(WARN_CFLAGS) $(LIBXML_LIBS) $(SYSFS_LIBS)
29 30
libvirt_qemud_DEPENDENCIES = ../src/libvirt.la
libvirt_qemud_LDADD = ../src/libvirt.la
D
Daniel P. Berrange 已提交
31

32 33 34
install-data-local:
	mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
	$(INSTALL_DATA) $(srcdir)/default-network.xml $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
35
	sed -i -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
36 37
	test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
           ln -s ../default.xml $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
D
Daniel P. Berrange 已提交
38
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu
39
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
40
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
41 42 43 44 45

uninstall-local:
	rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
	rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
	rmdir $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart || :
D
Daniel P. Berrange 已提交
46
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
47
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
48
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
49

50 51 52 53 54 55
# Distribute the generated files so that rpcgen isn't required on the
# target machine (although almost any Unix machine will have it).
EXTRA_DIST = libvirtd.in default-network.xml \
	protocol.x remote_protocol.x \
	protocol.c protocol.h \
	remote_protocol.c remote_protocol.h \
R
Richard W.M. Jones 已提交
56
	remote_generate_stubs.pl rpcgen_fix.pl \
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
	remote_dispatch_prototypes.h \
	remote_dispatch_localvars.h \
	remote_dispatch_proc_switch.h

.x.c:
	rm -f $@
	rpcgen -c -o $@ $<
	mv $@ $@.bak
	perl -w rpcgen_fix.pl < $@.bak > $@

.x.h:
	rm -f $@
	rpcgen -h -o $@ $<

protocol.c: protocol.h
remote_protocol.c: remote_protocol.h

remote.c: remote_dispatch_prototypes.h \
	  remote_dispatch_localvars.h \
	  remote_dispatch_proc_switch.h

remote_dispatch_prototypes.h: remote_generate_stubs.pl remote_protocol.x
	perl -w remote_generate_stubs.pl -i remote_protocol.x > $@

remote_dispatch_localvars.h: remote_generate_stubs.pl remote_protocol.x
	perl -w remote_generate_stubs.pl -v remote_protocol.x > $@

remote_dispatch_proc_switch.h: remote_generate_stubs.pl remote_protocol.x
	perl -w remote_generate_stubs.pl -w remote_protocol.x > $@
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

if LIBVIRT_INIT_SCRIPTS_RED_HAT
initdir = $(sysconfdir)/rc.d/init.d
init_SCRIPTS = libvirtd

libvirtd: libvirtd.in
	sed						\
	    -e s!\@localstatedir\@!@localstatedir@!	\
	    -e s!\@sbindir\@!@sbindir@!			\
	    -e s!\@sysconfdir\@!@sysconfdir@!		\
	    < $< > $@
	chmod a+x libvirtd

CLEANFILES = libvirtd
endif # DBUS_INIT_SCRIPTS_RED_HAT