forked from djkabutar/rk3399_kernel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.mk
60 lines (48 loc) · 1.99 KB
/
dev.mk
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
51
52
53
54
55
56
57
58
59
60
RELEASE ?=
KERNEL_DEFCONFIG ?= rockchip_linux_defconfig
KERNEL_VERSION ?= $(shell $(KERNEL_MAKE) -s kernelversion)
KERNEL_RELEASE ?= $(shell $(KERNEL_MAKE) -s kernelrelease)
KDEB_PKGVERSION ?= $(KERNEL_VERSION)-$(RELEASE)-rockchip-ayufan
KERNEL_MAKE ?= make \
ARCH=arm64 \
HOSTCC=aarch64-linux-gnu-gcc \
CROSS_COMPILE="ccache aarch64-linux-gnu-"
.config: arch/arm64/configs/$(KERNEL_DEFCONFIG)
$(KERNEL_MAKE) $(KERNEL_DEFCONFIG)
.PHONY: .scmversion
.scmversion:
ifneq (,$(RELEASE))
@echo "-$(RELEASE)-rockchip-ayufan-g$$(git rev-parse --short HEAD)" > .scmversion
else
@echo "-rockchip-dev" > .scmversion
endif
version:
@echo "$(KDEB_PKGVERSION)"
.PHONY: info
info: .config .scmversion
@echo $(KERNEL_RELEASE)
.PHONY: kernel-menuconfig
kernel-menuconfig:
$(KERNEL_MAKE) $(KERNEL_DEFCONFIG)
$(KERNEL_MAKE) HOSTCC=gcc menuconfig
$(KERNEL_MAKE) savedefconfig
mv defconfig arch/arm64/configs/$(KERNEL_DEFCONFIG)
.PHONY: kernel-image
kernel-image: .config .scmversion
$(KERNEL_MAKE) Image dtbs -j$$(nproc)
.PHONY: kernel-modules
kernel-image-and-modules: .config .scmversion
$(KERNEL_MAKE) Image modules dtbs -j$$(nproc)
$(KERNEL_MAKE) modules_install INSTALL_MOD_PATH=$(CURDIR)/out/linux_modules
.PHONY: kernel-package
kernel-package: .config .scmversion
KDEB_PKGVERSION=$(KDEB_PKGVERSION) $(KERNEL_MAKE) bindeb-pkg -j$$(nproc)
.PHONY: kernel-update-dts
kernel-update-dts: .config .scmversion
$(KERNEL_MAKE) dtbs -j$$(nproc)
rsync --partial --checksum --include="*.dtb" -rv arch/arm64/boot/dts/rockchip root@$(REMOTE_HOST):$(REMOTE_DIR)/boot/dtbs/$(KERNEL_RELEASE)
.PHONY: kernel-update
kernel-update-image: .scmversion
rsync --partial --checksum -rv arch/arm64/boot/Image root@$(REMOTE_HOST):$(REMOTE_DIR)/boot/vmlinuz-$(KERNEL_RELEASE)
rsync --partial --checksum --include="*.dtb" -rv arch/arm64/boot/dts/rockchip root@$(REMOTE_HOST):$(REMOTE_DIR)/boot/dtbs/$(KERNEL_RELEASE)
rsync --partial --checksum --delete -av out/linux_modules/lib/modules/$(KERNEL_RELEASE) root@$(REMOTE_HOST):$(REMOTE_DIR)/lib/modules/