aboutsummarylogtreecommitdiffstats
path: root/Makefile
blob: 250ef05ce3320c128d81447518226601d249a15e (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
# vim: ts=4 sw=4 noet

PKG = $(shell awk -F = '/^pkgname/ {print $$2}' PKGBUILD)

define usage

Available make targets:

  build    Build $(PKG) but do not install
  check    Check shell scripts
  clean    Cleanup build artifacts
  help     Display this text
  install  Build and install $(PKG)
  janitor  Housekeeping
  remove   Print command to uninstall $(PKG) and its orphaned dependencies

endef

.PHONY:	build check clean help janitor remove

help:
	$(info $(usage))
	@exit 0

clean:
	rm -fr pkg src $(PKG)-*{log,gz,zst}*

build:	.SRCINFO
	makepkg --force --log --syncdeps --rmdeps

install:	.SRCINFO
	makepkg --force --log --syncdeps --rmdeps --install

remove:
	@echo -e "# Run the following only if you are certain:\nsudo pacman -Rs $(PKG)"

janitor:
	sort -o .gitignore .gitignore

check:
	shellcheck -s bash -e SC2034 PKGBUILD *.sh

.SRCINFO:	PKGBUILD
	updpkgsums && makepkg --printsrcinfo >$@