Fix Make, Make clean and when the src directories are cloned 35/2735/3
authorRadek Zetik <radekx.zetik@intel.com>
Wed, 21 Oct 2015 05:45:20 +0000 (06:45 +0100)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Thu, 29 Oct 2015 11:32:19 +0000 (11:32 +0000)
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>
src/Makefile
src/Makefile.src_cuse
src/Makefile.src_vanilla
src/dpdk/Makefile
src/l2fwd/Makefile
src/mk/make-subsys.mk
src/ovs/Makefile
src/qemu/Makefile

index 81143ae..4297028 100644 (file)
@@ -22,7 +22,7 @@
 SUBBUILDS = src_cuse src_vanilla
 .PHONY: vhost subbuilds $(SUBBUILDS)
 
-all: vhost subbuilds
+all clean distclean: vhost subbuilds
 
 subbuilds: $(SUBBUILDS)
 $(SUBBUILDS): vhost
@@ -30,7 +30,7 @@ $(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
index 74e76f4..0ddac4c 100644 (file)
@@ -27,7 +27,6 @@ export VHOST_USER
 SUBDIRS =
 SUBDIRS += dpdk
 SUBDIRS += ovs
-SUBDIRS += qemu
 ovs: dpdk
 WITH_LINUX =
 VHOST_USER = n
index 922d5e5..491fb2c 100644 (file)
@@ -27,7 +27,6 @@ export WITH_LINUX
 # 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
index af74373..030e4ba 100755 (executable)
@@ -48,6 +48,7 @@ INSTALL_TARGET = force_make
 
 # 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)
@@ -65,15 +66,16 @@ install: $(INSTALL_TARGET)
        @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:
index b920769..39e64a5 100644 (file)
@@ -34,7 +34,7 @@ clean:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
        rm -f l2fwd*deb
 
-cleanse: clean
+distclean: clean
 
 clobber: clean
 
index a40f567..b0bd6b8 100644 (file)
@@ -21,7 +21,7 @@
 
 .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):
index a67057f..384d699 100644 (file)
@@ -72,6 +72,8 @@ config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
 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"
@@ -84,14 +86,15 @@ install: $(INSTALL_TARGET)
 
 # 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:
index 0a71cf7..1268f57 100755 (executable)
@@ -45,6 +45,8 @@ config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
 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"
 
@@ -55,14 +57,15 @@ install: $(INSTALL_TARGET)
 
 # 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: