2018-04-02 21:06:00 -05:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
export INSTALL_MOD_DIR:=extra
|
|
|
|
|
2019-11-08 23:49:46 -06:00
|
|
|
PYTHON ?= python2.7
|
2018-04-02 21:06:00 -05:00
|
|
|
|
|
|
|
PACKAGE_PRE_NAME := sonic-platform-accton
|
|
|
|
KVERSION ?= $(shell uname -r)
|
|
|
|
KERNEL_SRC := /lib/modules/$(KVERSION)
|
|
|
|
MOD_SRC_DIR:= $(shell pwd)
|
|
|
|
MODULE_DIRS:= as7116-54x
|
|
|
|
MODULE_DIR := modules
|
|
|
|
UTILS_DIR := utils
|
|
|
|
SERVICE_DIR := service
|
|
|
|
CLASSES_DIR := classes
|
|
|
|
CONF_DIR := conf
|
|
|
|
|
|
|
|
%:
|
2019-11-08 23:49:46 -06:00
|
|
|
dh $@
|
2018-04-02 21:06:00 -05:00
|
|
|
|
2019-11-08 23:49:46 -06:00
|
|
|
override_dh_auto_build:
|
2018-04-02 21:06:00 -05:00
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
2019-11-08 23:49:46 -06:00
|
|
|
$(PYTHON) $${mod}/setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
2018-04-02 21:06:00 -05:00
|
|
|
done)
|
|
|
|
|
2019-11-08 23:49:46 -06:00
|
|
|
override_dh_auto_install:
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} /$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko \
|
|
|
|
debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
done)
|
2018-04-02 21:06:00 -05:00
|
|
|
|
2019-11-08 23:49:46 -06:00
|
|
|
override_dh_usrlocal:
|
2018-04-02 21:06:00 -05:00
|
|
|
|
2019-11-08 23:49:46 -06:00
|
|
|
override_dh_clean:
|
|
|
|
dh_clean
|
2018-04-02 21:06:00 -05:00
|
|
|
(for mod in $(MODULE_DIRS); do \
|
2019-11-08 23:49:46 -06:00
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
|
2018-04-02 21:06:00 -05:00
|
|
|
done)
|