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

3
BOARD=imx6
4
TYPE=unstable
5 6
IMAGE=$(BOARD).img
COMPRESSED=$(IMAGE).xz
7
CHECKSUM=sha256sums
Guido Gunther's avatar
Guido Gunther committed
8
DIST=buster+ci
9 10 11 12 13 14 15
DEPS=\
  build-image   \
  root.sh       \
  conf/board    \
  conf/packages \
  $(NULL)

Guido Gunther's avatar
Guido Gunther committed
16

17
.PHONY: all
18
all: $(COMPRESSED)
Guido Gunther's avatar
Guido Gunther committed
19

20 21
$(IMAGE): tmp/$(IMAGE).stamp
tmp/$(IMAGE).stamp: local.sh-link $(DEPS)
Guido Gunther's avatar
Guido Gunther committed
22
	./build-image -b $(BOARD) -T $(TYPE) -d $(DIST)
23
	touch tmp/$(IMAGE).stamp
Guido Gunther's avatar
Guido Gunther committed
24

25
%.img.xz: %.img tmp/%.img.stamp
26 27
	xz -T0 --stdout $< > $@.tmp
	mv $@.tmp $@
Guido Gunther's avatar
Guido Gunther committed
28

29 30
$(CHECKSUM):
	sha256sum $(COMPRESSED) > $@.tmp
Guido Gunther's avatar
Guido Gunther committed
31
	mv $@.tmp $@
Guido Gunther's avatar
Guido Gunther committed
32

Guido Gunther's avatar
Guido Gunther committed
33
clean:
34
	rm -rf files/ tmp/ $(IMAGE) $(COMPRESSED) $(CHECKSUM)*
Guido Gunther's avatar
Guido Gunther committed
35 36

check:
Guido Gunther's avatar
Guido Gunther committed
37 38
	shellcheck -x ./build-image
	bash -n root.sh
39

40 41
publish: $(CHECKSUM)
	bin/sign-checksum
42
	bin/publish -T ${TYPE}
43

44 45 46 47 48 49 50
local.sh-link:
	if test -e local.sh; then \
		mkdir -p files; \
		ln -sf ../local.sh files; \
	fi

.PHONY: all publish local.sh-link