-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (65 loc) · 2 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
PROJECT ?= linux-sky1
PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib
MANDIR ?= $(PREFIX)/share/man
KERNEL_FORK ?= sky1
ARCH ?= arm64
CROSS_COMPILE ?= aarch64-linux-gnu-
DPKG_FLAGS ?= -d
KERNEL_DEFCONFIG ?= defconfig cix.config radxa.config radxa_custom.config
KMAKE ?= $(MAKE) -C "$(SRC-KERNEL)" -j$(shell nproc) \
ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) HOSTCC=$(CROSS_COMPILE)gcc \
KDEB_COMPRESS="xz" KDEB_CHANGELOG_DIST="unstable" DPKG_FLAGS=$(DPKG_FLAGS) \
LOCALVERSION=-$(shell dpkg-parsechangelog -S Version | cut -d "-" -f 2)-$(KERNEL_FORK) \
KERNELRELEASE=$(shell dpkg-parsechangelog -S Version)-$(KERNEL_FORK) \
KDEB_PKGVERSION=$(shell dpkg-parsechangelog -S Version)
.PHONY: all
all: build
#
# Test
#
.PHONY: test
test:
#
# Build
#
.PHONY: build
build: build-defconfig build-bindeb
SRC-KERNEL := src
.PHONY: build-defconfig
build-defconfig: $(SRC-KERNEL)
$(KMAKE) $(KERNEL_DEFCONFIG)
.PHONY: build-kernel
build-dtbs: $(SRC-KERNEL)
$(KMAKE) dtbs
.PHONY: build-kernel
build-all: $(SRC-KERNEL)
$(KMAKE) all
.PHONY: build-kernel
build-bindeb: $(SRC-KERNEL) build-all
$(KMAKE) bindeb-pkg
mv linux-*_arm64.deb linux-upstream*_arm64.changes linux-upstream*_arm64.buildinfo ../
#
# Clean
#
.PHONY: distclean
distclean: clean
.PHONY: clean
clean: clean-deb
.PHONY: clean-deb
clean-deb:
rm -rf debian/.debhelper debian/${PROJECT}*/ debian/linux-*/ debian/tmp/ debian/debhelper-build-stamp debian/files debian/*.debhelper.log debian/*.postrm.debhelper debian/*.substvars
rm -f linux-*_arm64.deb linux-upstream*_arm64.changes linux-upstream*_arm64.buildinfo
#
# Release
#
.PHONY: dch
dch: debian/changelog
EDITOR=true gbp dch --ignore-branch --multimaint-merge --commit --release --dch-opt=--upstream
.PHONY: deb
deb: debian
debuild --no-lintian --lintian-hook "lintian --fail-on error,warning --suppress-tags bad-distribution-in-changes-file -- %p_%v_*.changes" --no-sign -b
.PHONY: release
release:
gh workflow run .github/workflows/new_version.yml --ref $(shell git branch --show-current)