Added targets [un]install-user to proper install dict for current user.
# On Debian Etch 'stardict-tools' package not placed tools in any system bin dir.
export PATH := $(PATH):/usr/lib/stardict-tools
DICSETNAME = gavenkoa-dicts
prefix = /usr/local
datarootdir = $(prefix)/share
datadir = $(datarootdir)/stardict
dicdir = $(datadir)/dic/$(DICSETNAME)
F_TAB_ = $(wildcard *.tab_)
F_TAB = $(patsubst %.tab_,%.tab,$(F_TAB_))
FNAME = $(patsubst %.tab,%,$(F_TAB))
F_DICT = $(patsubst %.tab,%.dict.dz,$(F_TAB))
F_IFO = $(patsubst %.tab,%.ifo,$(F_TAB))
all: dist
verify: dist
@echo
@for dic in $(F_IFO); do \
stardict_verify $$dic; \
done
dist: $(F_DICT)
%.tab: %.tab_
sed 's_\\n _\\n_g' > $@ < $<
%.dict.dz: %.tab %.descr
tabfile $<
/bin/sh update-ifo.sh $*.ifo
install: dist
mkdir -p $(dicdir)
for dic in $(FNAME); do \
install -m 644 $$dic.dict.dz $(dicdir); \
install -m 644 $$dic.idx $(dicdir); \
install -m 644 $$dic.ifo $(dicdir); \
done
uninstall:
rm -r -f $(dicdir)
install-user: install
mkdir -p $(HOME)/.stardict/dic
ln -s $(dicdir) $(HOME)/.stardict/dic/$(DICSETNAME)
uninstall-user: uninstall
rm -f $(HOME)/.stardict/dic/$(DICSETNAME)
clean:
for dic in $(FNAME); do \
rm -f $$dic.dict.dz $$dic.idx $$dic.ifo $$dic.tab; \
done