-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (30 loc) · 1.62 KB
/
Makefile
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
PREFIX ?= $(HOME)/.local
# General options
name = batch
version = $(shell git describe --tags --always)
target = $(shell llvm-config --host-target)
# Build options
static = no
ifeq ($(static),yes)
flags += --static
endif
build:
shards build --release $(flags)
gzip -9 -f -k extra/man/batch.1
mandoc -I os= -T html -O style="man-style.css",man="https://man.archlinux.org/man/%N.%S" extra/man/batch.1 > extra/man/batch.1.html
test:
crystal spec
release: clean build
mkdir -p releases
tar caf releases/$(name)-$(version)-$(target).tar.xz bin/batch extra/man/batch.1.gz extra/shell-completion/batch.bash extra/shell-completion/batch.zsh extra/shell-completion/batch.fish
install: build
install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/share/bash-completion/completions $(DESTDIR)$(PREFIX)/share/zsh/site-functions $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d
install -m 0755 bin/batch $(DESTDIR)$(PREFIX)/bin
install -m 0644 extra/man/batch.1.gz $(DESTDIR)$(PREFIX)/share/man/man1
install -m 0644 extra/shell-completion/batch.bash $(DESTDIR)$(PREFIX)/share/bash-completion/completions
install -m 0644 extra/shell-completion/batch.zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_batch
install -m 0644 extra/shell-completion/batch.fish $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/batch $(DESTDIR)$(PREFIX)/share/man/man1/batch.1.gz $(DESTDIR)$(PREFIX)/share/bash-completion/completions/batch.bash $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_batch $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/batch.fish
clean:
git clean -d -f -X