Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/Makefile
blob: 6faa2662044d76325ed9d451d85205406b373b78 (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
#
# SPDX-License-Identifier: GPL-3.0-or-later

PREFIX ?= /usr/local
INSTALL_DIR=$(DESTDIR)$(PREFIX)/lib/initcpio/install
HOOKS_DIR=$(DESTDIR)$(PREFIX)/lib/initcpio/hooks
DOC_DIR=$(DESTDIR)$(PREFIX)/share/doc/mkinitcpio-archiso

INSTALL_FILES=$(wildcard install/*)
HOOKS_FILES=$(wildcard hooks/*)
DOC_FILES=$(wildcard docs/*) $(wildcard *.rst)

all:

check: shellcheck shfmt

shellcheck:
	shellcheck -s bash $(INSTALL_FILES)
	shellcheck -s dash $(HOOKS_FILES)

shfmt:
	shfmt -i 4 -d $(HOOKS_FILES) $(INSTALL_FILES)

install: install-initcpio install-doc

install-initcpio:
	install -vDm 644 $(HOOKS_FILES) -t $(HOOKS_DIR)
	install -vDm 644 $(INSTALL_FILES) -t $(INSTALL_DIR)

install-doc:
	install -vDm 644 $(DOC_FILES) -t $(DOC_DIR)
	
uninstall: uninstall-initcpio uninstall-doc

uninstall-initcpio:
	-rm $(addprefix $(HOOKS_DIR)/, $(notdir $(HOOKS_FILES)))
	-rmdir $(HOOKS_DIR)
	-rm $(addprefix $(INSTALL_DIR)/, $(notdir $(INSTALL_FILES)))
	-rmdir $(INSTALL_DIR)

uninstall-doc:
	-rm $(addprefix $(DOC_DIR)/, $(notdir $(DOC_FILES)))
	-rmdir $(DOC_DIR)

.PHONY: check install install-initcpio uninstall uninstall-initcpio install-doc shellcheck shfmt