Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 1 | # Copyright (C) 2018 Open Networking Foundation |
| 2 | # |
| 3 | # This program is free software: you can redistribute it and/or modify |
| 4 | # it under the terms of the GNU General Public License as published by |
| 5 | # the Free Software Foundation, either version 3 of the License, or |
| 6 | # (at your option) any later version. |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, |
| 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | # GNU General Public License for more details. |
| 12 | # |
| 13 | # You should have received a copy of the GNU General Public License |
| 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | |
| 16 | ######################################################################## |
| 17 | ## |
| 18 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 19 | ## Config |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 20 | ## |
| 21 | ## |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 22 | DEVICE ?= asfvolt16 |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 23 | # |
| 24 | # Three vendor proprietary source files are required to build BAL. |
| 25 | # SW-BCM68620_<VER>.zip - Broadcom BAL source and Maple SDK. |
| 26 | # sdk-all-<SDK_VER>.tar.gz - Broadcom Qumran SDK. |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 27 | # ACCTON_BAL_<BAL_VER>-<DEV_VER>.patch - Accton/Edgecore's patch. |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 28 | BAL_MAJOR_VER = 02.06 |
| 29 | BAL_VER = 2.6.0.1 |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 30 | SDK_VER = 6.5.7 |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 31 | DEV_VER ?= 201804301043 |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 32 | # |
| 33 | # Version of Open Network Linux (ONL). |
| 34 | ONL_KERN_VER_MAJOR = 3.7 |
| 35 | ONL_KERN_VER_MINOR = 10 |
| 36 | # |
| 37 | # Build directory |
| 38 | BUILD_DIR = build |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 39 | # |
| 40 | # GRPC installation |
| 41 | GRPC_ADDR = https://github.com/grpc/grpc |
| 42 | GRPC_DST = /tmp/grpc |
| 43 | GRPC_VER = v1.10.x |
Shad Ansari | 2cddc55 | 2018-06-26 20:34:27 +0000 | [diff] [blame] | 44 | |
| 45 | USER := $(shell echo $(USER)) |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 46 | # |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 47 | ######################################################################## |
| 48 | ## |
| 49 | ## |
Luca Prete | 08e6f80 | 2018-04-17 11:49:45 -0700 | [diff] [blame] | 50 | ## Install prerequisites |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 51 | ## |
| 52 | ## |
| 53 | HOST_SYSTEM = $(shell uname | cut -f 1 -d_) |
| 54 | SYSTEM ?= $(HOST_SYSTEM) |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 55 | |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 56 | LIBGRPC_PATH=$(shell pkg-config --libs-only-L grpc | sed s/-L// | sed s/\ //g) |
| 57 | LIBPROTOBUF_PATH=$(shell PKG_CONFIG_ALLOW_SYSTEM_LIBS=true pkg-config --libs-only-L protobuf | sed s/-L// | sed s/\ //g) |
| 58 | |
| 59 | CXX = @CXX@ |
| 60 | CXXFLAGS += @CXXFLAGS@ |
| 61 | CXXFLAGS += $(shell pkg-config --cflags-only-I grpc++) |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 62 | CPPFLAGS += `pkg-config --cflags protobuf grpc` |
| 63 | CXXFLAGS += -std=c++11 -fpermissive -Wno-literal-suffix |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 64 | LDFLAGS += @LDFLAGS@ |
| 65 | LDFLAGS += `pkg-config --libs protobuf grpc++ grpc` -ldl -lgpr |
| 66 | |
| 67 | export CXX CXXFLAGS |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 68 | |
Luca Prete | 08e6f80 | 2018-04-17 11:49:45 -0700 | [diff] [blame] | 69 | prereq: |
nick | 6fa8073 | 2018-05-22 14:47:10 -0400 | [diff] [blame] | 70 | sudo apt-get -q -y install git pkg-config build-essential autoconf libtool libgflags-dev libgtest-dev clang libc++-dev unzip docker.io |
| 71 | sudo apt-get install -y build-essential autoconf libssl-dev gawk debhelper dh-systemd init-system-helpers |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 72 | |
Shad Ansari | 563ea82 | 2018-06-28 14:56:27 +0000 | [diff] [blame] | 73 | # Install GRPC, libprotobuf and protoc |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 74 | rm -rf $(GRPC_DST) |
| 75 | git clone -b $(GRPC_VER) $(GRPC_ADDR) $(GRPC_DST) |
| 76 | cd $(GRPC_DST) && git submodule update --init |
Shad Ansari | 563ea82 | 2018-06-28 14:56:27 +0000 | [diff] [blame] | 77 | cd $(GRPC_DST)/third_party/protobuf && ./autogen.sh && ./configure |
Luca Prete | 08e6f80 | 2018-04-17 11:49:45 -0700 | [diff] [blame] | 78 | make -C $(GRPC_DST)/third_party/protobuf |
| 79 | sudo make -C $(GRPC_DST)/third_party/protobuf install |
| 80 | sudo ldconfig |
Shad Ansari | 563ea82 | 2018-06-28 14:56:27 +0000 | [diff] [blame] | 81 | make -C $(GRPC_DST) |
| 82 | sudo make -C $(GRPC_DST) install |
| 83 | sudo ldconfig |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 84 | |
Shad Ansari | 2cddc55 | 2018-06-26 20:34:27 +0000 | [diff] [blame] | 85 | docker: |
| 86 | echo $(USER) |
| 87 | sudo groupadd -f docker |
| 88 | ifneq "$(USER)" "" |
| 89 | sudo usermod -aG docker $(USER) |
| 90 | endif |
| 91 | |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 92 | ######################################################################## |
| 93 | ## |
| 94 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 95 | ## ONL |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 96 | ## |
| 97 | ## |
| 98 | ONL_KERN_VER = $(ONL_KERN_VER_MAJOR).$(ONL_KERN_VER_MINOR) |
| 99 | ONL_REPO = $(DEVICE)-onl |
| 100 | ONL_DIR = $(BUILD_DIR)/$(ONL_REPO) |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 101 | onl: |
| 102 | if [ ! -d "$(ONL_DIR)/OpenNetworkLinux" ]; then \ |
| 103 | mkdir -p $(ONL_DIR); \ |
Luca Prete | b788628 | 2018-04-06 15:34:08 -0700 | [diff] [blame] | 104 | git clone https://gerrit.opencord.org/$(ONL_REPO) $(ONL_DIR); \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 105 | make -C $(ONL_DIR) $(DEVICE)-$(ONL_KERN_VER_MAJOR); \ |
| 106 | fi; |
| 107 | onl-force: |
| 108 | make -C $(ONL_DIR) $(DEVICE)-$(ONL_KERN_VER_MAJOR) |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 109 | distclean-onl: |
| 110 | sudo rm -rf $(ONL_DIR) |
| 111 | |
| 112 | ######################################################################## |
| 113 | ## |
| 114 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 115 | ## BAL |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 116 | ## |
| 117 | ## |
| 118 | BAL_ZIP = SW-BCM68620_$(subst .,_,$(BAL_VER)).zip |
| 119 | SDK_ZIP = sdk-all-$(SDK_VER).tar.gz |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 120 | ACCTON_PATCH = ACCTON_BAL_$(BAL_VER)-V$(DEV_VER).patch |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 121 | OPENOLT_BAL_PATCH = OPENOLT_BAL_$(BAL_VER).patch |
| 122 | BAL_DIR = $(BUILD_DIR)/$(DEVICE)-bal |
| 123 | ONL_KERNDIR = $(PWD)/$(ONL_DIR)/OpenNetworkLinux/packages/base/amd64/kernels/kernel-$(ONL_KERN_VER_MAJOR)-x86-64-all/builds |
| 124 | MAPLE_KERNDIR = $(BAL_DIR)/bcm68620_release/$(DEVICE)/kernels |
| 125 | BCM_SDK = $(BAL_DIR)/bal_release/3rdparty/bcm-sdk |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 126 | BALLIBDIR = $(BAL_DIR)/bal_release/build/core/src/apps/bal_api_dist_shared_lib |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 127 | BALLIBNAME = bal_api_dist |
| 128 | BAL_INC = -I$(BAL_DIR)/bal_release/src/common/os_abstraction \ |
| 129 | -I$(BAL_DIR)/bal_release/src/common/os_abstraction/posix \ |
| 130 | -I$(BAL_DIR)/bal_release/src/common/config \ |
| 131 | -I$(BAL_DIR)/bal_release/src/core/platform \ |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 132 | -I$(BAL_DIR)/bal_release/src/core/main \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 133 | -I$(BAL_DIR)/bal_release/src/common/include \ |
| 134 | -I$(BAL_DIR)/bal_release/src/lib/libbalapi \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 135 | -I$(BAL_DIR)/bal_release/src/balapiend \ |
| 136 | -I$(BAL_DIR)/bal_release/src/common/dev_log \ |
| 137 | -I$(BAL_DIR)/bal_release/src/common/bal_dist_utils \ |
| 138 | -I$(BAL_DIR)/bal_release/src/lib/libtopology \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 139 | -I$(BAL_DIR)/bal_release/src/lib/libcmdline \ |
| 140 | -I$(BAL_DIR)/bal_release/src/lib/libutils \ |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 141 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/utils \ |
| 142 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/model \ |
| 143 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/api \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 144 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_reference/cli |
| 145 | CXXFLAGS += $(BAL_INC) -I $(BAL_DIR)/lib/cmdline |
Nicolas Palpacuer | 967438f | 2018-09-07 14:41:54 -0400 | [diff] [blame] | 146 | CXXFLAGS += -DBCMOS_MSG_QUEUE_DOMAIN_SOCKET -DBCMOS_MSG_QUEUE_UDP_SOCKET -DBCMOS_MEM_CHECK -DBCMOS_SYS_UNITTEST -DENABLE_LOG |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 147 | |
| 148 | sdk: onl |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 149 | ifeq ("$(wildcard $(BAL_DIR))","") |
| 150 | mkdir $(BAL_DIR) |
| 151 | unzip download/$(BAL_ZIP) -d $(BAL_DIR) |
| 152 | cp download/$(SDK_ZIP) $(BCM_SDK) |
| 153 | chmod -R 744 $(BAL_DIR) |
| 154 | cat download/$(ACCTON_PATCH) | patch -p1 -d $(BAL_DIR) |
| 155 | mkdir -p $(MAPLE_KERNDIR) |
| 156 | ln -s $(ONL_KERNDIR)/linux-$(ONL_KERN_VER) $(MAPLE_KERNDIR)/linux-$(ONL_KERN_VER) |
| 157 | ln -s $(ONL_DIR)/OpenNetworkLinux/packages/base/any/kernels/archives/linux-$(ONL_KERN_VER).tar.xz $(MAPLE_KERNDIR)/linux-$(ONL_KERN_VER).tar.xz |
| 158 | ln -s $(ONL_DIR)/OpenNetworkLinux/packages/base/any/kernels/$(ONL_KERN_VER_MAJOR)/configs/x86_64-all/x86_64-all.config $(MAPLE_KERNDIR)/x86_64-all.config |
| 159 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) maple_sdk_dir |
| 160 | cat download/$(OPENOLT_BAL_PATCH) | patch -p1 -d $(BAL_DIR) |
| 161 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) maple_sdk |
| 162 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) switch_sdk_dir |
| 163 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) switch_sdk |
| 164 | KERNDIR=$(ONL_KERNDIR)/linux-$(ONL_KERN_VER) BOARD=$(DEVICE) ARCH=x86_64 SDKBUILD=build_bcm_user make -C $(BCM_SDK)/build-$(DEVICE)/sdk-all-$(SDK_VER)/systems/linux/user/x86-generic_64-2_6 |
| 165 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) bal |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 166 | echo 'auto_create_interface_tm=y' >> $(BAL_DIR)/bal_release/3rdparty/maple/cur/$(DEVICE)/board_files/broadcom/bal_config.ini |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 167 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) release_board |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 168 | endif |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 169 | |
| 170 | bal: sdk |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 171 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) bal |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 172 | echo 'auto_create_interface_tm=y' >> $(BAL_DIR)/bal_release/3rdparty/maple/cur/asfvolt16/board_files/broadcom/bal_config.ini |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 173 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) release_board |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 174 | |
| 175 | bal-clean: |
| 176 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) clean_bal |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 177 | |
| 178 | ######################################################################## |
| 179 | ## |
| 180 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 181 | ## OpenOLT API |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 182 | ## |
| 183 | ## |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 184 | OPENOLT_PROTOS_DIR = ./protos |
| 185 | OPENOLT_API_LIB = $(OPENOLT_PROTOS_DIR)/libopenoltapi.a |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 186 | CXXFLAGS += -I$(OPENOLT_PROTOS_DIR) -I$(OPENOLT_PROTOS_DIR)/googleapis/gens |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 187 | protos: |
| 188 | make -C $(OPENOLT_PROTOS_DIR) all |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 189 | protos-clean: |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 190 | -make -C $(OPENOLT_PROTOS_DIR) clean |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 191 | |
| 192 | ######################################################################## |
| 193 | ## |
| 194 | ## |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 195 | ## common |
Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 196 | ## |
| 197 | ## |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 198 | common/%.o: common/%.cc |
| 199 | $(CXX) $(CXXFLAGS) -I./common -c $< -o $@ |
Shad Ansari | 7193ae2 | 2018-08-08 22:23:18 +0000 | [diff] [blame] | 200 | |
| 201 | ######################################################################## |
| 202 | ## |
| 203 | ## |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 204 | ## sim |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 205 | ## |
| 206 | ## |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 207 | SIM_SRCS = $(wildcard sim/*.cc) $(wildcard common/*.cc) |
| 208 | SIM_OBJS = $(SIM_SRCS:.cc=.o) |
| 209 | SIM_DEPS = $(SIM_SRCS:.cc=.d) |
| 210 | sim: sim/openoltsim |
| 211 | sim/openoltsim: protos $(SIM_OBJS) |
| 212 | $(CXX) -pthread -L/usr/local/lib $(SIM_OBJS) $(OPENOLT_API_LIB) /usr/local/lib/libprotobuf.a -o $@ -lgrpc++ -lgrpc -lpthread -ldl |
| 213 | sim/%.o: sim/%.cc |
| 214 | $(CXX) -std=c++11 -fpermissive -Wno-literal-suffix -I./common -I$(OPENOLT_PROTOS_DIR) -I$(OPENOLT_PROTOS_DIR)/googleapis/gens -c $< -o $@ |
| 215 | clean-sim: |
| 216 | rm -f sim/openoltsim $(SIM_OBJS) $(SIM_DEPS) |
| 217 | |
| 218 | ######################################################################## |
| 219 | ## |
| 220 | ## |
| 221 | ## openolt |
| 222 | ## |
| 223 | ## |
| 224 | SRCS = $(wildcard src/*.cc) $(wildcard common/*.cc) |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 225 | OBJS = $(SRCS:.cc=.o) |
| 226 | DEPS = $(SRCS:.cc=.d) |
| 227 | .DEFAULT_GOAL := all |
| 228 | all: $(BUILD_DIR)/openolt |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 229 | $(BUILD_DIR)/openolt: sdk protos $(OBJS) |
Shad Ansari | 06a1332 | 2018-09-29 01:55:33 +0000 | [diff] [blame] | 230 | $(CXX) $(LDFLAGS) -L$(BALLIBDIR) $(OBJS) $(OPENOLT_API_LIB) $(LIBPROTOBUF_PATH)/libprotobuf.a -o $@ -l$(BALLIBNAME) $(shell pkg-config --libs protobuf grpc++ grpc) |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 231 | ln -sf $(PWD)/$(BAL_DIR)/bcm68620_release/$(DEVICE)/release/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(DEV_VER).tar.gz $(BUILD_DIR)/. |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 232 | ln -sf $(PWD)/$(BAL_DIR)/bcm68620_release/$(DEVICE)/release/broadcom/libbal_api_dist.so $(BUILD_DIR)/. |
| 233 | ln -sf $(PWD)/$(BAL_DIR)/bal_release/build/core/src/apps/bal_core_dist/bal_core_dist $(BUILD_DIR)/. |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 234 | ln -sf $(LIBGRPC_PATH)/libgrpc.so.6 $(BUILD_DIR)/libgrpc.so.6 |
| 235 | ln -sf $(LIBGRPC_PATH)/libgrpc++.so.1 $(BUILD_DIR)/libgrpc++.so.1 |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 236 | src/%.o: src/%.cc |
| 237 | $(CXX) $(CXXFLAGS) -I./common -c $< -o $@ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 238 | |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 239 | deb: |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 240 | cp $(BUILD_DIR)/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(DEV_VER).tar.gz mkdebian/debian |
Shad Ansari | 9fb007d | 2018-05-14 18:31:38 +0000 | [diff] [blame] | 241 | cp $(BUILD_DIR)/openolt mkdebian/debian |
| 242 | cp $(BUILD_DIR)/libgrpc.so.6 mkdebian/debian |
| 243 | cp $(BUILD_DIR)/libgrpc++.so.1 mkdebian/debian |
Shad Ansari | d0eaf75 | 2018-08-16 00:26:12 +0000 | [diff] [blame] | 244 | cp -a scripts/init.d mkdebian/debian |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 245 | cd mkdebian && ./build_$(DEVICE)_deb.sh |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 246 | mv *.deb $(BUILD_DIR)/openolt.deb |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 247 | make deb-cleanup |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 248 | |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 249 | src/%.o: %.cpp |
| 250 | $(CXX) -MMD -c $< -o $@ |
| 251 | |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 252 | deb-cleanup: |
| 253 | rm -f mkdebian/debian/$(DEVICE).debhelper.log |
| 254 | rm -f mkdebian/debian/$(DEVICE).postinst.debhelper |
| 255 | rm -f mkdebian/debian/$(DEVICE).postrm.debhelper |
| 256 | rm -f mkdebian/debian/$(DEVICE).substvars |
| 257 | rm -rf mkdebian/debian/$(DEVICE)/ |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 258 | rm -f mkdebian/debian/libgrpc++.so.1 |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 259 | rm -f mkdebian/debian/libgrpc.so.6 |
| 260 | rm -f mkdebian/debian/openolt |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 261 | rm -f mkdebian/debian/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(DEV_VER).tar.gz |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 262 | rm -rf mkdebian/debian/tmp/ |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 263 | rm -f $(DEVICE)_$(BAL_VER)+edgecore-V$(DEV_VER)_amd64.changes |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 264 | |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 265 | clean: protos-clean deb-cleanup |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 266 | rm -f $(OBJS) $(DEPS) |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 267 | rm -rf protos/googleapis |
Shad Ansari | 563ea82 | 2018-06-28 14:56:27 +0000 | [diff] [blame] | 268 | rm -f $(BUILD_DIR)/libgrpc.so.6 $(BUILD_DIR)/libgrpc++.so.1 |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 269 | rm -f $(BUILD_DIR)/libbal_api_dist.so |
| 270 | rm -f $(BUILD_DIR)/openolt |
| 271 | rm -f $(BUILD_DIR)/bal_core_dist |
Craig Lutgen | f040dba | 2018-09-27 11:21:43 -0500 | [diff] [blame] | 272 | rm -f $(BUILD_DIR)/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(DEV_VER).tar.gz |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 273 | rm -f $(BUILD_DIR)/openolt.deb |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 274 | |
| 275 | distclean: |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 276 | rm -rf $(BUILD_DIR) |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame] | 277 | |
Shad Ansari | 627b578 | 2018-08-13 22:49:32 +0000 | [diff] [blame] | 278 | .PHONY: onl sdk bal protos prereq sim |