1 # makefile to manage qemu package
4 # Copyright (c) 2015-2016 OPNFV and Intel Corporation.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
20 # Aihua Li, Huawei Technologies.
22 include ../mk/master.mk
23 include ../package-list.mk
26 TAG_DONE_FLAG = $(WORK_DIR)/.$(QEMU_TAG).done
27 INSTALL_TARGET = force_make force_install
29 CONFIG_CMD += ./configure
30 CONFIG_CMD += --target-list="x86_64-softmmu"
31 QEMU_VANILLA = ../../src_vanilla/qemu
32 QEMU_CUSE = ../../src_cuse/qemu
36 .PHONY: install force_install config force_make
38 config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
39 $(AT)cd $(WORK_DIR); $(CONFIG_CMD)
40 @echo "Configure done"
42 force_make: $(WORK_DIR)/Makefile
43 $(AT)cd $(WORK_DIR) && git pull $(QEMU_URL) $(QEMU_TAG)
44 $(AT)echo "git pull done"
45 $(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS)
49 $(AT)sudo $(MAKE) -C $(WORK_DIR) install
51 install: $(INSTALL_TARGET)
53 # hard way to clean and clobber
55 $(AT)cd $(WORK_DIR) && git clean -xfd *.o
57 $(AT)rm -rf $(WORK_DIR)
58 $(AT)rm -rf $(QEMU_VANILLA)
59 $(AT)rm -rf $(QEMU_CUSE)
61 # distclean is for developer who would like to keep the
62 # clone git repo, saving time to fetch again from url
64 $(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
67 @echo "Make test in $(WORK_DIR) (stub) "
70 @echo "Make sanity in $(WORK_DIR) (stub) "
72 $(WORK_DIR)/configure: $(TAG_DONE_FLAG)
75 $(AT)git clone $(QEMU_URL)
76 $(AT)mkdir -p $(QEMU_VANILLA)
77 $(AT)cp -rf ./* $(QEMU_VANILLA)
78 $(AT)mkdir -p $(QEMU_CUSE)
79 $(AT)cp -rf ./* $(QEMU_CUSE)
81 $(TAG_DONE_FLAG): $(WORK_DIR)
82 $(AT)cd $(WORK_DIR); git checkout $(QEMU_TAG)
83 ifneq ($(PATCH_FILE),)
84 $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE)