2020-08-06 05:16:11 -05:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- makefile -*-
|
|
|
|
# Sample debian/rules that uses debhelper.
|
|
|
|
# This file was originally written by Joey Hess and Craig Small.
|
|
|
|
# As a special exception, when this file is copied by dh-make into a
|
|
|
|
# dh-make output file, you may use that output file without restriction.
|
|
|
|
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
|
|
|
|
|
|
|
include /usr/share/dpkg/pkg-info.mk
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
|
|
|
export INSTALL_MOD_DIR:=extra
|
|
|
|
|
2021-05-01 12:37:07 -05:00
|
|
|
PACKAGE_PRE_NAME := platform-modules-e530
|
2020-08-06 05:16:11 -05:00
|
|
|
KVERSION ?= $(shell uname -r)
|
|
|
|
KERNEL_SRC := /lib/modules/$(KVERSION)
|
|
|
|
MOD_SRC_DIR:= $(shell pwd)
|
2021-05-01 12:37:07 -05:00
|
|
|
MODULE_DIRS:= 48t4x-p 24x2c 48s4x 24x2q
|
2020-08-06 05:16:11 -05:00
|
|
|
MODULE_DIR := modules
|
|
|
|
SERVICE_DIR := service
|
|
|
|
CLASSES_DIR := classes
|
|
|
|
CONF_DIR := conf
|
|
|
|
KDAL_DIR := ../../centec/centec-dal/
|
2021-05-01 12:37:07 -05:00
|
|
|
FAN_DIR := fan
|
2020-08-06 05:16:11 -05:00
|
|
|
|
|
|
|
%:
|
2021-05-01 12:37:07 -05:00
|
|
|
dh $@
|
2020-08-06 05:16:11 -05:00
|
|
|
|
|
|
|
clean:
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_clean
|
|
|
|
|
|
|
|
build:
|
|
|
|
#make modules -C $(KERNEL_SRC)/build M=$(MODULE_SRC)
|
|
|
|
(for mod in $(KDAL_DIR); do \
|
|
|
|
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/; \
|
|
|
|
done)
|
2021-05-01 12:37:07 -05:00
|
|
|
(for mod in $(FAN_DIR); do \
|
|
|
|
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/; \
|
|
|
|
done)
|
2020-08-06 05:16:11 -05:00
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
2021-05-01 12:37:07 -05:00
|
|
|
cd $${mod}; \
|
|
|
|
python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
|
|
|
|
cd -; \
|
2020-08-06 05:16:11 -05:00
|
|
|
done)
|
|
|
|
|
|
|
|
binary: binary-arch binary-indep
|
|
|
|
# Nothing to do
|
|
|
|
|
|
|
|
binary-arch:
|
|
|
|
# Nothing to do
|
|
|
|
|
|
|
|
#install: build
|
|
|
|
#dh_testdir
|
|
|
|
#dh_testroot
|
|
|
|
#dh_clean -k
|
|
|
|
#dh_installdirs
|
|
|
|
|
|
|
|
binary-indep:
|
|
|
|
dh_testdir
|
|
|
|
dh_installdirs
|
|
|
|
|
|
|
|
# Custom package commands
|
|
|
|
(for mod in $(MODULE_DIRS); do \
|
|
|
|
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \
|
2021-05-01 12:37:07 -05:00
|
|
|
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} etc; \
|
2020-08-06 05:16:11 -05:00
|
|
|
cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
|
|
|
cp $(MOD_SRC_DIR)/$(KDAL_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
2021-05-01 12:37:07 -05:00
|
|
|
cp $(MOD_SRC_DIR)/$(FAN_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
2020-08-06 05:16:11 -05:00
|
|
|
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \
|
|
|
|
done)
|
|
|
|
# Resuming debhelper scripts
|
|
|
|
dh_testroot
|
|
|
|
dh_install
|
|
|
|
dh_installchangelogs
|
|
|
|
dh_installdocs
|
|
|
|
dh_systemd_enable
|
|
|
|
dh_installinit
|
|
|
|
dh_systemd_start
|
|
|
|
dh_link
|
|
|
|
dh_fixperms
|
|
|
|
dh_compress
|
|
|
|
dh_strip
|
|
|
|
dh_installdeb
|
|
|
|
dh_gencontrol
|
|
|
|
dh_md5sums
|
|
|
|
dh_builddeb
|
|
|
|
.PHONY: build binary binary-arch binary-indep clean
|