Fuel build cache handling
[genesis.git] / fuel / build / opendaylight / f_odl / Makefile
1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # stefan.k.berg@ericsson.com
4 # jonas.bjurel@ericsson.com
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 include $(BUILD_BASE)/config.mk
12 ODL_NAME_SHORT := odl
13 PACKAGE := odl_$(shell cd /tmp/controller; git rev-parse --short HEAD)
14 VERSION := 0.1-1
15 DEB_NAME := $(PACKAGE)_$(VERSION)
16
17 .PHONY: all
18 all:    release/pool/main/$(DEB_NAME).deb
19
20 release/pool/main/$(DEB_NAME).deb:
21 ifeq ($(ODL_MAIN_REPO),)
22         @echo "No config-spec target for ODL, nothing to build"
23 else
24         @mkdir -p tmp/src
25         @mkdir -p release/pool/main
26         @cp -rp package/$(DEB_NAME) tmp/src
27         @gzip -f9 tmp/src/$(DEB_NAME)/usr/share/doc/$(ODL_NAME_SHORT)/changelog.Debian
28         @fakeroot dpkg-deb --build tmp/src/$(DEB_NAME)
29         @lintian tmp/src/$(DEB_NAME).deb
30         @cp tmp/src/$(DEB_NAME).deb release/pool/main
31 endif
32
33 .PHONY: clean
34 clean:
35         @rm -rf tmp
36         @rm -rf release
37         @rm -f $(DEB_DEST)/$(DEB_NAME).deb
38
39 .PHONY: validate-cache
40 validate-cache:
41         @echo "No cache validation schema available for $(shell pwd)"
42         @echo "Continuing ..."
43
44 .PHONY: release
45 release:release/pool/main/$(DEB_NAME).deb
46 ifneq ($(ODL_MAIN_REPO),)
47         @cp release/pool/main/$(DEB_NAME).deb $(DEB_DEST)
48         @cp -Rvp puppet/modules/* $(PUPPET_DEST)
49 endif