# config -include Make.config include mk/Variables.mk # add our flags + libs CFLAGS += -DVERSION='"$(VERSION)"' -DLIB='"$(LIB)"' # build TARGETS := xenlog xenscreen xenscreenrc BUILD_GTK := xenwatch mdns-browser BUILD_MDNS := mdns-publish-xendom NEEDS_XENSTORE := xenlog xenscreen xenwatch mdns-publish-xendom NEEDS_GTK := xenwatch mdns-browser NEEDS_MDNS := xenwatch mdns-browser mdns-publish-xendom # 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) endef # gtk stuff ifeq ($(HAVE_GTK),yes) $(NEEDS_GTK) : CFLAGS += -Wno-strict-prototypes $(NEEDS_GTK) : pkglst += gtk+-x11-2.0 TARGETS += $(BUILD_GTK) endif # avahi stuff ifeq ($(HAVE_AVAHI),yes) $(NEEDS_MDNS) : CFLAGS += -DHAVE_AVAHI=1 $(NEEDS_MDNS) : pkglst += avahi-client $(NEEDS_GTK) : pkglst += avahi-glib TARGETS += $(BUILD_MDNS) endif # pkg-config flags 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) 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 mdns-browser: mdns-browser.o mdns.o apps.o apps-x11.o mdns-publish-xendom: mdns-publish-xendom.o xenscreenrc: xenscreen ./xenscreen -b > $@ include mk/Compile.mk include mk/Maintainer.mk -include $(depfiles)