forked from soimort/translate-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (32 loc) · 1.1 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
40
41
42
43
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 -e bing 忍者`" = 'ninja' ] #&&\
#[ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e yandex Ninja`" = 'Ninja' ]
install: build
@mkdir -p $(DESTDIR)$(PREFIX)/bin &&\
install $(BUILDDIR)/$(COMMAND) $(DESTDIR)$(PREFIX)/bin/$(COMMAND) &&\
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 &&\
install $(MANDIR)/$(COMMAND).1 $(DESTDIR)$(PREFIX)/share/man/man1/$(COMMAND).1 &&\
echo "[OK] $(NAME) installed."
uninstall:
@rm $(DESTDIR)$(PREFIX)/bin/$(COMMAND) $(DESTDIR)$(PREFIX)/share/man/man1/$(COMMAND).1 &&\
echo "[OK] $(NAME) uninstalled."