2018-02-15 21:22:49 -06:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
export INSTALL_MOD_DIR:=extra
|
2022-05-23 20:45:37 -05:00
|
|
|
export KBUILD_EXTRA_SYMBOLS := /sonic/platform/pddf/i2c/Module.symvers.PDDF
|
2018-02-15 21:22:49 -06:00
|
|
|
|
|
|
|
KVERSION ?= $(shell uname -r)
|
|
|
|
KERNEL_SRC := /lib/modules/$(KVERSION)
|
|
|
|
MOD_SRC_DIR:= $(shell pwd)
|
2022-05-23 20:45:37 -05:00
|
|
|
MODULE_DIRS:= dx010 haliburton silverstone seastone2 belgite
|
2018-02-15 21:22:49 -06:00
|
|
|
|
|
|
|
%:
|
|
|
|
dh $@
|
|
|
|
|
|
|
|
override_dh_auto_build:
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
2020-09-09 12:32:56 -05:00
|
|
|
if [ $$mod = "seastone2" ]; then \
|
2022-01-16 00:41:28 -06:00
|
|
|
cd $(MOD_SRC_DIR)/services/platform_api; \
|
2021-03-08 12:10:11 -06:00
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
continue; \
|
|
|
|
fi; \
|
2022-05-23 20:45:37 -05:00
|
|
|
if [ $$mod = "belgite" ]; then \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
|
|
|
if [ -d $(MOD_SRC_DIR)/$${mod}/pddf ]; then \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}/pddf; \
|
|
|
|
if [ -f sonic_platform_setup.py ]; then \
|
|
|
|
python3 sonic_platform_setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/pddf; \
|
|
|
|
echo "Finished makig pddf whl package for $$mod"; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
continue; \
|
|
|
|
fi; \
|
2021-03-08 12:10:11 -06:00
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
2018-02-15 21:22:49 -06:00
|
|
|
done)
|
|
|
|
|
|
|
|
override_dh_auto_install:
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
dh_installdirs -pplatform-modules-$${mod} \
|
|
|
|
$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
cp $(MOD_SRC_DIR)/$${mod}/modules/*.ko \
|
|
|
|
debian/platform-modules-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
done)
|
|
|
|
|
|
|
|
override_dh_usrlocal:
|
|
|
|
|
|
|
|
override_dh_clean:
|
|
|
|
dh_clean
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
|
2022-05-23 20:45:37 -05:00
|
|
|
if [ -f $(MOD_SRC_DIR)/$${mod}/pddf/*.whl ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/pddf/*.whl; \
|
|
|
|
fi; \
|
2018-02-15 21:22:49 -06:00
|
|
|
done)
|