2018-08-13 05:31:11 -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)
|
2019-06-28 23:40:50 -05:00
|
|
|
MODULE_DIRS:= s6000 z9100 s6100 z9264f s5232f
|
2018-08-13 05:31:11 -05:00
|
|
|
COMMON_DIR := common
|
|
|
|
|
|
|
|
%:
|
|
|
|
dh $@
|
|
|
|
|
|
|
|
override_dh_auto_build:
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
if [ $$mod = "s6100" ]; then \
|
2018-09-09 02:13:19 -05:00
|
|
|
cp $(COMMON_DIR)/dell_pmc.c $(MOD_SRC_DIR)/$${mod}/modules/dell_s6100_lpc.c; \
|
|
|
|
cp $(COMMON_DIR)/dell_ich.c $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2018-08-13 05:31:11 -05:00
|
|
|
elif [ $$mod = "z9100" ]; then \
|
2018-09-09 02:13:19 -05:00
|
|
|
cp $(COMMON_DIR)/dell_pmc.c $(MOD_SRC_DIR)/$${mod}/modules/dell_mailbox.c; \
|
|
|
|
cp $(COMMON_DIR)/dell_ich.c $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2019-07-24 14:15:46 -05:00
|
|
|
elif [ $$mod = "s6000" ]; then \
|
|
|
|
cd $(MOD_SRC_DIR)/$${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd $(MOD_SRC_DIR); \
|
2018-08-13 05:31:11 -05:00
|
|
|
fi; \
|
|
|
|
echo "making man page alias $$mod -> $$mod APIs";\
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
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); \
|
2019-06-25 14:23:24 -05:00
|
|
|
if [ $$mod = "s6000" ]; then \
|
|
|
|
dh_installdirs -pplatform-modules-$${mod} usr/local/bin ; \
|
|
|
|
cp -r $(MOD_SRC_DIR)/$${mod}/scripts/* debian/platform-modules-$${mod}/usr/local/bin; \
|
|
|
|
fi; \
|
2018-08-13 05:31:11 -05:00
|
|
|
done)
|
|
|
|
|
|
|
|
override_dh_usrlocal:
|
|
|
|
|
|
|
|
override_dh_clean:
|
|
|
|
dh_clean
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
if [ $$mod = "s6100" ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_s6100_lpc.c; \
|
2018-09-09 02:13:19 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2018-08-13 05:31:11 -05:00
|
|
|
elif [ $$mod = "z9100" ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_mailbox.c; \
|
2018-09-09 02:13:19 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/dell_ich.c; \
|
2019-07-03 08:52:35 -05:00
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2019-07-24 14:15:46 -05:00
|
|
|
elif [ $$mod = "s6000" ]; then \
|
|
|
|
rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build; \
|
|
|
|
rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \
|
2018-08-13 05:31:11 -05:00
|
|
|
fi; \
|
|
|
|
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
|
|
|
|
done)
|
|
|
|
|