equal
deleted
inserted
replaced
6 # install-local install dictionaries in user HOME dir, so they been available in stardict for that user |
6 # install-local install dictionaries in user HOME dir, so they been available in stardict for that user |
7 # uninstall-local remove dictionaries from user HOME directory |
7 # uninstall-local remove dictionaries from user HOME directory |
8 # install-local-symlink create symlink from installed dir to user HOME dir, so dictionaries been available in stardict |
8 # install-local-symlink create symlink from installed dir to user HOME dir, so dictionaries been available in stardict |
9 # uninstall-local-symlink remove symlink from user HOME directory |
9 # uninstall-local-symlink remove symlink from user HOME directory |
10 |
10 |
11 DICTNAME_PREFIX = gadict |
11 ################################################################ |
|
12 # Install paths. |
12 |
13 |
13 ifeq '$(origin prefix)' 'undefined' |
14 ifeq '$(origin prefix)' 'undefined' |
14 ifeq '$(shell id -u)' '0' |
15 ifeq '$(shell id -u)' '0' |
15 prefix = /usr/local |
16 prefix = /usr/local |
16 else |
17 else |
18 endif |
19 endif |
19 endif |
20 endif |
20 datarootdir = $(prefix)/share |
21 datarootdir = $(prefix)/share |
21 datadir = $(datarootdir)/dictd |
22 datadir = $(datarootdir)/dictd |
22 |
23 |
|
24 ################################################################ |
|
25 # Project files. |
|
26 |
23 C5_FILES := $(wildcard *.dict-c5) |
27 C5_FILES := $(wildcard *.dict-c5) |
24 DICT_FILES := $(C5_FILES:.dict-c5=.dict) |
28 DICT_FILES := $(C5_FILES:.dict-c5=.dict) |
25 DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz) |
29 DICTDZ_FILES := $(C5_FILES:.dict-c5=.dict.dz) |
26 INDEX_FILES := $(C5_FILES:.dict-c5=.index) |
30 INDEX_FILES := $(C5_FILES:.dict-c5=.index) |
27 |
31 |
|
32 ################################################################ |
|
33 # Build targets. |
28 |
34 |
29 .PHONY: all |
35 .PHONY: all |
30 all: dist |
36 all: dist |
31 |
37 |
32 .PHONY: dist |
38 .PHONY: dist |
42 $* |
48 $* |
43 |
49 |
44 %.dict.dz: %.dict |
50 %.dict.dz: %.dict |
45 dictzip -c $< >$@ |
51 dictzip -c $< >$@ |
46 |
52 |
|
53 ################################################################ |
|
54 # Install/uninstall targets. |
|
55 |
47 .PHONY: install |
56 .PHONY: install |
48 install: dist |
57 install: dist |
49 mkdir -p $(datadir) |
58 mkdir -p $(datadir) |
50 for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
59 for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
51 install -m 644 $$f $(datadir); \ |
60 install -m 644 $$f $(datadir); \ |
55 uninstall: |
64 uninstall: |
56 for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
65 for f in $(DICTDZ_FILES) $(INDEX_FILES); do \ |
57 rm -f $(datadir)/$$f; \ |
66 rm -f $(datadir)/$$f; \ |
58 done |
67 done |
59 |
68 |
|
69 ################################################################ |
|
70 # Clean targets. |
|
71 |
60 .PHONY: distclean |
72 .PHONY: distclean |
61 distclean: clean |
73 distclean: clean |
62 |
74 |
63 .PHONY: clean |
75 .PHONY: clean |
64 clean: |
76 clean: |