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

3
BOARD=imx6
4
IMAGE=$(BOARD).img
5
TARBALL=$(BOARD).tar.xz
6
COMPRESSED=$(IMAGE).xz
7
CHECKSUM=sha256sums
8 9 10 11 12 13 14
DEPS=\
  build-image   \
  root.sh       \
  conf/board    \
  conf/packages \
  $(NULL)

Guido Gunther's avatar
Guido Gunther committed
15

16
all: $(CHECKSUM)
Guido Gunther's avatar
Guido Gunther committed
17

18
tmp/$(IMAGE).stamp $(IMAGE) $(TARBALL): $(DEPS)
19
	./build-image -b $(BOARD)
20
	touch tmp/$(IMAGE).stamp
Guido Gunther's avatar
Guido Gunther committed
21

22
%.img.xz: %.img tmp/%.img.stamp
23 24
	xz -T0 --stdout $< > $@.tmp
	mv $@.tmp $@
Guido Gunther's avatar
Guido Gunther committed
25

26
$(CHECKSUM): $(COMPRESSED) $(TARBALL)
27
	sha256sum $^ > $@.tmp
Guido Gunther's avatar
Guido Gunther committed
28
	mv $@.tmp $@
Guido Gunther's avatar
Guido Gunther committed
29

Guido Gunther's avatar
Guido Gunther committed
30
clean:
31
	rm -rf files/ tmp/ $(IMAGE) $(COMPRESSED) $(CHECKSUM)*
Guido Gunther's avatar
Guido Gunther committed
32 33

check:
Guido Gunther's avatar
Guido Gunther committed
34 35
	shellcheck -x ./build-image
	bash -n root.sh
36

37 38 39
publish: $(CHECKSUM)
	bin/sign-checksum
	bin/publish
40

41
.PHONY: all publish