Makefile 611 Bytes
Newer Older
Guido Gunther's avatar
Guido Gunther committed
1 2
# SPDX-License-Identifier: GPL-3.0+

3 4
BOARD=imx6
IMAGE=$(BOARD).img
5
TARBALL=$(BOARD).tar.xz
6
COMPRESSED=$(IMAGE).xz
7
CHECKSUM=sha256sums
Guido Gunther's avatar
Guido Gunther committed
8

9
all: $(CHECKSUM)
Guido Gunther's avatar
Guido Gunther committed
10

11 12
tmp/$(IMAGE).stamp $(IMAGE) $(TARBALL): build-image root.sh
	./build-image -b $(BOARD)
13
	touch tmp/$(IMAGE).stamp
Guido Gunther's avatar
Guido Gunther committed
14

15
%.img.xz: %.img tmp/%.img.stamp
16 17
	xz -T0 --stdout $< > $@.tmp
	mv $@.tmp $@
Guido Gunther's avatar
Guido Gunther committed
18

19
$(CHECKSUM): $(COMPRESSED) $(TARBALL)
20
	sha256sum $^ > $@.tmp
Guido Gunther's avatar
Guido Gunther committed
21
	mv $@.tmp $@
Guido Gunther's avatar
Guido Gunther committed
22

Guido Gunther's avatar
Guido Gunther committed
23
clean:
24
	rm -rf files/ tmp/ $(IMAGE) $(COMPRESSED) $(CHECKSUM)*
Guido Gunther's avatar
Guido Gunther committed
25 26

check:
Guido Gunther's avatar
Guido Gunther committed
27 28
	shellcheck -x ./build-image
	bash -n root.sh
29

30 31 32
publish: $(CHECKSUM)
	bin/sign-checksum
	bin/publish
33

34
.PHONY: all publish