sonic-buildimage/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules
Petro Bratash 7895513813
[BFN] Rename variable in Montara platform debian/rules (#5675)
Platforms .deb-package is not installed into the right directory, because variable PLATFORM was defined previously and variable in the makefile is ignored.
https://www.gnu.org/software/make/manual/html_node/Overriding.html
2020-10-22 10:34:18 -07:00

37 lines
1.2 KiB
Makefile
Executable File

#!/usr/bin/make -f
PLATFORM_NAME := x86_64-accton_wedge100bf_32x-r0
PACKAGE_NAME := sonic-platform-modules-bfn-montara
SCRIPT_SRC := $(shell pwd)/scripts
CONFIGS_SRC := $(shell pwd)/configs
BUILD_DIR := $(shell pwd)/build
WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel
PLUGINS_DIR := $(shell pwd)/plugins
%:
dh $@
override_dh_auto_build:
set -e
python2.7 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
python3 setup.py bdist_wheel -d $(WHEEL_BUILD_DIR)
set +e
override_dh_auto_install:
dh_installdirs -p$(PACKAGE_NAME) usr/local/bin
cp -r $(SCRIPT_SRC)/* debian/$(PACKAGE_NAME)/usr/local/bin
dh_installdirs -p$(PACKAGE_NAME) etc/network/interfaces.d/
cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_NAME)/etc/network/interfaces.d/
dh_installdirs -p$(PACKAGE_NAME) usr/share/sonic/device/$(PLATFORM_NAME)/
cp -r $(WHEEL_BUILD_DIR)/* debian/$(PACKAGE_NAME)/usr/share/sonic/device/$(PLATFORM_NAME)/
dh_installdirs -p$(PACKAGE_NAME) usr/share/sonic/device/$(PLATFORM_NAME)/plugins
cp -r $(PLUGINS_DIR)/* debian/$(PACKAGE_NAME)/usr/share/sonic/device/$(PLATFORM_NAME)/plugins/
override_dh_usrlocal:
override_dh_clean:
rm -fr $(WHEEL_BUILD_DIR)
rm -fr *.egg-info
rm -fr $(BUILD)
dh_clean