-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·50 lines (43 loc) · 1.25 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
KERN_VER=$(shell uname -r)
PKGNAME=oai-gtp-${KERN_VER}
VERSION=4.9
ITERATION=16
ARCH=amd64
PKGFMT=deb
WORK_DIR=/tmp/build-${PKGNAME}
PKGFILE=${PKGNAME}.${PKGFMT}
DEPMOD_CONFIG_DIR=/etc/depmod.d/
DEPMOD_CONFIG_FILE=${DEPMOD_CONFIG_DIR}/gtp.conf
OUTPUT_DIR=`pwd`
OUTPUT_PATH=${OUTPUT_DIR}/${PKGFILE}
obj-m += gtp.o
build:
make -C /lib/modules/`uname -r`/build M=$(PWD) modules
modules_install: build
make -C /lib/modules/`uname -r`/build M=$(PWD) modules_install
mkdir -p ${DEPMOD_CONFIG_DIR}
echo "override gtp.ko * extra" >> ${DEPMOD_CONFIG_FILE}
echo "override gtp.ko * weak-updates" >> ${DEPMOD_CONFIG_FILE}
depmod -a
package: build
rm -rf ${WORK_DIR}
mkdir ${WORK_DIR}
make INSTALL_MOD_PATH=${WORK_DIR} -C /lib/modules/`uname -r`/build M=$(PWD) modules_install
fpm \
-f \
-s dir \
-t ${PKGFMT} \
-a ${ARCH} \
-n ${PKGNAME} \
-v ${VERSION} \
--iteration ${ITERATION} \
--provides ${PKGNAME} \
--conflicts ${PKGNAME} \
--replaces ${PKGNAME} \
--package ${OUTPUT_PATH} \
--depends 'linux-image-${KERN_VER}' \
--description 'Flow-based GTP kernel module' \
--after-install scripts/after-install.sh \
-C ${WORK_DIR}
clean:
make -C /lib/modules/`uname -r`/build M=$(PWD) clean