Updated Mon Module with the following changes:
[osm/MON.git] / Makefile
1 # Copyright 2017 Intel Research and Development Ireland Limited
2 # *************************************************************
3
4 # This file is part of OSM Monitoring module
5 # All Rights Reserved to Intel Corporation
6
7 # Licensed under the Apache License, Version 2.0 (the "License"); you may
8 # not use this file except in compliance with the License. You may obtain
9 # a copy of the License at
10
11 # http://www.apache.org/licenses/LICENSE-2.0
12
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 # License for the specific language governing permissions and limitations
17 # under the License.
18
19 # For those usages not covered by the Apache License, Version 2.0 please
20 # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
21
22 #__author__ = "Prithiv Mohan"
23 #__date__ = "14/Sep/2017"
24
25 SHELL := /bin/bash
26 all: package install
27
28 clean_deb:
29 rm -rf .build
30
31 clean:
32 rm -rf build
33
34 prepare:
35 pip install --upgrade setuptools
36 mkdir -p build/
37 VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
38 VER2=$(shell git describe | cut -d- -f2); \
39 VER3=$(shell git describe | cut -d- -f3); \
40 echo "$$VER1.dev$$VER2+$$VER3" > build/MON_VERSION
41 cp MANIFEST.in build/
42 cp requirements.txt build/
43 cp README.rst build/
44 cp -r core build/
45 cp -r plugins build/
46 cp -r devops_stages build/
47 cp -r test build/
48
49 build: clean openstack_plugins prepare
50 python -m py_compile build/plugins/OpenStack/*.py
51
52 build: clean vrops_plugins prepare
53 python -m py_compile build/plugins/vRealiseOps/*.py
54
55 build clean cloudwatch_plugins prepare
56 python -m py_compile build/plugins/CloudWatch/*.py
57
58 build clean core prepare
59 python -m py_compile build/core/message_bus/*.py
60
61 pip: prepare
62 cd build ./setup.py sdist
63
64 package: clean clean_deb prepare
65 apt-get --yes install python-software-properties \
66 python-pip \
67 python-stdeb
68 cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
69 mkdir -p build
70 cp build/deb_dist/python-*.deb .build/
71
72 install:
73 DEBIAN_FRONTEND=noninteractive apt-get update && \
74 DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip && \
75 pip install --upgrade pip && \
76 dpkg -i .build/*.deb
77
78 develop: prepare
79 pip install -r requirements.txt
80 cd build && ./setup.py develop