blob: 89967fe2ca4cf604ac2586c3ffe4e674dc775a7e [file] [log] [blame]
Girish Gowdraa707e7c2019-11-07 11:36:13 +05301#Copyright 2018-present Open Networking Foundation
Shad Ansari01b0e652018-04-05 21:02:53 +00002#
Girish Gowdraa707e7c2019-11-07 11:36:13 +05303#Licensed under the Apache License, Version 2.0 (the "License");
4#you may not use this file except in compliance with the License.
5#You may obtain a copy of the License at
Shad Ansari01b0e652018-04-05 21:02:53 +00006#
Girish Gowdraa707e7c2019-11-07 11:36:13 +05307#http://www.apache.org/licenses/LICENSE-2.0
Shad Ansari01b0e652018-04-05 21:02:53 +00008#
Girish Gowdraa707e7c2019-11-07 11:36:13 +05309#Unless required by applicable law or agreed to in writing, software
10#distributed under the License is distributed on an "AS IS" BASIS,
11#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12#See the License for the specific language governing permissions and
13#limitations under the License.
Shad Ansari01b0e652018-04-05 21:02:53 +000014
15########################################################################
16##
17##
Luca Pretee75aaa52018-04-13 12:19:12 -070018## Config
Shad Ansari01b0e652018-04-05 21:02:53 +000019##
20##
Girish Gowdra5287fde2021-07-31 00:41:45 +000021TOP_DIR=$(shell pwd)
Shad Ansari9acc9732018-10-30 18:01:44 +000022OPENOLTDEVICE ?= generic
Craig Lutgen88a22ad2018-10-04 12:30:46 -050023
Shad Ansari01b0e652018-04-05 21:02:53 +000024#
25# Three vendor proprietary source files are required to build BAL.
26# SW-BCM68620_<VER>.zip - Broadcom BAL source and Maple SDK.
27# sdk-all-<SDK_VER>.tar.gz - Broadcom Qumran SDK.
Craig Lutgenf040dba2018-09-27 11:21:43 -050028# ACCTON_BAL_<BAL_VER>-<DEV_VER>.patch - Accton/Edgecore's patch.
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000029BAL_MAJOR_VER = 3
Girish Gowdra5287fde2021-07-31 00:41:45 +000030BAL_MINOR_VER = 10
31BAL_REV_HOST_VER = 2
32BAL_REV_EMBEDDED_VER = 2
33BAL_API_SO_VER = $(BAL_MAJOR_VER).$(BAL_MINOR_VER).$(BAL_REV_HOST_VER)
34BAL_VER = $(BAL_API_SO_VER).$(BAL_REV_EMBEDDED_VER)
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +053035ifeq ("$(strip $(OPENOLTDEVICE))",$(findstring "$(strip $(OPENOLTDEVICE))", "rlt-3200g-w" "rlt-1600g-w" "rlt-1600x-w"))
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +053036DEV_VER = 20211129
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +053037# Version of Open Network Linux (ONL).
38ONL_KERN_VER_MAJOR = 4.19
Arthur Syu094df162022-04-21 17:50:06 +080039else ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
40BAL_VER = 3.10.0.0
41DEV_VER = 20220425
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +053042else
Girish Gowdra5287fde2021-07-31 00:41:45 +000043DEV_VER = 202111040101
44API_VER = 202111090101
45# Version of Open Network Linux (ONL).
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +053046ONL_KERN_VER_MAJOR = 4.14
47endif
Girish Gowdra5287fde2021-07-31 00:41:45 +000048SDK_VER = 6.5.21
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000049
50# OpenOLT Proto version.
51# This specifies the GIT tag in https://github.com/opencord/voltha-protos
52# repo that we need to refer to, to pick the right version of
53# openolt.proto and tech_profile.proto
Elia Battiston869a5de2022-02-08 11:40:58 +010054OPENOLT_PROTO_VER ?= v5.2.1
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +000055
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +053056# Variables used for Inband build
57INBAND = "n"
58VLAN_ID = 4093
59
Jason Huangdc83ba72020-11-16 22:08:43 +080060# NNI ports speed setting
61PORT_100G_SPEED ?= 100000
62PORT_25G_SPEED ?= 25000
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +053063ifeq ("$(strip $(OPENOLTDEVICE))",$(findstring "$(strip $(OPENOLTDEVICE))", "rlt-3200g-w" "rlt-1600g-w"))
64PORT_QSFP_SPEED ?= 40g
65PORT_SFP_SPEED ?= 10g
66else ifeq ("$(strip $(OPENOLTDEVICE))","rlt-1600x-w")
67PORT_QSFP_SPEED ?= 100g
68PORT_SFP_SPEED ?= 25g
69endif
Jason Huangdc83ba72020-11-16 22:08:43 +080070
Shad Ansari01b0e652018-04-05 21:02:53 +000071# Build directory
72BUILD_DIR = build
Girish Gowdraddf9a162020-01-27 12:56:27 +053073
Orhan Kupusogluec57af02021-05-12 12:38:17 +000074# Rx optical power test app
75RXTX_POWER_EXE = read_rxtx_power
76
Girish Gowdra252f4972020-09-07 21:24:01 -070077# initialiaze path of protoc binary
Girish Gowdra489425a2020-02-22 13:07:42 +053078protoc-bin = $(shell which protoc)
Girish Gowdraddf9a162020-01-27 12:56:27 +053079
Girish Gowdra252f4972020-09-07 21:24:01 -070080# initialiaze path of grpc_cpp_plugin binary
Girish Gowdra489425a2020-02-22 13:07:42 +053081grpc-cpp-plugin-bin = $(shell which grpc_cpp_plugin)
Shad Ansari2cddc552018-06-26 20:34:27 +000082
83USER := $(shell echo $(USER))
Luca Pretee75aaa52018-04-13 12:19:12 -070084#
Shad Ansari01b0e652018-04-05 21:02:53 +000085########################################################################
86##
87##
Girish Gowdra252f4972020-09-07 21:24:01 -070088## Initialize various build flags
Shad Ansari01b0e652018-04-05 21:02:53 +000089##
90##
91HOST_SYSTEM = $(shell uname | cut -f 1 -d_)
92SYSTEM ?= $(HOST_SYSTEM)
Luca Pretee75aaa52018-04-13 12:19:12 -070093
Humera Kouser5ac56612019-07-25 20:23:01 -040094VERSION ?= $(shell cat ../VERSION)
95
96#set ref and commit date only if committed
97LABEL_VCS_URL ?= $(shell git remote get-url $(shell git remote))
98LABEL_VCS_REF = $(shell git rev-parse HEAD)
99LABEL_BUILD_DATE ?= $(shell date -u "+%Y-%m-%dT%H:%M:%SZ")
100LABEL_COMMIT_DATE = $(shell git show -s --format=%cd --date=iso-strict HEAD)
101
Craig Lutgenf040dba2018-09-27 11:21:43 -0500102LIBGRPC_PATH=$(shell pkg-config --libs-only-L grpc | sed s/-L// | sed s/\ //g)
Girish Gowdra252f4972020-09-07 21:24:01 -0700103LIBZ_PATH=$(shell pkg-config --libs-only-L zlib | sed s/-L// | sed s/\ //g)
Craig Lutgenf040dba2018-09-27 11:21:43 -0500104LIBPROTOBUF_PATH=$(shell PKG_CONFIG_ALLOW_SYSTEM_LIBS=true pkg-config --libs-only-L protobuf | sed s/-L// | sed s/\ //g)
105
Girish Gowdra1935e6a2020-10-31 21:48:22 -0700106PCAPPLUSPLUS_INCLUDE_PATH=-I/usr/local/include/pcapplusplus/
107PCAPPLUSPLUS_LIB_PATH=-lPcap++ -lPacket++ -lCommon++
108
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +0530109ifeq ("$(strip $(OPENOLTDEVICE))",$(findstring "$(strip $(OPENOLTDEVICE))", "rlt-3200g-w" "rlt-1600g-w" "rlt-1600x-w"))
110CXX = @CXX@-6
111else
112CXX = @CXX@-4.9
113endif
Craig Lutgenf040dba2018-09-27 11:21:43 -0500114CXXFLAGS += @CXXFLAGS@
115CXXFLAGS += $(shell pkg-config --cflags-only-I grpc++)
Girish Gowdra1935e6a2020-10-31 21:48:22 -0700116CXXFLAGS += $(PCAPPLUSPLUS_INCLUDE_PATH)
Humera Kouser5ac56612019-07-25 20:23:01 -0400117CPPFLAGS += @CPPFLAGS@
Shad Ansari01b0e652018-04-05 21:02:53 +0000118CPPFLAGS += `pkg-config --cflags protobuf grpc`
Girish Gowdra252f4972020-09-07 21:24:01 -0700119
120# Enabling SCALE_AND_PERF for higher performance and scaling to 512 subscribers. Enabling the flag will
121# disable the handling in FLOW_CHECKER and also disable flow statistics
Humera Kouser5ac56612019-07-25 20:23:01 -0400122CPPFLAGS += -DVERSION=\"$(VERSION)\" -DBAL_VER=\"$(BAL_VER)\" -DLABEL_VCS_URL=\"$(LABEL_VCS_URL)\" \
123 -DLABEL_VCS_REF=\"$(LABEL_VCS_REF)\" -DLABEL_BUILD_DATE=\"$(LABEL_BUILD_DATE)\" \
Girish Gowdra5287fde2021-07-31 00:41:45 +0000124 -DLABEL_COMMIT_DATE=\"$(LABEL_COMMIT_DATE)\" -DFLOW_CHECKER -USCALE_AND_PERF
Humera Kouser6143c9e2020-06-17 22:37:31 +0530125CPPFLAGS += -I./
Craig Lutgen7ebee132018-11-16 15:31:11 -0600126CXXFLAGS += -std=c++11 -fpermissive -Wno-literal-suffix
Craig Lutgenf040dba2018-09-27 11:21:43 -0500127LDFLAGS += @LDFLAGS@
128LDFLAGS += `pkg-config --libs protobuf grpc++ grpc` -ldl -lgpr
Shad Ansari9acc9732018-10-30 18:01:44 +0000129CXXFLAGSDEVICE = -I./device -I./device/$(OPENOLTDEVICE) -I./device/generic
Craig Lutgenf040dba2018-09-27 11:21:43 -0500130
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000131export CXX CXXFLAGS OPENOLT_PROTO_VER
Luca Pretee75aaa52018-04-13 12:19:12 -0700132
Shad Ansari01b0e652018-04-05 21:02:53 +0000133########################################################################
134##
135##
Luca Pretee75aaa52018-04-13 12:19:12 -0700136## ONL
Shad Ansari01b0e652018-04-05 21:02:53 +0000137##
138##
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000139ONL_REPO = onl
Shad Ansari01b0e652018-04-05 21:02:53 +0000140ONL_DIR = $(BUILD_DIR)/$(ONL_REPO)
Arthur Syu094df162022-04-21 17:50:06 +0800141ONL_COMMIT_ID = 11ed2140
Shad Ansari01b0e652018-04-05 21:02:53 +0000142onl:
143 if [ ! -d "$(ONL_DIR)/OpenNetworkLinux" ]; then \
144 mkdir -p $(ONL_DIR); \
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000145 git clone https://github.com/opencomputeproject/OpenNetworkLinux.git $(ONL_DIR)/OpenNetworkLinux; \
Arthur Syu094df162022-04-21 17:50:06 +0800146 if [ "$(OPENOLTDEVICE)" = "sda3016ss" ]; then \
147 tar zxvf download/onl_zyxel_sda3016ss.tar.gz -C $(ONL_DIR)/OpenNetworkLinux; \
148 cp download/onl_workaround.patch $(ONL_DIR)/OpenNetworkLinux; \
149 cd $(ONL_DIR)/OpenNetworkLinux; \
150 git checkout $(ONL_COMMIT_ID); \
151 git apply --whitespace=nowarn onl_zyxel_sda3016ss.patch; \
152 git apply --whitespace=nowarn onl_workaround.patch; \
153 export VERSION=8; \
154 make docker; \
155 cd packages/base/amd64/kernels/kernel-4.19-lts-x86-64-all/builds/jessie; tar zcf linux-4.19.81.tgz linux-4.19.81; \
156 mv $(BUILD_DIR)/$(ONL_REPO)/OpenNetworkLinux/packages/base/amd64/kernels/kernel-4.19-lts-x86-64-all/builds/jessie/linux-4.19.81.tgz download/; \
157 else \
158 cp download/Makefile.onl $(ONL_DIR)/Makefile; \
159 install -m 755 download/build-onl.sh $(ONL_DIR)/OpenNetworkLinux; \
160 cp download/disable-certificate-validation*.patch $(ONL_DIR)/OpenNetworkLinux; \
161 if [ "$(OPENOLTDEVICE)" = "rlt-3200g-w" ] || [ "$(OPENOLTDEVICE)" = "rlt-1600g-w" ] || [ "$(OPENOLTDEVICE)" = "rlt-1600x-w" ]; \
162 then \
163 cp $(TOP_DIR)/device/$(OPENOLTDEVICE)/update_kernel_options.sh $(ONL_DIR)/OpenNetworkLinux/.; \
164 chmod 0755 $(ONL_DIR)/OpenNetworkLinux/update_kernel_options.sh; \
165 fi; \
166 make -C $(ONL_DIR) onl-$(ONL_KERN_VER_MAJOR) INBAND=n BOARD=$(OPENOLTDEVICE); \
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +0530167 fi; \
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530168 else \
169 if [ "$(INBAND)" = n -a "$$(grep "inband" $(ONL_DIR)/onl_build.mode | cut -d= -f 2)" = y ]; then \
170 make -C $(ONL_DIR) onl-$(ONL_KERN_VER_MAJOR) INBAND=n; \
171 fi; \
Shad Ansari01b0e652018-04-05 21:02:53 +0000172 fi;
173onl-force:
Shad Ansari9acc9732018-10-30 18:01:44 +0000174 make -C $(ONL_DIR) $(OPENOLTDEVICE)-$(ONL_KERN_VER_MAJOR)
Shad Ansari01b0e652018-04-05 21:02:53 +0000175distclean-onl:
176 sudo rm -rf $(ONL_DIR)
177
Girish Gowdra5287fde2021-07-31 00:41:45 +0000178
Shad Ansari01b0e652018-04-05 21:02:53 +0000179########################################################################
180##
181##
Girish Gowdra5287fde2021-07-31 00:41:45 +0000182## Broadcom LIBRARY OSS API
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000183##
184##
Girish Gowdra5287fde2021-07-31 00:41:45 +0000185BAL_API_DIR = $(TOP_DIR)/$(BUILD_DIR)/bal-oss-api-$(BAL_VER)
186BAL_API_PATCH = ACCTON_BAL_API_$(BAL_VER)-V$(API_VER).patch
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000187
Girish Gowdra5287fde2021-07-31 00:41:45 +0000188$(BUILD_DIR)/libbal_host_api-oss.so:
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000189 if [ ! -d "$(BAL_API_DIR)" ]; then \
190 mkdir -p $(BAL_API_DIR); \
Girish Gowdra5287fde2021-07-31 00:41:45 +0000191 cd $(BAL_API_DIR); \
192 git clone https://github.com/balapi/bal-sdk.git -b $(BAL_VER); \
193 mv bal-sdk bal-sdk-$(BAL_VER); \
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530194 if [ "$(OPENOLTDEVICE)" = "rlt-3200g-w" ] || [ "$(OPENOLTDEVICE)" = "rlt-1600g-w" ] || [ "$(OPENOLTDEVICE)" = "rlt-1600x-w" ]; \
195 then \
196 cd $(BAL_API_DIR)/bal-sdk-$(BAL_VER); \
197 make; \
198 cp build/fs/libbal_host_api-oss.$(BAL_API_SO_VER).so ../../../$(BUILD_DIR)/libbal_host_api-oss.so; \
199 cd .. && ln -s bal-sdk-$(BAL_VER)/build/fs/include include; \
200 cd; \
201 else \
202 cat $(TOP_DIR)/download/$(BAL_API_PATCH) | patch -p1 -d $(BAL_API_DIR)/bal-sdk-$(BAL_VER); \
203 cd $(BAL_API_DIR)/bal-sdk-$(BAL_VER); \
204 make BOARD=$(OPENOLTDEVICE); \
205 cp build/fs/libbal_host_api-oss.$(BAL_API_SO_VER).so ../../../$(BUILD_DIR)/libbal_host_api-oss.so; \
206 cp config/$(OPENOLTDEVICE)/bcm_config.h build/fs/include; \
207 cd .. && ln -s bal-sdk-$(BAL_VER)/build/fs/include include; \
208 cd; \
209 fi; \
Girish Gowdrafc6c0bf2022-01-28 18:31:30 -0800210 else \
211 cd $(BAL_API_DIR)/bal-sdk-$(BAL_VER); \
212 cp build/fs/libbal_host_api-oss.$(BAL_API_SO_VER).so ../../../$(BUILD_DIR)/libbal_host_api-oss.so; \
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530213 if [ "$(OPENOLTDEVICE)" != "rlt-3200g-w" ] && [ "$(OPENOLTDEVICE)" != "rlt-1600g-w" ] && [ "$(OPENOLTDEVICE)" != "rlt-1600x-w" ]; \
214 then \
215 cp config/$(OPENOLTDEVICE)/bcm_config.h build/fs/include; \
216 fi; \
Girish Gowdrafc6c0bf2022-01-28 18:31:30 -0800217 cd .. && ln -s bal-sdk-$(BAL_VER)/build/fs/include include; \
218 cd; \
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000219 fi;
Girish Gowdra5287fde2021-07-31 00:41:45 +0000220
221
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000222bal-api-clean:
Girish Gowdra5287fde2021-07-31 00:41:45 +0000223 if [ -d "$(BAL_API_DIR)" ]; then \
224 rm -rf $(BAL_API_DIR); \
225 fi;
226 rm -rf $(BUILD_DIR)/libbal_host_api-oss.so
227
228########################################################################
229#
230# Choose api type: open api (api-oss) or proprietary api (api-nda-req)
231BAL_API_TYPE = api-oss
Arthur Syu094df162022-04-21 17:50:06 +0800232#BAL_API_TYPE = api-nda_req
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000233
234########################################################################
235##
236##
Girish Gowdra5287fde2021-07-31 00:41:45 +0000237## BAL OSS API
Shad Ansari01b0e652018-04-05 21:02:53 +0000238##
239##
Shad Ansari9acc9732018-10-30 18:01:44 +0000240BAL_DIR = $(BUILD_DIR)/$(OPENOLTDEVICE)-bal
Girish Gowdra5287fde2021-07-31 00:41:45 +0000241BALLIBDIR = $(BUILD_DIR)
242BALLIBNAME = bal_host_$(BAL_API_TYPE)
243BAL_INC = -I$(BAL_API_DIR)/include
Arthur Syu094df162022-04-21 17:50:06 +0800244ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
245BALLIBDIR = $(BAL_DIR)/build/host_reference/host_api
246BAL_INC += -I$(BAL_DIR)/host_driver/bal/bal_include \
247 -I$(BAL_DIR)/host_driver/topology \
248 -I$(BAL_DIR)/host_driver/utils \
249 -I$(BAL_DIR)/host_driver/api \
250 -I$(BAL_DIR)/host_driver/metadata \
251 -I$(BAL_DIR)/host_customized/os_abstraction \
252 -I$(BAL_DIR)/host_customized/os_abstraction/posix \
253 -I$(BAL_DIR)/host_customized/config \
254 -I$(BAL_DIR)/host_driver/api_conn_mgr \
255 -I$(BAL_DIR)/host_driver/conn_mgr \
256 -I$(BAL_DIR)/host_driver/api/host/topology \
257 -I$(BAL_DIR)/host_driver/system_types \
258 -I$(BAL_DIR)/host_driver/transport \
259 -I$(BAL_DIR)/host_reference/cli \
260 -I$(BAL_DIR)/host_reference/api_cli \
261 -I$(BAL_DIR)/host_reference/dev_log \
262 -I$(BAL_DIR)/host_reference/host_api \
263 -I$(BAL_DIR)/lib/cmdline
264endif
Girish Gowdra5287fde2021-07-31 00:41:45 +0000265CXXFLAGS += $(BAL_INC)
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000266CXXFLAGS += -DBCMOS_MSG_QUEUE_DOMAIN_SOCKET -DBCMOS_MSG_QUEUE_UDP_SOCKET -DBCMOS_MEM_CHECK -DBCMOS_SYS_UNITTEST -DENABLE_LOG -DENABLE_CLI
Jason Huangdc83ba72020-11-16 22:08:43 +0800267PORT_SPEED_FILE = $(BAL_DIR)/switch_sdk/$(SDK_VER)/rc/$(OPENOLTDEVICE)/board_files/broadcom/port_speed.soc
Shad Ansaricb004c52018-05-30 18:07:23 +0000268
Girish Gowdra5287fde2021-07-31 00:41:45 +0000269########################################################################
270##
271## BAL proprietary elements - NDA is required with Broadcom
272##
273## For Accton patch - contact Accton corporation
274##
275## Not required when building the OpenOLT agent from github source
276##
277## !!!NOTE: libbal_host_api-nda_req.so is proprietary and must not be
278## published in any open debian package or otherwise made
279## available to third parties that do not have an SLA and
280## NDA with Broadcom
281##
282BAL_SDK_ZIP = SW-BCM686OLT_$(subst .,_,$(BAL_VER)).tgz
283CSG_SDK_ZIP = sdk-all-$(SDK_VER).tar.gz
284ACCTON_PATCH = ACCTON_BAL_$(BAL_VER)-V$(DEV_VER).patch
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530285RADISYS_PATCH = RADISYS_BAL_$(BAL_VER)_V$(DEV_VER).patch
Girish Gowdra5287fde2021-07-31 00:41:45 +0000286BROADCOM_IP_PATCH = ACCTON_BAL_$(BAL_VER)-V$(DEV_VER)-BROADCOM-IP.patch
287BCM_SWITCH_SDK = $(BAL_DIR)/switch_sdk/$(SDK_VER)
Arthur Syu094df162022-04-21 17:50:06 +0800288ZYXEL_PATCH = ZYXEL_BAL_$(BAL_VER)_V$(DEV_VER).patch
Girish Gowdra5287fde2021-07-31 00:41:45 +0000289
290sdk: onl
Shad Ansari01b0e652018-04-05 21:02:53 +0000291ifeq ("$(wildcard $(BAL_DIR))","")
292 mkdir $(BAL_DIR)
Girish Gowdra5287fde2021-07-31 00:41:45 +0000293 tar zxvf download/$(BAL_SDK_ZIP) --strip 1 -C $(BAL_DIR)
294 cp download/$(CSG_SDK_ZIP) $(BCM_SWITCH_SDK)
Shad Ansari01b0e652018-04-05 21:02:53 +0000295 chmod -R 744 $(BAL_DIR)
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530296ifeq ("$(strip $(OPENOLTDEVICE))",$(findstring "$(strip $(OPENOLTDEVICE))", "rlt-3200g-w" "rlt-1600g-w" "rlt-1600x-w"))
297 cat download/$(RADISYS_PATCH) | patch -p1 -d $(BAL_DIR)
Arthur Syu094df162022-04-21 17:50:06 +0800298else ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
299 tar zxf download/sda3016ss_rootfs.tar.gz -C $(BAL_DIR)
300 cat download/$(ZYXEL_PATCH) | patch -p1 -d $(BAL_DIR)
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530301else
Girish Gowdra5287fde2021-07-31 00:41:45 +0000302 cat download/$(ACCTON_PATCH) | patch -p1 -d $(BAL_DIR)
303 cat download/$(BROADCOM_IP_PATCH) | patch -p1 -d $(BAL_DIR)
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530304endif
Girish Gowdra5287fde2021-07-31 00:41:45 +0000305
Jason Huangdc83ba72020-11-16 22:08:43 +0800306ifeq ("$(strip $(OPENOLTDEVICE))","asfvolt16")
307 echo "setenv port_speed_for_100 $(PORT_100G_SPEED)" > $(PORT_SPEED_FILE)
308else ifeq ("$(strip $(OPENOLTDEVICE))","asgvolt64")
309 echo "setenv port_speed_for_100 $(PORT_100G_SPEED)" > $(PORT_SPEED_FILE)
310 echo "setenv port_speed_for_25 $(PORT_25G_SPEED)" >> $(PORT_SPEED_FILE)
311endif
Girish Gowdra5287fde2021-07-31 00:41:45 +0000312
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +0530313ifeq ("$(strip $(OPENOLTDEVICE))",$(findstring "$(strip $(OPENOLTDEVICE))", "rlt-3200g-w" "rlt-1600g-w" "rlt-1600x-w"))
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +0530314 chmod 0755 $(BAL_DIR)/onu_mgmt/libomcistack/me_codegen/omci_stack_codegen
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530315 chmod 0755 $(BCM_SWITCH_SDK)/sdk_patches_apply.sh
316 make -C $(BAL_DIR) BOARD=radisys ONL=$(TOP_DIR)/$(ONL_DIR)/OpenNetworkLinux ONL_DEBIAN_SUITE=$(shell lsb_release -c -s)
317 make -C $(BAL_DIR) BOARD=radisys release_board
Arthur Syu094df162022-04-21 17:50:06 +0800318else ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
319 cp download/Dockerfile $(BAL_DIR)
320 tar zxf download/linux-4.19.81.tgz -C $(BAL_DIR)
321 docker build $(BAL_DIR) -t tt_ub18
322 docker run -v $(TOP_DIR)/$(BAL_DIR):/mnt -w /mnt tt_ub18 bash -c 'make'
323 cp download/sda3016_nni_init.conf $(BAL_DIR)/sda3016ss_rootfs/opt/bcm68620/
324 docker run -v $(TOP_DIR)/$(BAL_DIR):/mnt -w /mnt tt_ub18 bash -c 'make release_board'
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +0530325else
Girish Gowdra5287fde2021-07-31 00:41:45 +0000326 make -C $(BAL_DIR) BOARD=$(OPENOLTDEVICE) ONL_DIR=$(TOP_DIR)/$(ONL_DIR)/OpenNetworkLinux
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000327 make -C $(BAL_DIR) BOARD=$(OPENOLTDEVICE) release_board
Shad Ansari01b0e652018-04-05 21:02:53 +0000328endif
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +0530329endif
Shad Ansaricb004c52018-05-30 18:07:23 +0000330
Shad Ansaricb004c52018-05-30 18:07:23 +0000331bal-clean:
Arthur Syu094df162022-04-21 17:50:06 +0800332ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
333 docker run -v $(TOP_DIR)/$(BAL_DIR):/mnt -w /mnt tt_ub18 bash -c 'make clean_all'
334else
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000335 make -C $(BAL_DIR) BOARD=$(OPENOLTDEVICE) clean_all
Arthur Syu094df162022-04-21 17:50:06 +0800336endif
Shad Ansari01b0e652018-04-05 21:02:53 +0000337########################################################################
338##
339##
Luca Pretee75aaa52018-04-13 12:19:12 -0700340## OpenOLT API
Shad Ansari01b0e652018-04-05 21:02:53 +0000341##
342##
Shad Ansari56c8ea42018-10-30 19:34:35 +0000343OPENOLT_PROTOS_DIR = ../protos
Shad Ansari19249582018-04-30 04:31:00 +0000344OPENOLT_API_LIB = $(OPENOLT_PROTOS_DIR)/libopenoltapi.a
Girish Gowdra252f4972020-09-07 21:24:01 -0700345CXXFLAGS += -I$(OPENOLT_PROTOS_DIR) -I./device -I./device/$(OPENOLTDEVICE) -I$(OPENOLT_PROTOS_DIR)/googleapis/gens
Shad Ansari19249582018-04-30 04:31:00 +0000346protos:
Girish Gowdrafc6c0bf2022-01-28 18:31:30 -0800347 if [ ! -f "$(OPENOLT_API_LIB)" ]; then \
348 make -C $(OPENOLT_PROTOS_DIR) all; \
349 fi;
Shad Ansaricc01de12018-05-21 22:54:45 +0000350protos-clean:
Shad Ansari19249582018-04-30 04:31:00 +0000351 -make -C $(OPENOLT_PROTOS_DIR) clean
Shad Ansari01b0e652018-04-05 21:02:53 +0000352
353########################################################################
354##
355##
Shad Ansari627b5782018-08-13 22:49:32 +0000356## common
Shad Ansari7193ae22018-08-08 22:23:18 +0000357##
358##
Girish Gowdrafe649702019-10-30 12:49:58 +0530359
360# A hack to force a re-build of common/main.cc everytime.
361# This is needed to bake in the git VCS information in the openolt binary
362# at the time of building the openolt package.
363common/main.o: .FORCE
364.FORCE:
365 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -I./common -c common/main.cc -o common/main.o
366
Shad Ansari627b5782018-08-13 22:49:32 +0000367common/%.o: common/%.cc
Humera Kouser5ac56612019-07-25 20:23:01 -0400368 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -I./common -c $< -o $@
Shad Ansari7193ae22018-08-08 22:23:18 +0000369
370########################################################################
371##
372##
Craig Lutgen88a22ad2018-10-04 12:30:46 -0500373## device
374##
375##
Girish Gowdrab0337eb2022-03-25 16:44:21 -0700376device/%.o: device/%.cc
377 $(CXX) $(CXXFLAGS) $(CXXFLAGSDEVICE) -I./common -I./src -c $< -o $@
Craig Lutgen88a22ad2018-10-04 12:30:46 -0500378
Girish Gowdrab0337eb2022-03-25 16:44:21 -0700379device/$(OPENOLTDEVICE)/%.o: device/$(OPENOLTDEVICE)/%.cc
Craig Lutgen88a22ad2018-10-04 12:30:46 -0500380 $(CXX) $(CXXFLAGS) $(CXXFLAGSDEVICE) -c $< -o $@
381
382########################################################################
383##
384##
Shad Ansari627b5782018-08-13 22:49:32 +0000385## openolt
386##
387##
Humera Kouser9c2bd9f2020-09-25 02:41:29 -0400388OLT_SW_UPGRADE_DIR = ../olt-sw-upgrade
Girish Gowdrab0337eb2022-03-25 16:44:21 -0700389SRCS = $(wildcard src/*.cc) $(wildcard common/*.cc) $(wildcard device/*.cc) $(wildcard device/$(OPENOLTDEVICE)/*.cc)
Humera Kouser9c2bd9f2020-09-25 02:41:29 -0400390ANSIBLE_DIR = /etc/ansible
Shad Ansari01b0e652018-04-05 21:02:53 +0000391OBJS = $(SRCS:.cc=.o)
392DEPS = $(SRCS:.cc=.d)
Arthur Syu094df162022-04-21 17:50:06 +0800393ZYXEL_DOCKER_PATCH = ZYXEL_Docker_V$(DEV_VER).patch
394
395ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
396PREREQ = sdk
397else
398PREREQ = $(BUILD_DIR)/lib$(BALLIBNAME).so sdk protos $(OBJS)
399endif
Shad Ansari01b0e652018-04-05 21:02:53 +0000400.DEFAULT_GOAL := all
Shad Ansari2ae27672019-05-09 00:26:34 +0000401all: $(BUILD_DIR)/openolt
Arthur Syu094df162022-04-21 17:50:06 +0800402$(BUILD_DIR)/openolt: $(PREREQ)
403ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
404 if [ ! -f "Dockerfile" ]; then \
405 git apply --whitespace=nowarn download/$(ZYXEL_DOCKER_PATCH); \
406 fi;
407 if !(docker images | grep -q onl-builder-8-openolt); then \
408 docker build . -t onl-builder-8-openolt; \
409 fi;
410 docker/tools/onlbuilder -8 --isolate -c make -C agent OPENOLTDEVICE=sda3016ss openolt-in-docker
411else
Girish Gowdra1935e6a2020-10-31 21:48:22 -0700412 $(CXX) $(LDFLAGS) -L$(BALLIBDIR) $(OBJS) $(OPENOLT_API_LIB) $(LIBPROTOBUF_PATH)/libprotobuf.a -o $@ -l$(BALLIBNAME) $(shell pkg-config --libs protobuf grpc++ grpc) $(PCAPPLUSPLUS_LIB_PATH)
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530413ifeq ("$(strip $(OPENOLTDEVICE))",$(findstring "$(strip $(OPENOLTDEVICE))", "rlt-3200g-w" "rlt-1600g-w" "rlt-1600x-w"))
414 ln -sf $(TOP_DIR)/$(BAL_DIR)/build/fs/radisys/release/release_radisys_v$(BAL_VER).tar.gz $(BUILD_DIR)/release_$(OPENOLTDEVICE)_V$(BAL_VER).$(DEV_VER).tar.gz
415else
Jason Huang09b73ea2020-01-08 17:52:05 +0800416 ln -sf $(TOP_DIR)/$(BAL_DIR)/build/fs/$(OPENOLTDEVICE)/release/release_$(OPENOLTDEVICE)_V$(BAL_VER).$(DEV_VER).tar.gz $(BUILD_DIR)/.
Thiyagarajan Subramaniaf1a5fb2022-02-24 18:32:05 +0530417endif
Girish Gowdra252f4972020-09-07 21:24:01 -0700418 ln -sf $(LIBGRPC_PATH)/libz.so.1 $(BUILD_DIR)/libz.so.1
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000419 ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $(BUILD_DIR)/libstdc++.so.6
420 strip $(BUILD_DIR)/openolt
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530421 echo "inband=n" > $(ONL_DIR)/onl_build.mode
422 if [ $(INBAND) = y ]; then \
423 echo "Building ONL+BAL+OpenoltAgent allinone image"; \
424 make deb; \
425 make inband-onl; \
426 fi;
Arthur Syu094df162022-04-21 17:50:06 +0800427endif
428
429openolt-in-docker: protos $(OBJS)
430 $(CXX) $(LDFLAGS) -L$(BALLIBDIR) $(OBJS) $(OPENOLT_API_LIB) $(LIBPROTOBUF_PATH)/libprotobuf.a -o $(BUILD_DIR)/openolt -l$(BALLIBNAME) $(shell pkg-config --libs protobuf grpc++ grpc) $(PCAPPLUSPLUS_LIB_PATH)
431 ln -sf $(TOP_DIR)/$(BAL_DIR)/release_$(OPENOLTDEVICE)_V$(BAL_VER)-$(DEV_VER).tar.gz $(BUILD_DIR)/.
432 ln -sf $(TOP_DIR)/$(BAL_DIR)/build/host_reference/host_api/strip/libbal_host_$(BAL_API_TYPE).so $(BUILD_DIR)/.
433 ln -sf $(TOP_DIR)/$(BAL_DIR)/build/host_driver/dev_mgmt_daemon/dev_mgmt_daemon $(BUILD_DIR)/.
434 ln -sf $(LIBGRPC_PATH)/libz.so.1 $(BUILD_DIR)/libz.so.1
435 ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $(BUILD_DIR)/libstdc++.so.6
436 strip $(BUILD_DIR)/openolt
437 echo "inband=n" > $(ONL_DIR)/onl_build.mode
438 mkdir -p tmp/opt/openolt
439 cp build/libbal_host_$(BAL_API_TYPE).so build/openolt tmp/opt/openolt
440 tar zcf build/release_$(OPENOLTDEVICE)_openolt_V$(BAL_VER)-$(DEV_VER).tar.gz tmp/
441 rm -rf tmp
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530442
Shad Ansari627b5782018-08-13 22:49:32 +0000443src/%.o: src/%.cc
Humera Kouser5ac56612019-07-25 20:23:01 -0400444 $(CXX) $(CXXFLAGS) $(CXXFLAGSDEVICE) $(CPPFLAGS) -I./common -c $< -o $@
Shad Ansari01b0e652018-04-05 21:02:53 +0000445
Orhan Kupusogluec57af02021-05-12 12:38:17 +0000446deb: rxtx-power
Arthur Syu094df162022-04-21 17:50:06 +0800447ifeq ("$(strip $(OPENOLTDEVICE))","sda3016ss")
448 mkdir -p device/$(OPENOLTDEVICE)/mkdebian/tmp
449 cp download/release_$(OPENOLTDEVICE)_custom_V2.0.0.1-$(DEV_VER).tar.gz device/$(OPENOLTDEVICE)/mkdebian/tmp
450 cp $(BUILD_DIR)/release_$(OPENOLTDEVICE)_V$(BAL_VER)-$(DEV_VER) device/$(OPENOLTDEVICE)/mkdebian/tmp
451 cp $(BUILD_DIR)/release_$(OPENOLTDEVICE)_openolt_V$(BAL_VER)-$(DEV_VER).tar.gz device/$(OPENOLTDEVICE)/mkdebian/tmp
452else
Jason Huang09b73ea2020-01-08 17:52:05 +0800453 cp $(BUILD_DIR)/release_$(OPENOLTDEVICE)_V$(BAL_VER).$(DEV_VER).tar.gz device/$(OPENOLTDEVICE)/mkdebian/debian
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000454 cp $(BUILD_DIR)/openolt device/$(OPENOLTDEVICE)/mkdebian/debian
Girish Gowdra252f4972020-09-07 21:24:01 -0700455 cp $(BUILD_DIR)/libz.so.1 device/$(OPENOLTDEVICE)/mkdebian/debian
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000456 cp $(BUILD_DIR)/libstdc++.so.6 device/$(OPENOLTDEVICE)/mkdebian/debian
Girish Gowdra5287fde2021-07-31 00:41:45 +0000457 cp $(BUILD_DIR)/libbal_host_api-oss.so device/$(OPENOLTDEVICE)/mkdebian/debian
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000458 cp -a scripts/init.d device/$(OPENOLTDEVICE)/mkdebian/debian
Orhan Kupusogluec57af02021-05-12 12:38:17 +0000459 cp -a $(RXTX_POWER_EXE) device/$(OPENOLTDEVICE)/mkdebian/debian
Arthur Syu094df162022-04-21 17:50:06 +0800460 cp -a scripts/watchdog device/$(OPENOLTDEVICE)/mkdebian/debian
461endif
Thiyagarajan Subramani4e62e172021-06-25 17:31:30 +0530462ifeq ("$(strip $(OPENOLTDEVICE))",$(findstring "$(strip $(OPENOLTDEVICE))", "rlt-3200g-w" "rlt-1600g-w" "rlt-1600x-w"))
463 sed -i '/\/opt\/bcm68650\/svk_init.sh/c\ \/opt\/bcm68650\/svk_init.sh -qsfp_speed=$(PORT_QSFP_SPEED) -sfp_speed=$(PORT_SFP_SPEED)' device/$(OPENOLTDEVICE)/mkdebian/debian/init.d/dev_mgmt_daemon
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +0530464endif
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000465 cd device/$(OPENOLTDEVICE)/mkdebian && ./build_$(OPENOLTDEVICE)_deb.sh
Thiyagarajan Subramani3e8bfd92021-04-26 15:07:14 +0530466 mv device/$(OPENOLTDEVICE)/$(OPENOLTDEVICE)_*.deb $(BUILD_DIR)/openolt_$(OPENOLTDEVICE)-$(VERSION)-$(LABEL_VCS_REF).deb
Shad Ansaricb004c52018-05-30 18:07:23 +0000467 make deb-cleanup
Shad Ansari6cd46a62018-05-13 23:20:51 +0000468
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530469inband-onl:
470 # Clean previous ONL build and build freshly
471 sudo rm -rf $(ONL_DIR)
472 mkdir -p $(ONL_DIR)
473 git clone https://github.com/opencomputeproject/OpenNetworkLinux.git $(ONL_DIR)/OpenNetworkLinux
474 cp download/Makefile.onl $(ONL_DIR)/Makefile
475 install -m 755 download/build-onl.sh $(ONL_DIR)/OpenNetworkLinux
476
477 # Check ONL commit equals to Inband patch commit
478 ONL_COMMIT_ID=$(awk \'/COMMIT_ID = /{print $0}\' $(ONL_DIR)/Makefile | awk -F \"=\" \'{print $2}\')
479 INBAND_PATCH_COMMIT_ID=$(echo cp $(TOP_DIR)/inband/patch/*.patch | cut -d- -f 2 | cut -d. -f 1)
480 if [ "$(ONL_COMMIT_ID)" = "$(INBAND_PATCH_COMMIT_ID)" ]; then \
481 echo "ONL commit and inband patch commit matched."; \
482 cp $(TOP_DIR)/inband/patch/*.patch $(ONL_DIR)/OpenNetworkLinux; \
Girish Gowdraa1640802021-11-24 20:24:38 -0800483 cp $(TOP_DIR)/download/disable-certificate-validation-v*.patch $(ONL_DIR)/OpenNetworkLinux; \
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530484 else \
485 echo "ONL commit and inband patch commit does not match. Exiting."; \
486 exit 1; \
487 fi;
488
Girish Gowdra6e745522020-07-15 15:52:13 -0700489 # Update inband.config file with VLAN ID argument passed
490 sed -i 's/asfvolt16_vlan_id_eth2=.*/asfvolt16_vlan_id_eth2=$(VLAN_ID)/' $(TOP_DIR)/inband/config/inband.config
491 sed -i 's/asgvolt64_vlan_id_eth1=.*/asgvolt64_vlan_id_eth1=$(VLAN_ID)/' $(TOP_DIR)/inband/config/inband.config
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530492
493 # Copy Inband config files and olt startup scripts to ONL source code and build
494 cd $(TOP_DIR) && mkdir -p $(ONL_DIR)/OpenNetworkLinux/bal_packages
495 cp $(TOP_DIR)/inband/scripts/* $(ONL_DIR)/OpenNetworkLinux/bal_packages
Girish Gowdra6e745522020-07-15 15:52:13 -0700496 cp $(TOP_DIR)/inband/config/inband.config $(ONL_DIR)/OpenNetworkLinux/bal_packages
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530497 cp $(BUILD_DIR)/openolt_$(OPENOLTDEVICE)-$(VERSION)-$(LABEL_VCS_REF).deb $(ONL_DIR)/OpenNetworkLinux/bal_packages/openolt_$(OPENOLTDEVICE).deb
Humera Kouser9c2bd9f2020-09-25 02:41:29 -0400498 cp $(OLT_SW_UPGRADE_DIR)/change_labels.sh $(ONL_DIR)/OpenNetworkLinux/bal_packages
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530499
500 # Rebuild ONL packed with already built BAL+Openolt debian package
501 make -C $(ONL_DIR) onl-$(ONL_KERN_VER_MAJOR) INBAND=y
502 echo "inband=y" > $(ONL_DIR)/onl_build.mode
503 make inband-onl-cleanup
Humera Kouser9c2bd9f2020-09-25 02:41:29 -0400504# requires 'sudo' privileges
505
506ansible:
507 (ONL_INSTALLED_INSTALLER="$(shell find "$$(cd ./build/onl/OpenNetworkLinux/RELEASE/jessie/amd64; pwd)" -name "ONL-onl-*_AMD64_INSTALLED_INSTALLER")"; \
508 rm -rf $(ANSIBLE_DIR)/roles/upgrade/files; \
509 mkdir -p $(ANSIBLE_DIR)/roles/upgrade/files; \
510 cp ../olt-sw-upgrade/install_onl.sh $(ANSIBLE_DIR)/roles/upgrade/files; \
511 chmod +x $(ANSIBLE_DIR)/roles/upgrade/files/*.sh; \
512 ln -s $$ONL_INSTALLED_INSTALLER $(ANSIBLE_DIR)/roles/upgrade/files/ONL_INSTALLED_INSTALLER)
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530513
Shad Ansari01b0e652018-04-05 21:02:53 +0000514src/%.o: %.cpp
515 $(CXX) -MMD -c $< -o $@
516
Orhan Kupusogluec57af02021-05-12 12:38:17 +0000517rxtx-power: clean-rxtx-power
518 $(CXX) -std=c++11 -DRXTX_POWER_EXE_MODE src/trx_eeprom_reader.cc -o $(RXTX_POWER_EXE) && ls -l $(RXTX_POWER_EXE)
519
520deb-cleanup: clean-rxtx-power
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000521 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/$(OPENOLTDEVICE).debhelper.log
522 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/$(OPENOLTDEVICE).postinst.debhelper
523 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/$(OPENOLTDEVICE).postrm.debhelper
524 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/$(OPENOLTDEVICE).substvars
525 @rm -rf device/$(OPENOLTDEVICE)/mkdebian/debian/$(OPENOLTDEVICE)/
526 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/debhelper-build-stamp
Girish Gowdra252f4972020-09-07 21:24:01 -0700527 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/libz.so.1
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000528 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/libstdc++.so.6
Girish Gowdra5287fde2021-07-31 00:41:45 +0000529 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/libbal_host_api-oss.so
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000530 @rm -rf device/$(OPENOLTDEVICE)/mkdebian/debian/init.d/
531 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/openolt
Jason Huang09b73ea2020-01-08 17:52:05 +0800532 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/release_$(OPENOLTDEVICE)_V$(BAL_VER).$(DEV_VER).tar.gz
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000533 @rm -rf device/$(OPENOLTDEVICE)/mkdebian/debian/tmp/
534 @rm -f device/$(OPENOLTDEVICE)/$(OPENOLTDEVICE)_$(BAL_VER)+edgecore-V$(DEV_VER)_amd64.changes
Orhan Kupusogluec57af02021-05-12 12:38:17 +0000535 @rm -f device/$(OPENOLTDEVICE)/mkdebian/debian/$(RXTX_POWER_EXE)
Girish Gowdrab8c09fa2021-08-02 10:22:59 -0700536 @rm -rf device/$(OPENOLTDEVICE)/mkdebian/debian/watchdog/
Arthur Syu094df162022-04-21 17:50:06 +0800537 @rm -rf device/$(OPENOLTDEVICE)/mkdebian/tmp/
Shad Ansaricc01de12018-05-21 22:54:45 +0000538
Thiyagarajan Subramanie84935d2020-04-23 17:45:44 +0530539inband-onl-cleanup:
540 @rm -f $(ONL_DIR)/OpenNetworkLinux/*.patch
541 @rm -rf $(ONL_DIR)/OpenNetworkLinux/bal_packages
542
Shad Ansaricb004c52018-05-30 18:07:23 +0000543clean: protos-clean deb-cleanup
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000544 @rm -f $(OBJS) $(DEPS)
545 @rm -rf $(OPENOLT_PROTOS_DIR)/googleapis
Girish Gowdra252f4972020-09-07 21:24:01 -0700546 @rm -f $(BUILD_DIR)/libz.so.1
Girish Gowdra5287fde2021-07-31 00:41:45 +0000547 @rm -f $(BUILD_DIR)/libbal_host_api-oss.so
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000548 @rm -f $(BUILD_DIR)/openolt
Girish Gowdraab7ea552020-01-07 13:25:15 +0530549 @rm -f $(BUILD_DIR)/dev_mgmt_daemon
Jason Huang09b73ea2020-01-08 17:52:05 +0800550 @rm -f $(BUILD_DIR)/release_$(OPENOLTDEVICE)_V$(BAL_VER).$(DEV_VER).tar.gz
Girish Gowdrabc6e0852020-03-26 11:36:12 -0700551 @rm -f $(BUILD_DIR)/openolt_$(OPENOLTDEVICE)-$(VERSION)-$(LABEL_VCS_REF).deb
Shad Ansari19249582018-04-30 04:31:00 +0000552
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000553clean-src: protos-clean
554 @rm -f $(OBJS) $(DEPS)
555
Orhan Kupusogluec57af02021-05-12 12:38:17 +0000556clean-rxtx-power:
557 @rm -f src/$(RXTX_POWER_EXE)
558 @rm -f $(RXTX_POWER_EXE)
559
Thiyagarajan Subramani89fffc02019-05-13 21:33:20 +0000560distclean: clean-src clean
561 @rm -rf $(BUILD_DIR)
Shad Ansaricb004c52018-05-30 18:07:23 +0000562
Humera Kouser9c2bd9f2020-09-25 02:41:29 -0400563.PHONY: onl sdk bal protos inband-onl ansible .FORCE