Joey Armstrong | 0ebb782 | 2023-08-17 14:21:41 -0400 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | # Copyright 2018-2023 Open Networking Foundation (ONF) and the ONF Contributors |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 3 | # |
| 4 | #Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | #you may not use this file except in compliance with the License. |
| 6 | #You may obtain a copy of the License at |
| 7 | # |
| 8 | #http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | #Unless required by applicable law or agreed to in writing, software |
| 11 | #distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | #See the License for the specific language governing permissions and |
| 14 | #limitations under the License. |
| 15 | |
| 16 | ######################################################################## |
| 17 | |
| 18 | # This Makefile provides hook for Jenkins to invoke the test target for |
| 19 | # CI integration. |
| 20 | # The main Makefile for product compilation is available at |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 21 | # agent/Makefile. Please see ./README.md and ./agent/test/README.md for more |
| 22 | # details. |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 23 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 24 | # set default shell options |
| 25 | SHELL = bash -e -o pipefail |
Joey Armstrong | 0ebb782 | 2023-08-17 14:21:41 -0400 | [diff] [blame] | 26 | ## See also: https://github.com/opencord/onf-make/blob/master/makefiles/consts.mk |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 27 | |
Jason Huang | 5d9ab1a | 2020-04-15 16:53:49 +0800 | [diff] [blame] | 28 | export OPENOLT_ROOT_DIR=$(shell pwd) |
| 29 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 30 | ## Variables |
Girish Gowdra | 5287fde | 2021-07-31 00:41:45 +0000 | [diff] [blame] | 31 | OPENOLTDEVICE ?= sim |
nikesh.krishnan | 331d38c | 2023-04-06 03:24:53 +0530 | [diff] [blame] | 32 | OPENOLT_PROTO_VER ?= v5.4.6 |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 33 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 34 | DOCKER ?= docker |
| 35 | DOCKER_REGISTRY ?= |
| 36 | DOCKER_REPOSITORY ?= voltha/ |
| 37 | DOCKER_EXTRA_ARGS ?= |
Burak Gurdag | 74e3ab8 | 2020-12-17 13:35:06 +0000 | [diff] [blame] | 38 | DOCKER_TAG ?= 2.1.1 |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 39 | IMAGENAME = ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}openolt-test:${DOCKER_TAG} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 40 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 41 | DOCKER_BUILD_ARGS ?= \ |
| 42 | ${DOCKER_EXTRA_ARGS} \ |
| 43 | --build-arg OPENOLTDEVICE=${OPENOLTDEVICE} \ |
Girish Gowdra | 252f497 | 2020-09-07 21:24:01 -0700 | [diff] [blame] | 44 | --build-arg OPENOLT_PROTO_VER=${OPENOLT_PROTO_VER} |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 45 | |
Joey Armstrong | 0ebb782 | 2023-08-17 14:21:41 -0400 | [diff] [blame] | 46 | ## ----------------------------------------------------------------------- |
| 47 | ## See github::onf-make (docker --tty), docker -it inhibits jenkins logging output |
| 48 | ## https://github.com/opencord/onf-make/blob/master/makefiles/docker/include.mk#L34 |
| 49 | ## ----------------------------------------------------------------------- |
| 50 | ## Overhead from $(shell pwd) can be avoided using a ./Makefile derived path |
| 51 | ## path := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) |
| 52 | ## ----------------------------------------------------------------------- |
| 53 | |
Girish Gowdra | ddf9a16 | 2020-01-27 12:56:27 +0530 | [diff] [blame] | 54 | test: |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 55 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test test |
| 56 | |
Girish Gowdra | b0337eb | 2022-03-25 16:44:21 -0700 | [diff] [blame] | 57 | build: |
| 58 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test all |
| 59 | |
Girish Gowdra | 489425a | 2020-02-22 13:07:42 +0530 | [diff] [blame] | 60 | clean: |
| 61 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 62 | |
| 63 | cleanall: |
| 64 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C agent/test clean |
| 65 | ${DOCKER} run --rm -v $(shell pwd):/app $(shell test -t 0 && echo "-it") ${IMAGENAME} make -C protos distclean |
Joey Armstrong | 0ebb782 | 2023-08-17 14:21:41 -0400 | [diff] [blame] | 66 | |
| 67 | # [EOF] |