author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 08 Jan 2010 22:22:40 +0200 | |
changeset 23 | 946ae4b96419 |
parent 22 | 0616adf6e983 |
child 26 | 6dfc4ac2dc80 |
permissions | -rw-r--r-- |
22
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
1 |
# Available target: |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
2 |
# |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
3 |
# all build dictionaries |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
4 |
# install install dictionaries, so they been available in stardict, may require root permission |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
5 |
# uninstall remove dictionaries, they been unavailable in stardict, may require root permission |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
6 |
# install-local install dictionaries in user HOME dir, so they been available in stardict for that user |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
7 |
# uninstall-local remove dictionaries from user HOME directory |
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
8 |
|
0 | 9 |
|
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
10 |
# On Debian Etch 'stardict-tools' package not placed tools in any system bin dir. |
0 | 11 |
export PATH := $(PATH):/usr/lib/stardict-tools |
12 |
||
13 |
DICSETNAME = gavenkoa-dicts |
|
14 |
||
15 |
prefix = /usr/local |
|
16 |
datarootdir = $(prefix)/share |
|
17 |
datadir = $(datarootdir)/stardict |
|
18 |
dicdir = $(datadir)/dic/$(DICSETNAME) |
|
19 |
||
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
20 |
# Per user dictionaries hold in user HOME directory. |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
21 |
dicdir-local = $(HOME)/.stardict/dic/$(DICSETNAME) |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
22 |
|
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
23 |
F_TAB_ = $(wildcard *.tab_) |
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
24 |
|
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
25 |
F_TAB = $(patsubst %.tab_,%.tab,$(F_TAB_)) |
0 | 26 |
FNAME = $(patsubst %.tab,%,$(F_TAB)) |
27 |
F_DICT = $(patsubst %.tab,%.dict.dz,$(F_TAB)) |
|
28 |
F_IFO = $(patsubst %.tab,%.ifo,$(F_TAB)) |
|
29 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
30 |
.PHONY: all |
0 | 31 |
all: dist |
32 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
33 |
.PHONY: verify |
0 | 34 |
verify: dist |
35 |
@echo |
|
36 |
@for dic in $(F_IFO); do \ |
|
37 |
stardict_verify $$dic; \ |
|
38 |
done |
|
39 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
40 |
.PHONY: dist |
0 | 41 |
dist: $(F_DICT) |
42 |
||
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
43 |
%.tab: %.tab_ |
20
9f5eedd08178
Filter lines beginning with # from .tab_ file (for purpose use they as comment lines).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
44 |
sed -e '/^#/d' -e 's_\\n _\\n_g' > $@ < $< |
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
45 |
|
9
976f8876799d
Added forgotten dependence.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
3
diff
changeset
|
46 |
%.dict.dz: %.tab %.descr |
0 | 47 |
tabfile $< |
3
cc5593c28a4b
Update .ifo file with author/date/description info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1
diff
changeset
|
48 |
/bin/sh update-ifo.sh $*.ifo |
0 | 49 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
50 |
.PHONY: install |
0 | 51 |
install: dist |
52 |
mkdir -p $(dicdir) |
|
53 |
for dic in $(FNAME); do \ |
|
54 |
install -m 644 $$dic.dict.dz $(dicdir); \ |
|
55 |
install -m 644 $$dic.idx $(dicdir); \ |
|
56 |
install -m 644 $$dic.ifo $(dicdir); \ |
|
57 |
done |
|
58 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
59 |
.PHONY: uninstall |
0 | 60 |
uninstall: |
61 |
rm -r -f $(dicdir) |
|
62 |
||
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
63 |
.PHONY: install-local |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
64 |
install-local: |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
65 |
mkdir -p $(dicdir-local) |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
66 |
for dic in $(FNAME); do \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
67 |
install -m 644 $$dic.dict.dz $(dicdir-local); \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
68 |
install -m 644 $$dic.idx $(dicdir-local); \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
69 |
install -m 644 $$dic.ifo $(dicdir-local); \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
70 |
done |
13
d0e948499faf
Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
9
diff
changeset
|
71 |
|
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
72 |
.PHONY: uninstall-local |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
73 |
uninstall-local: |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
74 |
rm -f -r $(HOME)/.stardict/dic/$(DICSETNAME) |
13
d0e948499faf
Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
9
diff
changeset
|
75 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
76 |
.PHONY: clean |
0 | 77 |
clean: |
78 |
for dic in $(FNAME); do \ |
|
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
79 |
rm -f $$dic.dict.dz $$dic.idx $$dic.ifo $$dic.tab; \ |
0 | 80 |
done |
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
81 |
|
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
82 |
.PHONY: distclean |
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
83 |
distclean: clean |