sonic-buildimage/platform/cavium/cavm_platform_modules/Makefile
Nadiya 2358678497 Add operational script, accton_as7512_util.py, for device initializatian and peripheral accessing (#265)
Signed-off-by: Nadiya.Stetskovych <Nadiya.Stetskovych@cavium.com>
2017-02-05 22:17:25 -08:00

30 lines
750 B
Makefile

.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e
MAIN_TARGET = cavm_platform_modules.deb
DEB_BUILD_DIR = cavm-platform-modules-deb
SCRIPT_SRC = $(DEB_BUILD_DIR)/
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# get sources
rm -rf SONiC
git clone https://github.com/edge-core/SONiC.git
# build
pushd SONiC/AS7512-32X/module/
KERNEL_SRC=/lib/modules/$(KVERSION)/build make
popd
mkdir -p $(DEB_BUILD_DIR)/lib/modules/$(KVERSION)
mkdir -p $(DEB_BUILD_DIR)/usr/bin
cp SONiC/AS7512-32X/module/*.ko $(DEB_BUILD_DIR)/lib/modules/$(KVERSION)
cp SONiC/AS7512-32X/accton_as7512_util.py $(DEB_BUILD_DIR)/usr/bin
cp -r DEBIAN $(DEB_BUILD_DIR)
dpkg-deb -b $(DEB_BUILD_DIR) $(MAIN_TARGET)
mv $(MAIN_TARGET) $(DEST)/
rm -rf $(DEB_BUILD_DIR)