1XEN_ROOT=$(CURDIR)/../../.. 2BLKTAP_ROOT := .. 3include $(XEN_ROOT)/tools/Rules.mk 4 5SUBDIRS-y := 6SUBDIRS-y += lib 7 8IBIN = vhd-util vhd-update 9INST_DIR = $(sbindir) 10 11CFLAGS += -Werror 12CFLAGS += -Wno-unused 13CFLAGS += -I../include 14CFLAGS += -D_GNU_SOURCE 15 16ifeq ($(CONFIG_X86_64),y) 17CFLAGS += -fPIC 18endif 19 20ifeq ($(VHD_STATIC),y) 21CFLAGS += -static 22endif 23 24LIBS := -Llib -lvhd 25 26all: subdirs-all build 27 28build: $(IBIN) 29 30LIBS_DEPENDS := lib/libvhd.so lib/vhd.a 31$(LIBS_DEPENDS):subdirs-all 32 33vhd-util: vhd-util.o $(LIBS_DEPENDS) 34 $(CC) $(LDFLAGS) -o vhd-util vhd-util.o $(LIBS) $(APPEND_LDFLAGS) 35 36vhd-update: vhd-update.o $(LIBS_DEPENDS) 37 $(CC) $(LDFLAGS) -o vhd-update vhd-update.o $(LIBS) $(APPEND_LDFLAGS) 38 39install: all 40 $(MAKE) subdirs-install 41 $(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR) 42 $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR) 43 44uninstall: 45 $(MAKE) subdirs-uninstall 46 rm -f $(addprefix $(DESTDIR)$(INST_DIR)/, $(IBIN)) 47 48clean: subdirs-clean 49 rm -rf *.o *~ $(DEPS_RM) $(IBIN) 50 51distclean: clean 52 53.PHONY: all build clean distclean install uninstall vhd-util vhd-update 54 55-include $(DEPS_INCLUDE) 56