author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sun, 26 Sep 2010 18:40:06 +0300 | |
changeset 186 | 9f479453db7e |
parent 28 | 6bab39ff1663 |
child 36 | 6fee90eb2d85 |
child 41 | 8f1dc5d77f3d |
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 |
26
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
8 |
# install-local-symlink create symlink from installed dir to user HOME dir, so dictionaries been available in stardict |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
9 |
# uninstall-local-symlink remove symlink from user HOME directory |
22
0616adf6e983
Describe available build target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
10 |
|
0 | 11 |
|
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
12 |
# On Debian Etch 'stardict-tools' package not placed tools in any system bin dir. |
0 | 13 |
export PATH := $(PATH):/usr/lib/stardict-tools |
14 |
||
15 |
DICSETNAME = gavenkoa-dicts |
|
16 |
||
17 |
prefix = /usr/local |
|
18 |
datarootdir = $(prefix)/share |
|
19 |
datadir = $(datarootdir)/stardict |
|
20 |
dicdir = $(datadir)/dic/$(DICSETNAME) |
|
21 |
||
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
22 |
# Per user dictionaries hold in user HOME directory. |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
23 |
dicdir-local = $(HOME)/.stardict/dic/$(DICSETNAME) |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
24 |
|
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
25 |
F_TAB_ = $(wildcard *.tab_) |
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
26 |
|
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
27 |
F_TAB = $(patsubst %.tab_,%.tab,$(F_TAB_)) |
0 | 28 |
FNAME = $(patsubst %.tab,%,$(F_TAB)) |
29 |
F_DICT = $(patsubst %.tab,%.dict.dz,$(F_TAB)) |
|
30 |
F_IFO = $(patsubst %.tab,%.ifo,$(F_TAB)) |
|
31 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
32 |
.PHONY: all |
0 | 33 |
all: dist |
34 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
35 |
.PHONY: verify |
0 | 36 |
verify: dist |
37 |
@echo |
|
38 |
@for dic in $(F_IFO); do \ |
|
39 |
stardict_verify $$dic; \ |
|
40 |
done |
|
41 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
42 |
.PHONY: dist |
0 | 43 |
dist: $(F_DICT) |
44 |
||
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
45 |
%.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
|
46 |
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
|
47 |
|
9
976f8876799d
Added forgotten dependence.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
3
diff
changeset
|
48 |
%.dict.dz: %.tab %.descr |
0 | 49 |
tabfile $< |
3
cc5593c28a4b
Update .ifo file with author/date/description info.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1
diff
changeset
|
50 |
/bin/sh update-ifo.sh $*.ifo |
0 | 51 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
52 |
.PHONY: install |
0 | 53 |
install: dist |
54 |
mkdir -p $(dicdir) |
|
55 |
for dic in $(FNAME); do \ |
|
56 |
install -m 644 $$dic.dict.dz $(dicdir); \ |
|
57 |
install -m 644 $$dic.idx $(dicdir); \ |
|
58 |
install -m 644 $$dic.ifo $(dicdir); \ |
|
59 |
done |
|
60 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
61 |
.PHONY: uninstall |
0 | 62 |
uninstall: |
63 |
rm -r -f $(dicdir) |
|
64 |
||
26
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
65 |
.PHONY: install-local-symlink |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
66 |
install-local-symlink: # Assume use run "make install" before. |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
67 |
mkdir -p $(HOME)/.stardict/dic |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
68 |
ln -s $(dicdir) $(HOME)/.stardict/dic/$(DICSETNAME) |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
69 |
|
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
70 |
.PHONY: uninstall-local-symlink |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
71 |
uninstall-local-symlink: # Assume use run "make uninstall" before. |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
72 |
rm -f $(HOME)/.stardict/dic/$(DICSETNAME) |
6dfc4ac2dc80
Back targets that allow make symlink to dictionaries install dir from user HOME dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
23
diff
changeset
|
73 |
|
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
74 |
.PHONY: install-local |
28
6bab39ff1663
Correct depends: before install-local make dist.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
26
diff
changeset
|
75 |
install-local: dist |
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
76 |
mkdir -p $(dicdir-local) |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
77 |
for dic in $(FNAME); do \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
78 |
install -m 644 $$dic.dict.dz $(dicdir-local); \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
79 |
install -m 644 $$dic.idx $(dicdir-local); \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
80 |
install -m 644 $$dic.ifo $(dicdir-local); \ |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
81 |
done |
13
d0e948499faf
Added targets [un]install-user to proper install dict for current user.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
9
diff
changeset
|
82 |
|
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
83 |
.PHONY: uninstall-local |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
84 |
uninstall-local: |
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
85 |
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
|
86 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
87 |
.PHONY: clean |
0 | 88 |
clean: |
89 |
for dic in $(FNAME); do \ |
|
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
90 |
rm -f $$dic.dict.dz $$dic.idx $$dic.ifo $$dic.tab; \ |
0 | 91 |
done |
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
92 |
|
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
93 |
.PHONY: distclean |
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
94 |
distclean: clean |