-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (24 loc) · 1.01 KB
/
Makefile
File metadata and controls
29 lines (24 loc) · 1.01 KB
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
UBBD_KERNEL_DIR := $(shell pwd)
VERSION ?= $(shell cat VERSION)
UBBD_KERNEL_VERSION ?= ubbd-kernel-dkms-$(VERSION)
KERNEL_VERSION ?= $(shell uname -r)
DIST_FILES := ubbd-headers Makefile src VERSION install_dep.sh debian rpm dkms.conf.in
mod:
cd src; UBBD_HEADER_DIR="$(UBBD_KERNEL_DIR)/ubbd-headers" make mod
install:
cd src/; make install
files_install:
mkdir -p $(DESTDIR)/lib/modules/$(KERNEL_VERSION)/extra/
install src/ubbd.ko $(DESTDIR)/lib/modules/$(KERNEL_VERSION)/extra/ubbd.ko
uninstall:
cd src/; make uninstall
clean:
cd src/; make clean
dist:
git submodule update --init --recursive
sed "s/@VERSION@/$(VERSION)/g" rpm/ubbd-kernel.spec.in > rpm/ubbd-kernel.spec
sed -i 's/@KVER@/$(KERNEL_VERSION)/g' rpm/ubbd-kernel.spec
cd /tmp && mkdir -p $(UBBD_KERNEL_VERSION) && \
for u in $(DIST_FILES); do cp -rf $(UBBD_KERNEL_DIR)/$$u $(UBBD_KERNEL_VERSION); done && \
tar --format=posix -chf - $(UBBD_KERNEL_VERSION) | gzip -c > $(UBBD_KERNEL_DIR)/$(UBBD_KERNEL_VERSION).tar.gz && \
rm -rf $(UBBD_KERNEL_VERSION)