# Contributors:
# Aihua Li, Huawei Technologies.
-include mk/master.mk
+SUBBUILDS = src_cuse src_vanilla
+.PHONY: vhost subbuilds $(SUBBUILDS)
-export VHOST_USER
+all: vhost subbuilds
-# specify upstream package as SUBDIRS - common terms as suggest by gnu-make
+subbuilds: $(SUBBUILDS)
+$(SUBBUILDS): vhost
+ $(AT)mkdir -p ../$@/mk
+ $(AT)cp -rf mk/* ../$@/mk
+ $(AT)cp -rf package-list.mk ../$@/
+ $(AT)cp Makefile.$@ ../$@/Makefile
+ $(AT)$(MAKE) -C ../$@
+
+vhost:
+export VHOST_USER
+include mk/master.mk
SUBDIRS =
SUBDIRS += l2fwd
-ifeq ($(WITH_LINUX),)
SUBDIRS += dpdk
-endif
SUBDIRS += ovs
SUBDIRS += qemu
-
-ifeq ($(WITH_LINUX),)
-# specify package dependency here if needed
ovs: dpdk
-endif
-
+WITH_LINUX =
+VHOST_USER = y
include mk/make-subsys.mk
--- /dev/null
+# Top Makefile to build upstream packages.
+#
+
+# Copyright 2015 OPNFV
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Contributors:
+# Aihua Li, Huawei Technologies.
+
+include mk/master.mk
+
+export VHOST_USER
+
+# specify upstream package as SUBDIRS - common terms as suggest by gnu-make
+SUBDIRS =
+SUBDIRS += dpdk
+SUBDIRS += ovs
+SUBDIRS += qemu
+ovs: dpdk
+WITH_LINUX =
+VHOST_USER = n
+include mk/make-subsys.mk
--- /dev/null
+# Top Makefile to build upstream packages.
+#
+
+# Copyright 2015 OPNFV
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Contributors:
+# Aihua Li, Huawei Technologies.
+
+include mk/master.mk
+
+export VHOST_USER
+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
endif
WORK_DIR = dpdk
TAG_DONE_FLAG = $(WORK_DIR)/.$(DPDK_TAG).tag.done
+DPDK_VANILLA = ../../src_vanilla/dpdk
+DPDK_CUSE = ../../src_cuse/dpdk
# the name has been changed from version to version
ifeq ($(DPDK_TAG),v1.6.0r0)
$(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_KNI=./CONFIG_RTE_LIBRTE_KNI=n/g' $(CONFIG_FILE)
$(AT)cd $(WORK_DIR); make install T=$(DPDK_TARGET) -j
$(AT)cd `dirname $(CONFIG_FILE)` && git checkout `basename $(CONFIG_FILE)` && cd -
+ $(AT)echo "VHOST_USER = $(VHOST_USER)"
ifeq ($(VHOST_USER),n)
$(AT)cd $(WORK_DIR)/lib/librte_vhost/eventfd_link; make
endif
clean: cleanse
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
# clone git repo, saving time to fetch again from url
$(WORK_DIR):
$(AT)git clone $(DPDK_URL)
+ $(AT)mkdir -p $(DPDK_VANILLA)
+ $(AT)cp -rf ./* $(DPDK_VANILLA)
+ $(AT)mkdir -p $(DPDK_CUSE)
+ $(AT)cp -rf ./* $(DPDK_CUSE)
$(TAG_DONE_FLAG): $(WORK_DIR)
$(AT)cd $(WORK_DIR); git checkout $(DPDK_TAG)
TAG_DONE_FLAG = $(WORK_DIR)/.$(OVS_TAG).done
CONFIG_CMD =
CONFIG_CMD += ./configure
+OVS_VANILLA = ../../src_vanilla/ovs
+OVS_CUSE = ../../src_cuse/ovs
# If WITH_LINUX is defined, OVS is built without DPDK but with kernel
# module
INSTALL_TARGET = force_install force_make
force_make: $(WORK_DIR)/Makefile
+ $(AT)echo "WITH_LINUX = $(WITH_LINUX)"
$(AT)$(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS)
@echo "Make done"
clean:
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
# clone git repo, saving time to fetch again from url
$(WORK_DIR):
$(AT)git clone $(OVS_URL)
+ $(AT)mkdir -p $(OVS_VANILLA)
+ $(AT)cp -rf ./* $(OVS_VANILLA)
+ $(AT)mkdir -p $(OVS_CUSE)
+ $(AT)cp -rf ./* $(OVS_CUSE)
$(TAG_DONE_FLAG): $(WORK_DIR)
$(AT)cd ovs; git checkout $(OVS_TAG)
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
clean:
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
# clone git repo, saving time to fetch again from url
$(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)