summaryrefslogtreecommitdiff
path: root/Makefile
blob: d9bd337b9c4f76de48b54694011ebef3340d5c07 (plain)
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
V=$(shell git describe --exact-match)

INSTALL_FILES=$(wildcard archiso/initcpio/install/*)
HOOKS_FILES=$(wildcard archiso/initcpio/hooks/*)
SCRIPT_FILES=$(wildcard archiso/initcpio/script/*)

INSTALL_DIR=$(DESTDIR)/usr/lib/initcpio/install
HOOKS_DIR=$(DESTDIR)/usr/lib/initcpio/hooks
SCRIPT_DIR=$(DESTDIR)/usr/lib/initcpio

DOC_FILES=$(wildcard docs/*)

DOC_DIR=$(DESTDIR)/usr/share/doc/archiso


all:

check:
	shellcheck -s bash archiso/mkarchiso \
	                   scripts/run_archiso.sh \
	                   $(INSTALL_FILES) \
	                   $(wildcard configs/*/build.sh) \
	                   configs/releng/airootfs/root/.automated_script.sh \
	                   configs/releng/airootfs/usr/local/bin/choose-mirror
	shellcheck -s dash $(HOOKS_FILES) $(SCRIPT_FILES)

install: install-program install-initcpio install-examples install-doc

install-program:
	install -D -m 755 archiso/mkarchiso $(DESTDIR)/usr/bin/mkarchiso

install-initcpio:
	install -d $(SCRIPT_DIR) $(HOOKS_DIR) $(INSTALL_DIR)
	install -m 755 -t $(SCRIPT_DIR) $(SCRIPT_FILES)
	install -m 644 -t $(HOOKS_DIR) $(HOOKS_FILES)
	install -m 644 -t $(INSTALL_DIR) $(INSTALL_FILES)

install-examples:
	install -d -m 755 $(DESTDIR)/usr/share/archiso/
	cp -a --no-preserve=ownership configs $(DESTDIR)/usr/share/archiso/

install-doc:
	install -d $(DOC_DIR)
	install -m 644 -t $(DOC_DIR) $(DOC_FILES)

dist:
	git archive --format=tar --prefix=archiso32-$(V)/ $(V) | gzip -9 > archiso32-$(V).tar.gz
	gpg --detach-sign --use-agent archiso32-$(V).tar.gz

upload:
	scp archiso32-$(V).tar.gz archiso32-$(V).tar.gz.sig sources.archlinux32.org:sources/

.PHONY: check install install-program install-initcpio install-examples install-doc dist upload