XEN_ROOT = ../../..
include $(XEN_ROOT)/tools/vtpm_manager/Rules.mk

BIN		= vtpm_managerd

.PHONY: all
all: build

.PHONY: build
build: $(BIN)

.PHONY: install
install: build
	if [ ! -d "$(DESTDIR)/var/vtpm/fifos" ]; \
		then mkdir -p $(DESTDIR)/var/vtpm/fifos; \
	fi
	$(INSTALL_PROG) $(BIN) $(TOOLS_INSTALL_DIR)

.PHONY: clean
clean:
	rm -f *.a *.so *.o *.rpm $(DEP_FILES)

.PHONY: mrproper
mrproper: clean
	rm -f $(BIN) *~

$(BIN): $(OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@

# libraries
LIBS += ../tcs/libTCS.a ../util/libTCGUtils.a ../crypto/libtcpaCrypto.a
LIBS += -lcrypto -lpthread -lm
