1 # makefile to manage ovs package
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
25 # DPDK_DIR is the top directory for dpdk source tree
26 # it can be passed in from Makefile command
27 # if it is not set, try to read it in from environment
28 # if it is still not set, then set it using relative path
30 DPDK_DIR ?= $(shell echo $$DPDK_DIR)
32 DPDK_DIR = ../../dpdk/dpdk
35 .PHONY: install force_install config force_make
37 # install depends on make
38 force_install: force_make
41 TAG_DONE_FLAG = $(WORK_DIR)/.$(OVS_TAG).done
43 CONFIG_CMD += ./configure
44 CONFIG_CMD += --with-linux=$(LINUX_BUILD)
45 CONFIG_CMD += --prefix=$(INSTALL_DIR)/usr
46 CONFIG_CMD += --localstatedir=$(INSTALL_DIR)/usr/local
47 CONFIG_CMD += --with-dpdk=$(DPDK_DIR)/build
50 @echo "Finished making $(WORK_DIR) "
52 config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
53 $(AT)cd $(WORK_DIR); $(CONFIG_CMD)
54 @echo "Configure done"
56 INSTALL_TARGET = force_install force_make
58 force_make: $(WORK_DIR)/Makefile
59 $(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS)
63 $(AT)sudo make -C $(WORK_DIR) modules_install
64 $(AT)sudo $(MAKE) -C $(WORK_DIR) install
66 install: $(INSTALL_TARGET)
68 # hard way to clean and clobber
71 $(AT)rm -rf $(WORK_DIR)
73 # cleanse is for developer who would like to keep the
74 # clone git repo, saving time to fetch again from url
76 $(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
79 @echo "Make test in $(WORK_DIR) (stub) "
82 @echo "Make sanity in $(WORK_DIR) (stub) "
85 # boot ovs is the process to produce the script 'configure'
86 boot $(WORK_DIR)/configure:
87 @echo "booting up ovs"
88 $(AT)cd $(WORK_DIR); ./boot.sh
89 @echo "done booting ovs"
91 boot $(WORK_DIR)/configure: $(TAG_DONE_FLAG)
94 $(AT)git clone $(OVS_URL)
96 $(TAG_DONE_FLAG): $(WORK_DIR)
97 $(AT)cd ovs; git checkout $(OVS_TAG)
98 ifneq ($(PATCH_FILE),)
99 $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE)