blob: cb564681deb99408249f8893cc71ecc388873b15 [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
velandyf08794a2017-04-11 14:05:11 -040021NSDS := \
22 gw_corpa_ns \
23 ims_allin1_corpa \
24 mwc16_gen_ns \
25 mwc16_pe_ns \
26 VyOS_ns \
27 cirros_ns \
28 cirros_2vnf_ns \
29 ubuntu_xenial_ns \
30 ping_pong_ns \
31 knt_flownac_ns \
32 knt_flownac-us_ns \
33 sandvine_pts_ns \
34 sonussbc_ns \
35 ref1_ns \
36 ref2_ns
37
Austin Cormier3aeed122016-05-23 19:12:00 -040038NSD_SRC_DIR := src/nsd
39NSD_BUILD_DIR := $(BUILD_DIR)/nsd
40
41NSD_SRC_DIRS := $(addprefix $(NSD_SRC_DIR)/, $(NSDS))
42NSD_BUILD_DIRS := $(addprefix $(NSD_BUILD_DIR)/, $(NSDS))
43NSD_PKGS := $(addsuffix .tar.gz, $(NSDS))
44NSD_BUILD_PKGS := $(addprefix $(NSD_BUILD_DIR)_pkgs/, $(NSD_PKGS))
45
velandyf08794a2017-04-11 14:05:11 -040046VNFDS := \
47 6wind_vnf \
48 gw_corpa_pe1_vnf \
49 gw_corpa_pe2_vnf \
50 ims_allin1_2p_vnf \
51 tidgen_mwc16_vnf \
52 VyOS_vnf \
53 cirros_vnf \
54 ubuntu_xenial_vnf \
55 ping_vnf \
56 pong_vnf \
57 knt_fnc_vnf \
58 knt_fne_vnf \
59 knt_fnu_vnf \
60 knt_fnd_vnf \
61 sandvine_pts_vnf \
62 sonus_sbc_vnf \
63 sonus_test_vnf \
64 ref11_vnf \
65 ref21_vnf \
66 ref12_vnf \
67 ref22_vnf
68
Austin Cormier3aeed122016-05-23 19:12:00 -040069VNFD_SRC_DIR := src/vnfd
70VNFD_BUILD_DIR := $(BUILD_DIR)/vnfd
71
72VNFD_SRC_DIRS := $(addprefix $(VNFD_SRC_DIR)/, $(VNFDS))
73VNFD_BUILD_DIRS := $(addprefix $(VNFD_BUILD_DIR)/, $(VNFDS))
74VNFD_PKGS := $(addsuffix .tar.gz, $(VNFDS))
75VNFD_BUILD_PKGS := $(addprefix $(VNFD_BUILD_DIR)_pkgs/, $(VNFD_PKGS))
76
Austin Cormieree2c2b62016-05-23 20:53:00 -040077IMS_GITHUB="https://github.com/Metaswitch/clearwater-juju.git"
Austin Cormierf1298782016-05-24 11:01:38 -040078CHARM_REPO="https://osm.etsi.org/gerrit/osm/juju-charms.git"
Austin Cormieree2c2b62016-05-23 20:53:00 -040079
Austin Cormier3aeed122016-05-23 19:12:00 -040080all: $(VNFD_BUILD_PKGS) ${NSD_BUILD_PKGS}
81 echo $@
82
83clean:
84 -@ $(RM) -rf $(BUILD_DIR)
85
86$(VNFD_BUILD_DIR)/%: $(VNFD_SRC_DIR)/%
87 mkdir -p $(VNFD_BUILD_DIR)
88 cp -rf $< $(VNFD_BUILD_DIR)
89
90 src/gen_vnfd_pkg.sh $< $@
Austin Cormieree2c2b62016-05-23 20:53:00 -040091
Austin Cormierf1298782016-05-24 11:01:38 -040092$(BUILD_DIR)/clearwater-juju:
93 mkdir -p $(BUILD_DIR)
Austin Cormieree2c2b62016-05-23 20:53:00 -040094 -cd $(BUILD_DIR) && (test -e clearwater-juju || git clone $(IMS_GITHUB))
Austin Cormier3aeed122016-05-23 19:12:00 -040095
Austin Cormierf1298782016-05-24 11:01:38 -040096$(BUILD_DIR)/juju-charms:
97 mkdir -p $(BUILD_DIR)
98 -cd $(BUILD_DIR) && (test -e juju-charms || git clone $(CHARM_REPO))
Philip Josephde3b8ca2016-10-07 14:00:30 +053099 -cd $(BUILD_DIR)/juju-charms && make
Austin Cormierf1298782016-05-24 11:01:38 -0400100
Austin Cormier3aeed122016-05-23 19:12:00 -0400101$(NSD_BUILD_DIR)/%: $(NSD_SRC_DIR)/%
102 mkdir -p $(NSD_BUILD_DIR)
103 cp -rf $< $(NSD_BUILD_DIR)
104
105 src/gen_nsd_pkg.sh $< $@
106
107$(BUILD_DIR)/nsd_pkgs/%.tar.gz: $(NSD_BUILD_DIR)/%
Philip Joseph15b76cb2016-07-08 01:42:08 +0530108 src/generate_descriptor_pkg.sh -d $(BUILD_DIR)/nsd_pkgs $<
Austin Cormier3aeed122016-05-23 19:12:00 -0400109
Austin Cormierf1298782016-05-24 11:01:38 -0400110$(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy: $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf $(BUILD_DIR)/clearwater-juju
111 # Copy the IMS Charm into the IMS vnf package directory before packaging
Austin Cormieree2c2b62016-05-23 20:53:00 -0400112 cp -rf $(BUILD_DIR)/clearwater-juju/charms/trusty/clearwater-aio-proxy $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms
113
Austin Cormierf1298782016-05-24 11:01:38 -0400114$(VNFD_BUILD_DIR)/6wind_vnf/charms/vpe-router: $(VNFD_BUILD_DIR)/6wind_vnf $(BUILD_DIR)/juju-charms
Philip Joseph15b76cb2016-07-08 01:42:08 +0530115 # Copy the PE Charm into the PE vnf package directory before packaging
Rajesh9dd380e2016-09-28 23:24:01 -0400116 cp -rf $(BUILD_DIR)/juju-charms/builds/vpe-router $(VNFD_BUILD_DIR)/6wind_vnf/charms
Austin Cormierf1298782016-05-24 11:01:38 -0400117
Philip Joseph6936aea2016-10-13 11:54:52 +0530118$(VNFD_BUILD_DIR)/VyOS_vnf/charms/vyos-proxy: $(VNFD_BUILD_DIR)/VyOS_vnf $(BUILD_DIR)/juju-charms
Philip Josephf3222752016-10-02 23:49:12 +0530119 # Copy the PE Charm into the PE vnf package directory before packaging
Philip Joseph6936aea2016-10-13 11:54:52 +0530120 cp -rf $(BUILD_DIR)/juju-charms/builds/vyos-proxy $(VNFD_BUILD_DIR)/VyOS_vnf/charms
Philip Josephf3222752016-10-02 23:49:12 +0530121
Philip Joseph54b892b2017-01-10 18:01:10 +0530122$(VNFD_BUILD_DIR)/ping_vnf/charms/pingpong: $(VNFD_BUILD_DIR)/ping_vnf $(BUILD_DIR)/juju-charms
123 # Copy the pingpong Charm into the ping vnf package directory before packaging
124 cp -rf $(BUILD_DIR)/juju-charms/builds/pingpong $(VNFD_BUILD_DIR)/ping_vnf/charms
125
126$(VNFD_BUILD_DIR)/pong_vnf/charms/pingpong: $(VNFD_BUILD_DIR)/pong_vnf $(BUILD_DIR)/juju-charms
127 # Copy the pingpong Charm into the pong vnf package directory before packaging
128 cp -rf $(BUILD_DIR)/juju-charms/builds/pingpong $(VNFD_BUILD_DIR)/pong_vnf/charms
129
130$(BUILD_DIR)/vnfd_pkgs/%.tar.gz: $(VNFD_BUILD_DIR)/% $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy $(VNFD_BUILD_DIR)/6wind_vnf/charms/vpe-router $(VNFD_BUILD_DIR)/VyOS_vnf/charms/vyos-proxy $(VNFD_BUILD_DIR)/ping_vnf/charms/pingpong $(VNFD_BUILD_DIR)/pong_vnf/charms/pingpong
Philip Joseph15b76cb2016-07-08 01:42:08 +0530131 src/generate_descriptor_pkg.sh -d $(BUILD_DIR)/vnfd_pkgs $<