2 # Copyright 2016 RIFT.IO Inc
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 # Author(s): Austin Cormier
17 # Creation Date: 2016/05/23
21 NSDS
:= gw_corpa_ns ims_allin1_corpa mwc16_gen_ns mwc16_pe_ns VyOS_ns cirros_ns cirros_2vnf_ns ubuntu_xenial_ns
22 NSD_SRC_DIR
:= src
/nsd
23 NSD_BUILD_DIR
:= $(BUILD_DIR
)/nsd
25 NSD_SRC_DIRS
:= $(addprefix $(NSD_SRC_DIR
)/, $(NSDS
))
26 NSD_BUILD_DIRS
:= $(addprefix $(NSD_BUILD_DIR
)/, $(NSDS
))
27 NSD_PKGS
:= $(addsuffix .
tar.gz
, $(NSDS
))
28 NSD_BUILD_PKGS
:= $(addprefix $(NSD_BUILD_DIR
)_pkgs
/, $(NSD_PKGS
))
30 VNFDS
:= 6wind_vnf gw_corpa_pe1_vnf gw_corpa_pe2_vnf ims_allin1_2p_vnf tidgen_mwc16_vnf VyOS_vnf cirros_vnf ubuntu_xenial_vnf
31 VNFD_SRC_DIR
:= src
/vnfd
32 VNFD_BUILD_DIR
:= $(BUILD_DIR
)/vnfd
34 VNFD_SRC_DIRS
:= $(addprefix $(VNFD_SRC_DIR
)/, $(VNFDS
))
35 VNFD_BUILD_DIRS
:= $(addprefix $(VNFD_BUILD_DIR
)/, $(VNFDS
))
36 VNFD_PKGS
:= $(addsuffix .
tar.gz
, $(VNFDS
))
37 VNFD_BUILD_PKGS
:= $(addprefix $(VNFD_BUILD_DIR
)_pkgs
/, $(VNFD_PKGS
))
39 IMS_GITHUB
="https://github.com/Metaswitch/clearwater-juju.git"
40 CHARM_REPO
="https://osm.etsi.org/gerrit/osm/juju-charms.git"
42 all: $(VNFD_BUILD_PKGS
) ${NSD_BUILD_PKGS}
46 -@
$(RM
) -rf
$(BUILD_DIR
)
48 $(VNFD_BUILD_DIR
)/%: $(VNFD_SRC_DIR
)/%
49 mkdir
-p
$(VNFD_BUILD_DIR
)
50 cp
-rf
$< $(VNFD_BUILD_DIR
)
52 src
/gen_vnfd_pkg.sh
$< $@
54 $(BUILD_DIR
)/clearwater-juju
:
56 -cd
$(BUILD_DIR
) && (test -e clearwater-juju || git clone
$(IMS_GITHUB
))
58 $(BUILD_DIR
)/juju-charms
:
60 -cd
$(BUILD_DIR
) && (test -e juju-charms || git clone
$(CHARM_REPO
))
62 $(NSD_BUILD_DIR
)/%: $(NSD_SRC_DIR
)/%
63 mkdir
-p
$(NSD_BUILD_DIR
)
64 cp
-rf
$< $(NSD_BUILD_DIR
)
66 src
/gen_nsd_pkg.sh
$< $@
68 $(BUILD_DIR
)/nsd_pkgs
/%.
tar.gz
: $(NSD_BUILD_DIR
)/%
69 src
/generate_descriptor_pkg.sh
-d
$(BUILD_DIR
)/nsd_pkgs
$<
71 $(VNFD_BUILD_DIR
)/ims_allin1_2p_vnf
/charms
/clearwater-aio-proxy
: $(VNFD_BUILD_DIR
)/ims_allin1_2p_vnf
$(BUILD_DIR
)/clearwater-juju
72 # Copy the IMS Charm into the IMS vnf package directory before packaging
73 cp
-rf
$(BUILD_DIR
)/clearwater-juju
/charms
/trusty
/clearwater-aio-proxy
$(VNFD_BUILD_DIR
)/ims_allin1_2p_vnf
/charms
75 $(VNFD_BUILD_DIR
)/6wind_vnf
/charms
/vpe-router
: $(VNFD_BUILD_DIR
)/6wind_vnf
$(BUILD_DIR
)/juju-charms
76 # Copy the PE Charm into the PE vnf package directory before packaging
77 cp
-rf
$(BUILD_DIR
)/juju-charms
/builds
/vpe-router
$(VNFD_BUILD_DIR
)/6wind_vnf
/charms
79 $(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
80 src
/generate_descriptor_pkg.sh
-d
$(BUILD_DIR
)/vnfd_pkgs
$<