blob: 8fca853ec2c428453dc9a648abe1602a227dbc65 [file] [log] [blame]
Austin Cormier3a1c3352016-05-23 21:46:17 -04001#
2# Copyright 2016 RIFT.IO Inc
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16# Author(s): Austin Cormier
17# Creation Date: 2016/05/23
18#
Austin Cormier3aeed122016-05-23 19:12:00 -040019BUILD_DIR = build
20
21NSDS := gw_corpa_ns ims_allin1_corpa mwc16_gen_ns mwc16_pe_ns
22NSD_SRC_DIR := src/nsd
23NSD_BUILD_DIR := $(BUILD_DIR)/nsd
24
25NSD_SRC_DIRS := $(addprefix $(NSD_SRC_DIR)/, $(NSDS))
26NSD_BUILD_DIRS := $(addprefix $(NSD_BUILD_DIR)/, $(NSDS))
27NSD_PKGS := $(addsuffix .tar.gz, $(NSDS))
28NSD_BUILD_PKGS := $(addprefix $(NSD_BUILD_DIR)_pkgs/, $(NSD_PKGS))
29
30VNFDS := 6wind_vnf gw_corpa_pe1_vnf gw_corpa_pe2_vnf ims_allin1_2p_vnf tidgen_mwc16_vnf
31VNFD_SRC_DIR := src/vnfd
32VNFD_BUILD_DIR := $(BUILD_DIR)/vnfd
33
34VNFD_SRC_DIRS := $(addprefix $(VNFD_SRC_DIR)/, $(VNFDS))
35VNFD_BUILD_DIRS := $(addprefix $(VNFD_BUILD_DIR)/, $(VNFDS))
36VNFD_PKGS := $(addsuffix .tar.gz, $(VNFDS))
37VNFD_BUILD_PKGS := $(addprefix $(VNFD_BUILD_DIR)_pkgs/, $(VNFD_PKGS))
38
Austin Cormieree2c2b62016-05-23 20:53:00 -040039IMS_GITHUB="https://github.com/Metaswitch/clearwater-juju.git"
40
Austin Cormier3aeed122016-05-23 19:12:00 -040041all: $(VNFD_BUILD_PKGS) ${NSD_BUILD_PKGS}
42 echo $@
43
44clean:
45 -@ $(RM) -rf $(BUILD_DIR)
46
47$(VNFD_BUILD_DIR)/%: $(VNFD_SRC_DIR)/%
48 mkdir -p $(VNFD_BUILD_DIR)
49 cp -rf $< $(VNFD_BUILD_DIR)
50
51 src/gen_vnfd_pkg.sh $< $@
Austin Cormieree2c2b62016-05-23 20:53:00 -040052
53$(BUILD_DIR)/clearwater-juju: $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf
54 -cd $(BUILD_DIR) && (test -e clearwater-juju || git clone $(IMS_GITHUB))
Austin Cormier3aeed122016-05-23 19:12:00 -040055
56$(NSD_BUILD_DIR)/%: $(NSD_SRC_DIR)/%
57 mkdir -p $(NSD_BUILD_DIR)
58 cp -rf $< $(NSD_BUILD_DIR)
59
60 src/gen_nsd_pkg.sh $< $@
61
62$(BUILD_DIR)/nsd_pkgs/%.tar.gz: $(NSD_BUILD_DIR)/%
63 src/generate_descriptor_pkg.sh $(BUILD_DIR)/nsd_pkgs $<
64
Austin Cormieree2c2b62016-05-23 20:53:00 -040065$(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy: $(BUILD_DIR)/clearwater-juju
66 # Copy the IMS Charm into the IMS vnf package directory before
67 cp -rf $(BUILD_DIR)/clearwater-juju/charms/trusty/clearwater-aio-proxy $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms
68
69$(BUILD_DIR)/vnfd_pkgs/%.tar.gz: $(VNFD_BUILD_DIR)/% $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy
Austin Cormier3aeed122016-05-23 19:12:00 -040070 src/generate_descriptor_pkg.sh $(BUILD_DIR)/vnfd_pkgs $<