Merge pull request #1027 from AladW/build-asroot-example
[aurutils.git] / Makefile
blob3276391e6c0f2dd7d450ab0d053523cbc5ea1097
1 PROGNM = aurutils
2 PREFIX ?= /usr
3 SHRDIR ?= $(PREFIX)/share
4 BINDIR ?= $(PREFIX)/bin
5 LIBDIR ?= $(PREFIX)/lib
6 ETCDIR ?= /etc
7 AURUTILS_LIB_DIR ?= $(LIBDIR)/$(PROGNM)
8 AURUTILS_VERSION ?= $(shell git describe --tags || true)
9 ifeq ($(AURUTILS_VERSION),)
10 AURUTILS_VERSION := 11
11 endif
13 .PHONY: shellcheck install build completion aur
15 build: aur completion
17 aur: aur.in
18 sed -e 's|AURUTILS_LIB_DIR|$(AURUTILS_LIB_DIR)|' \
19 -e 's|AURUTILS_VERSION|$(AURUTILS_VERSION)|' $< >$@
21 completion:
22 @$(MAKE) -C completions bash zsh
24 shellcheck: aur
25 @shellcheck -x -f gcc -e 1071 aur lib/*
27 test: aur shellcheck
28 @tests/parseopt-consistency
30 install-aur: aur
31 @install -Dm755 aur -t '$(DESTDIR)$(BINDIR)'
33 install: install-aur
34 @install -Dm755 lib/aur-* -t '$(DESTDIR)$(LIBDIR)/$(PROGNM)'
35 @install -Dm644 man1/* -t '$(DESTDIR)$(SHRDIR)/man/man1'
36 @install -Dm644 man7/* -t '$(DESTDIR)$(SHRDIR)/man/man7'
37 @install -Dm644 LICENSE -t '$(DESTDIR)$(SHRDIR)/licenses/$(PROGNM)'
38 @install -Dm644 README.md -t '$(DESTDIR)$(SHRDIR)/doc/$(PROGNM)'
39 @install -Dm644 examples/* -t '$(DESTDIR)$(SHRDIR)/doc/$(PROGNM)/examples'
40 @install -dm755 aurutils '$(DESTDIR)$(ETCDIR)/$(PROGNM)'
41 @$(MAKE) -C completions DESTDIR='$(DESTDIR)' install-bash install-zsh