Add apache license to newly added files.
[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
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
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
41 all: $(VNFD_BUILD_PKGS) ${NSD_BUILD_PKGS}
42 echo $@
43
44 clean:
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 $< $@
52
53 $(BUILD_DIR)/clearwater-juju: $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf
54 -cd $(BUILD_DIR) && (test -e clearwater-juju || git clone $(IMS_GITHUB))
55
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
65 $(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
70 src/generate_descriptor_pkg.sh $(BUILD_DIR)/vnfd_pkgs $<