blob: 92d1f6c3e01ccefe72a179191153dc75da0d67d8 [file] [log] [blame]
Colin Ian King96875c52016-12-15 18:39:09 +00001#
2# Copyright (C) 2016 Canonical
3#
4# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License
6# as published by the Free Software Foundation; either version 2
7# of the License, or (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17#
18
19#
20# Simple makefile to mangle version info in the yaml file
21#
22VERSION=$(shell git tag | tail -1 | cut -c2-)
23COMMITS=$(shell git log --oneline | wc -l)
24SHA=$(shell git log -1 --oneline | cut -d' ' -f1)
25DATE=$(shell date +'%Y%m%d')
26V=$(VERSION)-$(DATE)-$(COMMITS)-$(SHA)
27
28all: set_version
29 snapcraft
30
31set_version:
32 cat snapcraft.yaml | sed 's/version: .*/version: $(V)/' > snapcraft-tmp.yaml
33 mv snapcraft-tmp.yaml snapcraft.yaml
34
35install:
36 #
37 # Install latest snap
38 #
39 sudo snap install --devmode bcc_*.snap
40
41 #
42 # Connect up interfaces
43 #
44 sudo snap connect bcc:mount-observe
45 sudo snap connect bcc:system-observe
46 sudo snap connect bcc:system-trace
47
48remove:
49 sudo snap remove bcc
50
51clean:
52 snapcraft clean
53 rm -rf setup *.snap snapcraft