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 | ## |
| 22 | DEVICE = asfvolt16 |
| 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. |
| 27 | # ACCTON_BAL_<BAL_VER>-<ACCTON_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 |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 31 | ACCTON_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 |
| 44 | # |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 45 | ######################################################################## |
| 46 | ## |
| 47 | ## |
Luca Prete | 08e6f80 | 2018-04-17 11:49:45 -0700 | [diff] [blame] | 48 | ## Install prerequisites |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 49 | ## |
| 50 | ## |
| 51 | HOST_SYSTEM = $(shell uname | cut -f 1 -d_) |
| 52 | SYSTEM ?= $(HOST_SYSTEM) |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 53 | |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 54 | CXX = g++ |
| 55 | CPPFLAGS += `pkg-config --cflags protobuf grpc` |
| 56 | CXXFLAGS += -std=c++11 -fpermissive -Wno-literal-suffix |
| 57 | ifeq ($(SYSTEM),Darwin) |
| 58 | LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++ grpc`\ |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 59 | -lgrpc++_reflection\ |
| 60 | -ldl |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 61 | else |
| 62 | LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++ grpc`\ |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 63 | -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ |
| 64 | -ldl |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 65 | endif |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 66 | |
Luca Prete | 08e6f80 | 2018-04-17 11:49:45 -0700 | [diff] [blame] | 67 | prereq: |
nick | 6fa8073 | 2018-05-22 14:47:10 -0400 | [diff] [blame] | 68 | sudo apt-get -q -y install git pkg-config build-essential autoconf libtool libgflags-dev libgtest-dev clang libc++-dev unzip docker.io |
| 69 | 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] | 70 | |
| 71 | # Install GRPC plugins |
| 72 | rm -rf $(GRPC_DST) |
| 73 | git clone -b $(GRPC_VER) $(GRPC_ADDR) $(GRPC_DST) |
| 74 | cd $(GRPC_DST) && git submodule update --init |
| 75 | make -C $(GRPC_DST) |
| 76 | sudo make -C $(GRPC_DST) install |
| 77 | # Install libprotobuf and protoc |
Luca Prete | 08e6f80 | 2018-04-17 11:49:45 -0700 | [diff] [blame] | 78 | cd $(GRPC_DST)/third_party/protobuf && ./autogen.sh |
| 79 | cd $(GRPC_DST)/third_party/protobuf && ./configure |
| 80 | make -C $(GRPC_DST)/third_party/protobuf |
| 81 | sudo make -C $(GRPC_DST)/third_party/protobuf install |
| 82 | sudo ldconfig |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 83 | |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 84 | rm -rf /tmp/protobuf |
| 85 | git clone https://github.com/google/protobuf.git /tmp/protobuf |
| 86 | cd /tmp/protobuf && git submodule update --init --recursive && ./autogen.sh && ./configure |
| 87 | make -C /tmp/protobuf |
| 88 | sudo make -C /tmp/protobuf install |
| 89 | sudo ldconfig |
| 90 | |
| 91 | # libunwind (needed by glog) |
| 92 | rm -rf /tmp/libunwind-1.2 |
| 93 | wget http://download.savannah.nongnu.org/releases/libunwind/libunwind-1.2.tar.gz -P /tmp |
| 94 | cd /tmp && tar -xzvf libunwind-1.2.tar.gz |
| 95 | cd /tmp/libunwind-1.2 && ./configure |
| 96 | make -C /tmp/libunwind-1.2 |
| 97 | sudo make -C /tmp/libunwind-1.2 install |
| 98 | |
| 99 | # cmake (needed by glog) |
| 100 | sudo apt-get remove cmake cmake-data |
| 101 | sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x |
| 102 | sudo -E apt-get update |
| 103 | sudo apt-get install -y cmake |
| 104 | |
| 105 | # glog |
| 106 | rm -rf /tmp/glog |
| 107 | git clone https://github.com/google/glog.git /tmp/glog |
| 108 | cd /tmp/glog && cmake -H. -Bbuild -G "Unix Makefiles" && cmake --build build && sudo cmake --build build --target install |
| 109 | |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 110 | ######################################################################## |
| 111 | ## |
| 112 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 113 | ## ONL |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 114 | ## |
| 115 | ## |
| 116 | ONL_KERN_VER = $(ONL_KERN_VER_MAJOR).$(ONL_KERN_VER_MINOR) |
| 117 | ONL_REPO = $(DEVICE)-onl |
| 118 | ONL_DIR = $(BUILD_DIR)/$(ONL_REPO) |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 119 | onl: |
| 120 | if [ ! -d "$(ONL_DIR)/OpenNetworkLinux" ]; then \ |
| 121 | mkdir -p $(ONL_DIR); \ |
Luca Prete | b788628 | 2018-04-06 15:34:08 -0700 | [diff] [blame] | 122 | git clone https://gerrit.opencord.org/$(ONL_REPO) $(ONL_DIR); \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 123 | make -C $(ONL_DIR) $(DEVICE)-$(ONL_KERN_VER_MAJOR); \ |
| 124 | fi; |
| 125 | onl-force: |
| 126 | make -C $(ONL_DIR) $(DEVICE)-$(ONL_KERN_VER_MAJOR) |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 127 | distclean-onl: |
| 128 | sudo rm -rf $(ONL_DIR) |
| 129 | |
| 130 | ######################################################################## |
| 131 | ## |
| 132 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 133 | ## BAL |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 134 | ## |
| 135 | ## |
| 136 | BAL_ZIP = SW-BCM68620_$(subst .,_,$(BAL_VER)).zip |
| 137 | SDK_ZIP = sdk-all-$(SDK_VER).tar.gz |
| 138 | ACCTON_PATCH = ACCTON_BAL_$(BAL_VER)-V$(ACCTON_VER).patch |
| 139 | OPENOLT_BAL_PATCH = OPENOLT_BAL_$(BAL_VER).patch |
| 140 | BAL_DIR = $(BUILD_DIR)/$(DEVICE)-bal |
| 141 | ONL_KERNDIR = $(PWD)/$(ONL_DIR)/OpenNetworkLinux/packages/base/amd64/kernels/kernel-$(ONL_KERN_VER_MAJOR)-x86-64-all/builds |
| 142 | MAPLE_KERNDIR = $(BAL_DIR)/bcm68620_release/$(DEVICE)/kernels |
| 143 | BCM_SDK = $(BAL_DIR)/bal_release/3rdparty/bcm-sdk |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 144 | 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] | 145 | BALLIBNAME = bal_api_dist |
| 146 | BAL_INC = -I$(BAL_DIR)/bal_release/src/common/os_abstraction \ |
| 147 | -I$(BAL_DIR)/bal_release/src/common/os_abstraction/posix \ |
| 148 | -I$(BAL_DIR)/bal_release/src/common/config \ |
| 149 | -I$(BAL_DIR)/bal_release/src/core/platform \ |
Nicolas Palpacuer | 0f19b1a | 2018-06-07 17:29:31 -0400 | [diff] [blame] | 150 | -I$(BAL_DIR)/bal_release/src/core/main \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 151 | -I$(BAL_DIR)/bal_release/src/common/include \ |
| 152 | -I$(BAL_DIR)/bal_release/src/lib/libbalapi \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 153 | -I$(BAL_DIR)/bal_release/src/balapiend \ |
| 154 | -I$(BAL_DIR)/bal_release/src/common/dev_log \ |
| 155 | -I$(BAL_DIR)/bal_release/src/common/bal_dist_utils \ |
| 156 | -I$(BAL_DIR)/bal_release/src/lib/libtopology \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 157 | -I$(BAL_DIR)/bal_release/src/lib/libcmdline \ |
| 158 | -I$(BAL_DIR)/bal_release/src/lib/libutils \ |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 159 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/utils \ |
| 160 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/model \ |
| 161 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/api \ |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 162 | -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_reference/cli |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 163 | # -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_customized/os_abstraction |
| 164 | # -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_customized/os_abstraction/posix |
| 165 | # -I$(BAL_DIR)/bal_release/3rdparty/maple/sdk/host_driver/config |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 166 | CXXFLAGS += $(BAL_INC) -I $(BAL_DIR)/lib/cmdline |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 167 | CXXFLAGS += -DBCMOS_MSG_QUEUE_DOMAIN_SOCKET -DBCMOS_MSG_QUEUE_UDP_SOCKET -DBCMOS_MEM_CHECK -DBCMOS_SYS_UNITTEST |
| 168 | |
| 169 | sdk: onl |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 170 | ifeq ("$(wildcard $(BAL_DIR))","") |
| 171 | mkdir $(BAL_DIR) |
| 172 | unzip download/$(BAL_ZIP) -d $(BAL_DIR) |
| 173 | cp download/$(SDK_ZIP) $(BCM_SDK) |
| 174 | chmod -R 744 $(BAL_DIR) |
| 175 | cat download/$(ACCTON_PATCH) | patch -p1 -d $(BAL_DIR) |
| 176 | mkdir -p $(MAPLE_KERNDIR) |
| 177 | ln -s $(ONL_KERNDIR)/linux-$(ONL_KERN_VER) $(MAPLE_KERNDIR)/linux-$(ONL_KERN_VER) |
| 178 | ln -s $(ONL_DIR)/OpenNetworkLinux/packages/base/any/kernels/archives/linux-$(ONL_KERN_VER).tar.xz $(MAPLE_KERNDIR)/linux-$(ONL_KERN_VER).tar.xz |
| 179 | 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 |
| 180 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) maple_sdk_dir |
| 181 | cat download/$(OPENOLT_BAL_PATCH) | patch -p1 -d $(BAL_DIR) |
| 182 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) maple_sdk |
| 183 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) switch_sdk_dir |
| 184 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) switch_sdk |
| 185 | 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 |
| 186 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) bal |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 187 | 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] | 188 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) release_board |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 189 | endif |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 190 | |
| 191 | bal: sdk |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 192 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) bal |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 193 | 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] | 194 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) release_board |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 195 | |
| 196 | bal-clean: |
| 197 | make -C $(BAL_DIR)/bal_release BOARD=$(DEVICE) clean_bal |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 198 | |
| 199 | ######################################################################## |
| 200 | ## |
| 201 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 202 | ## OpenOLT API |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 203 | ## |
| 204 | ## |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 205 | OPENOLT_PROTOS_DIR = ./protos |
| 206 | OPENOLT_API_LIB = $(OPENOLT_PROTOS_DIR)/libopenoltapi.a |
| 207 | CXXFLAGS += -I./$(OPENOLT_PROTOS_DIR) -I $(OPENOLT_PROTOS_DIR)/googleapis/gens |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 208 | protos: |
| 209 | make -C $(OPENOLT_PROTOS_DIR) all |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 210 | protos-clean: |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 211 | -make -C $(OPENOLT_PROTOS_DIR) clean |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 212 | |
| 213 | ######################################################################## |
| 214 | ## |
| 215 | ## |
Luca Prete | e75aaa5 | 2018-04-13 12:19:12 -0700 | [diff] [blame] | 216 | ## Main |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 217 | ## |
| 218 | ## |
| 219 | SRCS = $(wildcard src/*.cc) |
| 220 | OBJS = $(SRCS:.cc=.o) |
| 221 | DEPS = $(SRCS:.cc=.d) |
| 222 | .DEFAULT_GOAL := all |
| 223 | all: $(BUILD_DIR)/openolt |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 224 | $(BUILD_DIR)/openolt: sdk protos $(OBJS) |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 225 | $(CXX) $(OBJS) $(LDFLAGS) $(OPENOLT_API_LIB) -o $@ -L$(BALLIBDIR) -l$(BALLIBNAME) |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 226 | ln -sf $(PWD)/$(BAL_DIR)/bcm68620_release/$(DEVICE)/release/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz $(BUILD_DIR)/. |
| 227 | ln -sf $(PWD)/$(BAL_DIR)/bcm68620_release/$(DEVICE)/release/broadcom/libbal_api_dist.so $(BUILD_DIR)/. |
| 228 | ln -sf $(PWD)/$(BAL_DIR)/bal_release/build/core/src/apps/bal_core_dist/bal_core_dist $(BUILD_DIR)/. |
Shad Ansari | 2cb6e86 | 2018-05-04 03:57:42 +0000 | [diff] [blame] | 229 | ln -sf $(shell ldconfig -p | grep libgrpc.so.6 | tr ' ' '\n' | grep /) $(BUILD_DIR)/libgrpc.so.6 |
| 230 | ln -sf $(shell ldconfig -p | grep libgrpc++.so.1 | tr ' ' '\n' | grep /) $(BUILD_DIR)/libgrpc++.so.1 |
| 231 | ln -sf $(shell ldconfig -p | grep libgrpc++_reflection.so.1 | tr ' ' '\n' | grep /) $(BUILD_DIR)/libgrpc++_reflection.so.1 |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 232 | |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 233 | deb: |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 234 | cp $(BUILD_DIR)/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz mkdebian/debian |
Shad Ansari | 9fb007d | 2018-05-14 18:31:38 +0000 | [diff] [blame] | 235 | cp $(BUILD_DIR)/openolt mkdebian/debian |
| 236 | cp $(BUILD_DIR)/libgrpc.so.6 mkdebian/debian |
| 237 | cp $(BUILD_DIR)/libgrpc++.so.1 mkdebian/debian |
| 238 | cp $(BUILD_DIR)/libgrpc++_reflection.so.1 mkdebian/debian |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 239 | cd mkdebian && ./build_$(DEVICE)_deb.sh |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 240 | mv *.deb $(BUILD_DIR)/openolt.deb |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 241 | make deb-cleanup |
Shad Ansari | 6cd46a6 | 2018-05-13 23:20:51 +0000 | [diff] [blame] | 242 | |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 243 | src/%.o: %.cpp |
| 244 | $(CXX) -MMD -c $< -o $@ |
| 245 | |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 246 | deb-cleanup: |
| 247 | rm -f mkdebian/debian/$(DEVICE).debhelper.log |
| 248 | rm -f mkdebian/debian/$(DEVICE).postinst.debhelper |
| 249 | rm -f mkdebian/debian/$(DEVICE).postrm.debhelper |
| 250 | rm -f mkdebian/debian/$(DEVICE).substvars |
| 251 | rm -rf mkdebian/debian/$(DEVICE)/ |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 252 | rm -f mkdebian/debian/libgrpc++.so.1 |
| 253 | rm -f mkdebian/debian/libgrpc++_reflection.so.1 |
| 254 | rm -f mkdebian/debian/libgrpc.so.6 |
| 255 | rm -f mkdebian/debian/openolt |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 256 | rm -f mkdebian/debian/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 257 | rm -rf mkdebian/debian/tmp/ |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 258 | rm -f $(DEVICE)_$(BAL_VER)+edgecore-V$(ACCTON_VER)_amd64.changes |
Shad Ansari | cc01de1 | 2018-05-21 22:54:45 +0000 | [diff] [blame] | 259 | |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 260 | clean: protos-clean deb-cleanup |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 261 | rm -f $(OBJS) $(DEPS) |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 262 | rm -rf protos/googleapis |
Shad Ansari | a0eeec5 | 2018-04-18 22:05:38 +0000 | [diff] [blame] | 263 | rm -f $(BUILD_DIR)/libgrpc.so.6 $(BUILD_DIR)/libgrpc++.so.1 $(BUILD_DIR)/libgrpc++_reflection.so.1 |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 264 | rm -f $(BUILD_DIR)/libbal_api_dist.so |
| 265 | rm -f $(BUILD_DIR)/openolt |
| 266 | rm -f $(BUILD_DIR)/bal_core_dist |
| 267 | rm -f $(BUILD_DIR)/release_$(DEVICE)_V$(BAL_MAJOR_VER).$(ACCTON_VER).tar.gz |
| 268 | rm -f $(BUILD_DIR)/openolt.deb |
Shad Ansari | 1924958 | 2018-04-30 04:31:00 +0000 | [diff] [blame] | 269 | |
| 270 | distclean: |
Shad Ansari | 01b0e65 | 2018-04-05 21:02:53 +0000 | [diff] [blame] | 271 | rm -rf $(BUILD_DIR) |
Shad Ansari | cb004c5 | 2018-05-30 18:07:23 +0000 | [diff] [blame^] | 272 | |
| 273 | .PHONY: onl sdk bal protos prereq |