# Makefile shared with stubdom

XENSTORED_OBJS-y := core.o watch.o domain.o
XENSTORED_OBJS-y += transaction.o control.o lu.o
XENSTORED_OBJS-y += talloc.o utils.o hashtable.o

XENSTORED_OBJS-$(CONFIG_Linux) += posix.o lu_daemon.o
XENSTORED_OBJS-$(CONFIG_NetBSD) += posix.o lu_daemon.o
XENSTORED_OBJS-$(CONFIG_FreeBSD) += posix.o lu_daemon.o
XENSTORED_OBJS-$(CONFIG_MiniOS) += minios.o lu_minios.o

# Include configure output (config.h)
CFLAGS += -include $(XEN_ROOT)/tools/config.h
CFLAGS += $(CFLAGS_libxenevtchn)
CFLAGS += $(CFLAGS_libxenctrl)
CFLAGS += $(CFLAGS_libxenguest)
CFLAGS += $(CFLAGS_libxentoolcore)

ifdef CONFIG_STUBDOM
CFLAGS += -DNO_SOCKETS=1
endif

$(XENSTORED_OBJS-y): CFLAGS += $(CFLAGS_libxengnttab)

xenstored.a: $(XENSTORED_OBJS-y)
	$(AR) cr $@ $^

clean::
	$(RM) *.a *.o
