forked from ali1234/rpi-toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (45 loc) · 1.9 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
TARGET:=arm-linux-gnueabihf
VERSION:=$(shell git describe --always --dirty)
NAME:=raspbian-$(VERSION)
TOOLCHAIN:=toolchain-$(NAME)-x86_64-$(TARGET)
SRC:=src-$(NAME)
URL:=https://github.com/ali1234/rpi-toolchain/issues/new?body=Version:%20$(VERSION)
export DEB_TARGET_MULTIARCH=$(TARGET)
all: $(TOOLCHAIN).tar.xz.asc $(SRC).tar.xz.asc
%.tar.xz.asc: %.tar.xz
sha256sum $< > $@
.config: ct-ng-config
sed -E -e 's|^(CT_TOOLCHAIN_PKGVERSION)=.*|\1=\"$(NAME)\"|' \
-e 's|^(CT_TOOLCHAIN_BUGURL)=.*|\1=\"$(NAME)\"|' ct-ng-config > .config
result/success: .config
ct-ng build && touch result/success
$(TOOLCHAIN).tar.xz: result/success
rm -rf --one-file-system result/$(TOOLCHAIN)
mkdir result/$(TOOLCHAIN)
rsync -av result/$(TARGET)/* result/$(TOOLCHAIN)
ct-ng --version > result/$(TOOLCHAIN)/ct-ng-version
cp .config result/$(TOOLCHAIN)/ct-ng-config
tar Jcf $(TOOLCHAIN).tar.xz --directory result $(TOOLCHAIN)
$(SRC).tar.xz: result/success
ct-ng --version > src/ct-ng-version
cp .config src/ct-ng-config
tar Jcf $(SRC).tar.xz src
saveconfig:
sed -E -e 's|^(CT_TOOLCHAIN_PKGVERSION)=.*|\1=\"\"|' \
-e 's|^(CT_TOOLCHAIN_BUGURL)=.*|\1=\"\"|' .config > ct-ng-config
menuconfig: .config
ct-ng menuconfig
clean:
rm -rf build result build.log .config .config.old
rm -rf $(TOOLCHAIN).tar.xz $(TOOLCHAIN).tar.xz.asc $(SRC).tar.xz $(SRC).tar.xz.asc
reallyclean: clean
rm -rf *.tar.xz *.tar.xz.asc
indocker:
docker build -t rpi-toolchain .
docker create -ti --name rpi-toolchain-tmp rpi-toolchain
docker cp rpi-toolchain-tmp:/home/toolchain/rpi-toolchain/$(TOOLCHAIN).tar.xz .
docker cp rpi-toolchain-tmp:/home/toolchain/rpi-toolchain/$(TOOLCHAIN).tar.xz.asc .
docker cp rpi-toolchain-tmp:/home/toolchain/rpi-toolchain/$(SRC).tar.xz .
docker cp rpi-toolchain-tmp:/home/toolchain/rpi-toolchain/$(SRC).tar.xz.asc .
docker cp rpi-toolchain-tmp:/home/toolchain/rpi-toolchain/build.log .
docker rm -f rpi-toolchain-tmp