2017-01-12 20:02:19 -06:00
|
|
|
.ONESHELL:
|
|
|
|
SHELL = /bin/bash
|
|
|
|
.SHELLFLAGS += -e
|
|
|
|
|
|
|
|
MAIN_TARGET = cavm_platform_modules.deb
|
|
|
|
DEB_BUILD_DIR = cavm-platform-modules-deb
|
2017-02-06 00:17:25 -06:00
|
|
|
SCRIPT_SRC = $(DEB_BUILD_DIR)/
|
2017-05-18 02:59:54 -05:00
|
|
|
SYSTEMD_DIR = /etc/systemd/system
|
2017-01-12 20:02:19 -06:00
|
|
|
|
|
|
|
$(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)
|
2017-02-06 00:17:25 -06:00
|
|
|
mkdir -p $(DEB_BUILD_DIR)/usr/bin
|
2017-05-18 02:59:54 -05:00
|
|
|
mkdir -p $(DEB_BUILD_DIR)$(SYSTEMD_DIR)/multi-user.target.wants/
|
2017-01-12 20:02:19 -06:00
|
|
|
|
|
|
|
cp SONiC/AS7512-32X/module/*.ko $(DEB_BUILD_DIR)/lib/modules/$(KVERSION)
|
2017-02-06 00:17:25 -06:00
|
|
|
cp SONiC/AS7512-32X/accton_as7512_util.py $(DEB_BUILD_DIR)/usr/bin
|
2017-05-18 02:59:54 -05:00
|
|
|
chmod +x $(DEB_BUILD_DIR)/usr/bin/accton_as7512_util.py
|
|
|
|
cp as7512-platform-init.service $(DEB_BUILD_DIR)$(SYSTEMD_DIR)
|
|
|
|
ln -s $(SYSTEMD_DIR)/as7512-platform-init.service $(DEB_BUILD_DIR)$(SYSTEMD_DIR)/multi-user.target.wants/as7512-platform-init.service
|
2017-01-12 20:02:19 -06:00
|
|
|
cp -r DEBIAN $(DEB_BUILD_DIR)
|
|
|
|
dpkg-deb -b $(DEB_BUILD_DIR) $(MAIN_TARGET)
|
|
|
|
|
|
|
|
mv $(MAIN_TARGET) $(DEST)/
|
|
|
|
rm -rf $(DEB_BUILD_DIR)
|
|
|
|
|