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 ##############################################################################
11 ############################################################################
12 # BEGIN of variables to customize
16 #export BUILD_BASE = $(shell pwd)
17 #export CACHE_DIR = "$(BUILD_BASE)/cache"
19 CACHEDIRS := opendaylight/f_odl/package
21 CACHEFILES := opendaylight/.odl-build-history
22 CACHEFILES += opendaylight/.odl-build.log
23 CACHEFILES += .versions
24 CACHEFILES += fuel-6.0.1.iso
25 #CACHEFILES += $(ISOSRC)
27 CACHECLEAN = $(addsuffix .clean,$(CACHEDIRS))
30 prepare-cache: make-cache-dir $(CACHEDIRS) $(CACHEFILES)
32 .PHONY: make-cache-dir
39 clean-cache: $(CACHECLEAN)
44 @mkdir -p $(dir ${CACHE_DIR}/$@)
45 @if [ ! -d ${BUILD_BASE}/$@ ]; then\
46 mkdir -p $(dir ${BUILD_BASE}/$@);\
47 ln -s ${BUILD_BASE}/$@ ${CACHE_DIR}/$@;\
48 rm -rf ${BUILD_BASE}/$@;\
50 ln -s ${BUILD_BASE}/$@ ${CACHE_DIR}/$@;\
55 @mkdir -p $(dir ${CACHE_DIR}/$@)
56 @if [ ! -f ${BUILD_BASE}/$@ ]; then\
57 mkdir $(dir ${BUILD_BASE}/$@);\
58 echo " " > ${BUILD_BASE}/$@;\
59 ln -s ${BUILD_BASE}/$@ ${CACHE_DIR}/$@;\
60 rm -f ${BUILD_BASE}/$@;\
62 ln -s ${BUILD_BASE}/$@ ${CACHE_DIR}/$@;\
65 .PHONY: validate-cache
67 # if [ $(shell md5sum ${BUILD_BASE}/config.mk) -ne $(shell cat ${CACHE_DIR}/.versions | grep config.mk awk '{print $NF}') ]; then\
68 echo "Cache does not match current config.mk definition, cache must be rebuilt";\
72 # if [ $(shell md5sum ${BUILD_BASE}/cache.mk) -ne $(shell cat ${CACHE_DIR}/.versions | grep config.mk awk '{print $NF}') ]; then\
73 echo "Cache does not match current cache.mk definition, cache must be rebuilt";\
77 # $(MAKE) -C opendaylight validate-cache
78 # if [ $? -ne 0 ]; then\
79 echo "Cache does not match current OpenDaylight version, cach must be rebuilt";\
86 $(CACHECLEAN): %.clean: