author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sun, 04 Sep 2011 23:47:46 +0300 | |
changeset 55 | df348fb76746 |
parent 54 | 12426df26196 |
child 56 | ee149b4fd006 |
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 |
|
55
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
11 |
SHELL = /bin/sh |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
12 |
export PATH := /bin:/usr/bin:${PATH} |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
13 |
|
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
14 |
# Disable built in pattern rules. |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
15 |
MAKEFLAGS += -r |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
16 |
# Disable built in variables. |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
17 |
MAKEFLAGS += -R |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
18 |
# Disable built in suffix rules. |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
19 |
.SUFFIXES: |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
20 |
# Default target. |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
21 |
.DEFAULT_GOAL = all |
df348fb76746
Add default Makefile settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
54
diff
changeset
|
22 |
|
54 | 23 |
################################################################ |
24 |
# Install paths. |
|
0 | 25 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
26 |
ifeq '$(origin prefix)' 'undefined' |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
27 |
ifeq '$(shell id -u)' '0' |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
28 |
prefix = /usr/local |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
29 |
else |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
30 |
prefix = $(HOME)/usr |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
31 |
endif |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
32 |
endif |
0 | 33 |
datarootdir = $(prefix)/share |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
34 |
datadir = $(datarootdir)/dictd |
21
d4b27e5b7a4b
Added per user install target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
20
diff
changeset
|
35 |
|
54 | 36 |
################################################################ |
37 |
# Project files. |
|
38 |
||
50
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
39 |
C5_FILES := $(wildcard *.dict-c5) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
40 |
DICT_FILES := $(C5_FILES:.dict-c5=.dict) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
41 |
DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz) |
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
42 |
INDEX_FILES := $(C5_FILES:.dict-c5=.index) |
1
b23e948de24a
Make article for all verbs form.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
43 |
|
54 | 44 |
################################################################ |
45 |
# Build targets. |
|
0 | 46 |
|
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
47 |
.PHONY: all |
0 | 48 |
all: dist |
49 |
||
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
50 |
.PHONY: dist |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
51 |
dist: $(DICTDZ_FILES) $(INDEX_FILES) |
0 | 52 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
53 |
# --case-sensitive |
50
37931fbb857f
Switch from ambiguous extension to unambiguous.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
46
diff
changeset
|
54 |
%.dict %.index: %.dict-c5 |
46
86c0184efac7
Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
41
diff
changeset
|
55 |
sed '/^#/d' $< | dictfmt -c5 \ |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
56 |
--headword-separator '; ' --break-headwords \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
57 |
--utf8 --allchars \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
58 |
-u "`sed -n '\|http://[[:print:]]\+/|{s=^.*\(http://\)=\1=;p;q;}' $<`" \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
59 |
-s "`sed -n '/^ABOUT: /{s=ABOUT: ==;p;q;}' $<`" \ |
46
86c0184efac7
Comment syntax convention.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
41
diff
changeset
|
60 |
$* |
0 | 61 |
|
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
62 |
%.dict.dz: %.dict |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
63 |
dictzip -c $< >$@ |
0 | 64 |
|
54 | 65 |
################################################################ |
66 |
# Install/uninstall targets. |
|
67 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
68 |
.PHONY: install |
0 | 69 |
install: dist |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
70 |
mkdir -p $(datadir) |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
71 |
for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
72 |
install -m 644 $$f $(datadir); \ |
0 | 73 |
done |
74 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
75 |
.PHONY: uninstall |
0 | 76 |
uninstall: |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
77 |
for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
78 |
rm -f $(datadir)/$$f; \ |
0 | 79 |
done |
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
80 |
|
54 | 81 |
################################################################ |
82 |
# Clean targets. |
|
83 |
||
23
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
84 |
.PHONY: distclean |
946ae4b96419
Phony targets marked.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
22
diff
changeset
|
85 |
distclean: clean |
41
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
86 |
|
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
87 |
.PHONY: clean |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
88 |
clean: |
8f1dc5d77f3d
Switch dictionary to dictd -c5 format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
28
diff
changeset
|
89 |
rm -f $(DICTDZ_FILES) $(INDEX_FILES); |