bugfix: Fix creation of vsperfenv in Ubuntu
[vswitchperf.git] / src / qemu / Makefile
index 1a736a2..4603b27 100755 (executable)
@@ -1,7 +1,7 @@
 # makefile to manage qemu package
 #
 
-# Copyright (c) 2015 OPNFV and Intel Corporation.
+# Copyright (c) 2015-2016 OPNFV and Intel Corporation.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -24,26 +24,24 @@ include ../package-list.mk
 
 WORK_DIR = qemu
 TAG_DONE_FLAG = $(WORK_DIR)/.$(QEMU_TAG).done
+INSTALL_TARGET = force_make force_install
 CONFIG_CMD =
 CONFIG_CMD += ./configure
 CONFIG_CMD += --target-list="x86_64-softmmu"
-
+QEMU_VANILLA = ../../src_vanilla/qemu
+QEMU_CUSE = ../../src_cuse/qemu
 
 all: force_make
 
 .PHONY: install force_install config force_make
 
-# install depends on make
-force_install: force_make
-       @echo "Finished making $(WORK_DIR) "
-
 config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
        $(AT)cd $(WORK_DIR); $(CONFIG_CMD)
        @echo "Configure done"
 
-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"
 
@@ -54,12 +52,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:
@@ -72,6 +73,10 @@ $(WORK_DIR)/configure: $(TAG_DONE_FLAG)
 
 $(WORK_DIR):
        $(AT)git clone $(QEMU_URL)
+       $(AT)mkdir -p $(QEMU_VANILLA)
+       $(AT)cp -rf ./* $(QEMU_VANILLA)
+       $(AT)mkdir -p $(QEMU_CUSE)
+       $(AT)cp -rf ./* $(QEMU_CUSE)
 
 $(TAG_DONE_FLAG): $(WORK_DIR)
        $(AT)cd $(WORK_DIR); git checkout $(QEMU_TAG)