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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
# config
-include Make.config
include mk/Variables.mk
# add our flags + libs
CFLAGS += -DVERSION='"$(VERSION)"' -DLIB='"$(LIB)"'
# build
TARGETS := xenlog xenscreen
BUILD_GTK := xenwatch mdns-browser
BUILD_MDNS := mdns-publish-xendom mdns-publish-vnc
BUILD_VNC := vnc-client
NEEDS_XENSTORE := xenlog xenscreen xenwatch mdns-publish-xendom mdns-publish-vnc
NEEDS_GTK := xenwatch mdns-browser vnc-client
NEEDS_MDNS := xenwatch mdns-browser mdns-publish-xendom mdns-publish-vnc
NEEDS_VNC := xenwatch mdns-browser vnc-client
# default target
all: build
#################################################################
# poor man's autoconf ;-)
include mk/Autoconf.mk
define make-config
LIB := $(LIB)
HAVE_GTK := $(call ac_pkg_config,gtk+-x11-2.0)
HAVE_AVAHI := $(call ac_pkg_config,avahi-glib)
HAVE_VNCCLIENT := $(call ac_lib,rfbGetClient,vncclient,-lz -ljpeg)
HAVE_VNC_TEXT := $(call ac_lib,TextChatSend,vncclient,-lz -ljpeg)
endef
# gtk stuff
ifeq ($(HAVE_GTK),yes)
$(NEEDS_GTK) : CFLAGS += -Wno-strict-prototypes
$(NEEDS_GTK) : pkglst += gtk+-x11-2.0
TARGETS += $(BUILD_GTK)
ifeq ($(HAVE_VNCCLIENT),yes)
TARGETS += $(BUILD_VNC)
$(NEEDS_VNC) : LDLIBS += -lvncclient -lz -ljpeg -lGL
endif
endif
# avahi stuff
ifeq ($(HAVE_AVAHI),yes)
$(NEEDS_MDNS) : pkglst += avahi-client
$(NEEDS_GTK) : pkglst += avahi-glib
TARGETS += $(BUILD_MDNS)
endif
# compile flags
CFLAGS += $(call ac_inc_cflags,AVAHI VNCCLIENT VNC_TEXT)
CFLAGS += $(shell test "$(pkglst)" != "" && pkg-config --cflags $(pkglst))
LDLIBS += $(shell test "$(pkglst)" != "" && pkg-config --libs $(pkglst))
# xenstore
ifneq ($(XENSRC),)
$(NEEDS_XENSTORE) : CFLAGS += -I $(XENSRC)/dist/install/usr/include
$(NEEDS_XENSTORE) : LDLIBS += -I $(XENSRC)/dist/install/usr/$(LIB)
endif
$(NEEDS_XENSTORE) : LDLIBS += -lxenstore
########################################################################
# rules
build: $(TARGETS) xenscreenrc
install: build
$(INSTALL_DIR) -d $(DESTDIR)/etc/xen $(bindir)
$(INSTALL_DATA) xenscreenrc $(DESTDIR)/etc/xen
$(INSTALL_BINARY) -s $(TARGETS) $(bindir)
clean:
-rm -f *.o *~ $(depfiles)
realclean distclean: clean
-rm -f Make.config
-rm -f $(TARGETS) *~ xpm/*~ *.bak
#############################################
xenlog: xenlog.o xenstore.o
xenscreen: xenscreen.o xenstore.o apps.o
xenwatch: xenwatch.o xs_view.o xs_store.o xd_view.o xd_store.o \
apps.o apps-x11.o tcp.o mdns.o vnc.o x11.o
mdns-browser: mdns-browser.o mdns.o vnc.o x11.o apps.o apps-x11.o
mdns-publish-xendom: mdns-publish-xendom.o mdns-publish.o
mdns-publish-vnc: mdns-publish-vnc.o mdns-publish.o xenstore.o
vnc-client: vnc-client.o vnc.o x11.o
xenscreenrc: xenscreen
./xenscreen -b > $@
include mk/Compile.mk
include mk/Maintainer.mk
-include $(depfiles)
|