Update the rules for Make clean and distclean.
Update make not to clone the repositories if they are already
cloned, simply pull, checkout the tags and build.
Changes in this patch:
1. QEMU is built just once in .../src directory.
.../src_vanilla and .../src_cuse don't contain qemu anymore
2. 'make clean' deletes all built *.o files
3. 'make distclean' deletes all built and generated files
(distclean is used instead of cleanse now)
4. 'make' calls 'git pull' when repository is cloned already
JIRA: VSPERF-94
Change-Id: I80f9a135580b450fb4606cf947661049ff509548
Signed-off-by: Radek Zetik <radekx.zetik@intel.com>
Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com>
Reviewed-by: Gene Snider <eugene.snider@huawei.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
SUBBUILDS = src_cuse src_vanilla
.PHONY: vhost subbuilds $(SUBBUILDS)
-all: vhost subbuilds
+all clean distclean: vhost subbuilds
subbuilds: $(SUBBUILDS)
$(SUBBUILDS): vhost
$(AT)cp -rf mk/* ../$@/mk
$(AT)cp -rf package-list.mk ../$@/
$(AT)cp Makefile.$@ ../$@/Makefile
- $(AT)$(MAKE) -C ../$@
+ $(AT)$(MAKE) -C ../$@ $(MAKECMDGOALS)
vhost:
export VHOST_USER
SUBDIRS =
SUBDIRS += dpdk
SUBDIRS += ovs
-SUBDIRS += qemu
ovs: dpdk
WITH_LINUX =
VHOST_USER = n
# specify upstream package as SUBDIRS - common terms as suggest by gnu-make
SUBDIRS =
SUBDIRS += ovs
-SUBDIRS += qemu
WITH_LINUX=/lib/modules/`uname -r`/build
VHOST_USER = n
include mk/make-subsys.mk
# modify CONFIG_FILE to enable VHOST_USER build and restore original CONFIG_FILE after the build
force_make: $(TAG_DONE_FLAG)
+ $(AT)cd $(WORK_DIR) && git pull $(DPDK_URL) $(DPDK_TAG)
$(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST_USER=.\+/CONFIG_RTE_LIBRTE_VHOST_USER=$(VHOST_USER)/g' $(CONFIG_FILE)
$(AT)sed -i -e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=./CONFIG_RTE_BUILD_COMBINE_LIBS=y/g' $(CONFIG_FILE)
$(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=./CONFIG_RTE_LIBRTE_VHOST=y/g' $(CONFIG_FILE)
@echo "install done"
# hard way to clean and clobber
-clean: cleanse
+clean:
+ $(AT)cd $(WORK_DIR) && git clean -xfd *.o
clobber:
$(AT)rm -rf $(WORK_DIR)
$(AT)rm -rf $(DPDK_VANILLA)
$(AT)rm -rf $(DPDK_CUSE)
-# cleanse is for developer who would like to keep the
+# distclean is for developer who would like to keep the
# clone git repo, saving time to fetch again from url
-cleanse:
+distclean:
$(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
test:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
rm -f l2fwd*deb
-cleanse: clean
+distclean: clean
clobber: clean
.PHONY: $(SUBDIRS)
-all clean cleanse clobber install uninstall test sanity: $(SUBDIRS)
+all clean distclean clobber install uninstall test sanity: $(SUBDIRS)
$(AT)echo "finished making $@"
$(SUBDIRS):
INSTALL_TARGET = force_install force_make
force_make: $(WORK_DIR)/Makefile
+ $(AT)cd $(WORK_DIR) && git pull $(OVS_URL) $(OVS_TAG)
+ @echo "git pull done"
$(AT)echo "WITH_LINUX = $(WITH_LINUX)"
$(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS)
@echo "Make done"
# hard way to clean and clobber
clean:
+ $(AT)cd $(WORK_DIR) && git clean -xfd *.o
clobber:
$(AT)rm -rf $(WORK_DIR)
$(AT)rm -rf $(OVS_VANILLA)
$(AT)rm -rf $(OVS_CUSE)
-# cleanse is for developer who would like to keep the
+# distclean is for developer who would like to keep the
# clone git repo, saving time to fetch again from url
-cleanse:
+distclean:
$(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
test:
INSTALL_TARGET = force_install force_make
force_make: $(WORK_DIR)/Makefile
+ $(AT)cd $(WORK_DIR) && git pull $(QEMU_URL) $(QEMU_TAG)
+ $(AT)echo "git pull done"
$(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS)
@echo "Make done"
# hard way to clean and clobber
clean:
+ $(AT)cd $(WORK_DIR) && git clean -xfd *.o
clobber:
$(AT)rm -rf $(WORK_DIR)
$(AT)rm -rf $(QEMU_VANILLA)
$(AT)rm -rf $(QEMU_CUSE)
-# cleanse is for developer who would like to keep the
+# distclean is for developer who would like to keep the
# clone git repo, saving time to fetch again from url
-cleanse:
+distclean:
$(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
test: