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
17 BUILD_DIR := $(shell pwd)
19 export CONFIG_SPEC_SCRIPT
20 export MAVEN_OPTS = -Xmx1024m -XX:MaxPermSize=512m
21 MAINTAINER = "Main Tainer <main.tainer@example.org>"
24 DEPEND = openjdk-8-jdk
25 TARGET_BUILD_PATH="/tmp/controller/opendaylight/distribution/opendaylight-karaf/target/"
26 MAVEN_SPEC = $(BUILD_DIR)/odl_maven/settings.xml
29 # END of variables to customize
30 #############################################################################
37 @if [ ! -d "$(TOPDIR)/f_odl" ]; then ln -s "$(realpath $(BUILD_DIR))/f_odl" "$(realpath $(TOPDIR))/f_odl"; fi
41 ifeq ($(ODL_MAIN_REPO),)
42 @echo "No config-spec target for ODL, nothing to build"
45 ifeq ($(shell if [ -e .odl-build.log ];then cat .odl-build.log; fi;),$(ODL_MAIN_TAG))
46 @cd /tmp && git clone $(ODL_MAIN_REPO) && cd /tmp/controller && git checkout $(ODL_MAIN_TAG)
47 @echo "ODL is up to date"
49 @if [ ! -d "/tmp/controller" ]; then cd /tmp && git clone $(ODL_MAIN_REPO); fi;
50 @cd /tmp/controller && git checkout $(ODL_MAIN_TAG) && mvn -Dmaven.test.skip=true -gs $(MAVEN_SPEC) clean install;
51 @./make-odl-deb.sh -N $(ODL_SHORT_NAME)_`cd /tmp/controller; git rev-parse --short HEAD` -n $(ODL_SHORT_NAME) -v "$(ODL_VERSION)" -t "$(ODL_MAIN_TAG)" -m $(MAINTAINER) -d $(DEPEND) -p $(TARGET_BUILD_PATH)
52 @echo $(ODL_MAIN_TAG) > .odl-build.log
56 .PHONY: clean $(SUBCLEAN)
58 @rm -Rf /tmp/controller