2018-08-12 19:22:08 -05:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
export INSTALL_MOD_DIR:=extra
|
|
|
|
|
|
|
|
KVERSION ?= $(shell uname -r)
|
|
|
|
KERNEL_SRC := /lib/modules/$(KVERSION)
|
|
|
|
MOD_SRC_DIR:= $(shell pwd)
|
2020-05-19 11:22:35 -05:00
|
|
|
MODULE_DIRS:= 48x6q 48x2q4z
|
2021-10-25 17:36:55 -05:00
|
|
|
PCA954X_DIR := pca954x
|
2018-08-12 19:22:08 -05:00
|
|
|
|
|
|
|
%:
|
|
|
|
dh $@
|
|
|
|
|
|
|
|
override_dh_auto_build:
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
done)
|
2021-10-25 17:36:55 -05:00
|
|
|
(for mod in $(PCA954X_DIR); do \
|
|
|
|
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/; \
|
|
|
|
done)
|
2021-10-26 14:55:24 -05:00
|
|
|
rm $(MOD_SRC_DIR)/centec-dal -rf
|
|
|
|
cp $(MOD_SRC_DIR)/../centec-dal $(MOD_SRC_DIR)/centec-dal -rf
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/centec-dal
|
2018-08-12 19:22:08 -05:00
|
|
|
|
|
|
|
override_dh_auto_install:
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
dh_installdirs -pplatform-modules-e582-$${mod} \
|
|
|
|
$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
cp -f $(MOD_SRC_DIR)/$${mod}/modules/*.ko \
|
|
|
|
debian/platform-modules-e582-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
2021-10-26 14:55:24 -05:00
|
|
|
cp -f $(MOD_SRC_DIR)/centec-dal/*.ko debian/platform-modules-e582-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
2021-10-25 17:36:55 -05:00
|
|
|
cp -f $(MOD_SRC_DIR)/$(PCA954X_DIR)/*.ko debian/platform-modules-e582-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
2018-08-12 19:22:08 -05:00
|
|
|
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; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/modules/*.ko; \
|
|
|
|
rm -rf debian/platform-modules-e582-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR)/*.ko; \
|
|
|
|
done)
|
2021-10-26 14:55:24 -05:00
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/centec-dal clean; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/centec-dal/*.ko; \
|
|
|
|
rm $(MOD_SRC_DIR)/centec-dal -rf
|
2018-08-12 19:22:08 -05:00
|
|
|
|