Merge "Fixed the action name for ping"
[osm/devops.git] / Makefile
1 #
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 #
19 BUILD_DIR = build
20
21 NSDS := gw_corpa_ns ims_allin1_corpa mwc16_gen_ns mwc16_pe_ns VyOS_ns
22 NSD_SRC_DIR := src/nsd
23 NSD_BUILD_DIR := $(BUILD_DIR)/nsd
24
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))
29
30 VNFDS := 6wind_vnf gw_corpa_pe1_vnf gw_corpa_pe2_vnf ims_allin1_2p_vnf tidgen_mwc16_vnf VyOS_vnf
31 VNFD_SRC_DIR := src/vnfd
32 VNFD_BUILD_DIR := $(BUILD_DIR)/vnfd
33
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))
38
39 IMS_GITHUB="https://github.com/Metaswitch/clearwater-juju.git"
40 CHARM_REPO="https://osm.etsi.org/gerrit/osm/juju-charms.git"
41
42 all: $(VNFD_BUILD_PKGS) ${NSD_BUILD_PKGS}
43 echo $@
44
45 clean:
46 -@ $(RM) -rf $(BUILD_DIR)
47
48 $(VNFD_BUILD_DIR)/%: $(VNFD_SRC_DIR)/%
49 mkdir -p $(VNFD_BUILD_DIR)
50 cp -rf $< $(VNFD_BUILD_DIR)
51
52 src/gen_vnfd_pkg.sh $< $@
53
54 $(BUILD_DIR)/clearwater-juju:
55 mkdir -p $(BUILD_DIR)
56 -cd $(BUILD_DIR) && (test -e clearwater-juju || git clone $(IMS_GITHUB))
57
58 $(BUILD_DIR)/juju-charms:
59 mkdir -p $(BUILD_DIR)
60 -cd $(BUILD_DIR) && (test -e juju-charms || git clone $(CHARM_REPO))
61
62 $(NSD_BUILD_DIR)/%: $(NSD_SRC_DIR)/%
63 mkdir -p $(NSD_BUILD_DIR)
64 cp -rf $< $(NSD_BUILD_DIR)
65
66 src/gen_nsd_pkg.sh $< $@
67
68 $(BUILD_DIR)/nsd_pkgs/%.tar.gz: $(NSD_BUILD_DIR)/%
69 src/generate_descriptor_pkg.sh $(BUILD_DIR)/nsd_pkgs $<
70
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
74
75 $(VNFD_BUILD_DIR)/6wind_vnf/charms/vpe-router: $(VNFD_BUILD_DIR)/6wind_vnf $(BUILD_DIR)/juju-charms
76 # Copy the IMS Charm into the IMS vnf package directory before packaging
77 cp -rf $(BUILD_DIR)/juju-charms/vpe-router $(VNFD_BUILD_DIR)/6wind_vnf/charms
78
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 $(BUILD_DIR)/vnfd_pkgs $<