src/dpdk: Rebind DPDK ports to the original driver
[vswitchperf.git] / src / qemu / Makefile
1 # makefile to manage qemu package
2 #
3
4 # Copyright (c) 2015 OPNFV and Intel Corporation.
5 #
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
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
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.
17
18 #
19 # Contributors:
20 #   Aihua Li, Huawei Technologies.
21
22 include ../mk/master.mk
23 include ../package-list.mk
24
25 WORK_DIR = qemu
26 TAG_DONE_FLAG = $(WORK_DIR)/.$(QEMU_TAG).done
27 CONFIG_CMD =
28 CONFIG_CMD += ./configure
29 CONFIG_CMD += --target-list="x86_64-softmmu"
30
31
32 all: force_make
33
34 .PHONY: install force_install config force_make
35
36 # install depends on make
37 force_install: force_make
38         @echo "Finished making $(WORK_DIR) "
39
40 config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
41         $(AT)cd $(WORK_DIR); $(CONFIG_CMD)
42         @echo "Configure done"
43
44 INSTALL_TARGET = force_install force_make
45
46 force_make: $(WORK_DIR)/Makefile
47         $(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS)
48         @echo "Make done"
49
50 force_install:
51         $(AT)sudo $(MAKE) -C $(WORK_DIR) install
52
53 install: $(INSTALL_TARGET)
54
55 # hard way to clean and clobber
56 clean:
57 clobber:
58         $(AT)rm -rf $(WORK_DIR)
59
60 # cleanse is for developer who would like to keep the
61 # clone git repo, saving time to fetch again from url
62 cleanse:
63         $(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
64
65 test:
66         @echo "Make test in $(WORK_DIR) (stub) "
67
68 sanity:
69         @echo "Make sanity in $(WORK_DIR) (stub) "
70
71 $(WORK_DIR)/configure: $(TAG_DONE_FLAG)
72
73 $(WORK_DIR):
74         $(AT)git clone $(QEMU_URL)
75
76 $(TAG_DONE_FLAG): $(WORK_DIR)
77         $(AT)cd $(WORK_DIR); git checkout $(QEMU_TAG)
78 ifneq ($(PATCH_FILE),)
79         $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE)
80 endif
81         $(AT)touch $@