forked from soimort/translate-shell
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 981 Bytes
/
Makefile
File metadata and controls
42 lines (31 loc) · 981 Bytes
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
NAME = "translate-shell"
COMMAND = trans
BUILDDIR = build
MANDIR = man
TARGET = bash
PREFIX = /usr/local
.PHONY: default clean build release grip test check install uninstall
default: build
clean:
@gawk -f build.awk clean
build:
@gawk -f build.awk build -target=$(TARGET)
release:
@gawk -f build.awk build -target=$(TARGET) -type=release
grip:
@gawk -f build.awk readme && grip
test: build
@gawk -f test.awk
check: test
$(BUILDDIR)/$(COMMAND) -V
[ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b 忍者`" = 'Ninja' ] &&\
[ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b 'hello world'`" = 'hello world' ]
install: build
@mkdir -p $(PREFIX)/bin &&\
install $(BUILDDIR)/$(COMMAND) $(PREFIX)/bin/$(COMMAND) &&\
mkdir -p $(PREFIX)/share/man/man1 &&\
cp $(MANDIR)/$(COMMAND).1 $(PREFIX)/share/man/man1/$(COMMAND).1 &&\
echo "[OK] $(NAME) installed."
uninstall:
@rm $(PREFIX)/bin/$(COMMAND) $(PREFIX)/share/man/man1/$(COMMAND).1 &&\
echo "[OK] $(NAME) uninstalled."