Makefile
changeset 21 d4b27e5b7a4b
parent 20 9f5eedd08178
child 22 0616adf6e983
equal deleted inserted replaced
20:9f5eedd08178 21:d4b27e5b7a4b
     6 
     6 
     7 prefix = /usr/local
     7 prefix = /usr/local
     8 datarootdir = $(prefix)/share
     8 datarootdir = $(prefix)/share
     9 datadir = $(datarootdir)/stardict
     9 datadir = $(datarootdir)/stardict
    10 dicdir = $(datadir)/dic/$(DICSETNAME)
    10 dicdir = $(datadir)/dic/$(DICSETNAME)
       
    11 
       
    12 # Per user dictionaries hold in user HOME directory.
       
    13 dicdir-local = $(HOME)/.stardict/dic/$(DICSETNAME)
    11 
    14 
    12 F_TAB_ = $(wildcard *.tab_)
    15 F_TAB_ = $(wildcard *.tab_)
    13 
    16 
    14 F_TAB = $(patsubst %.tab_,%.tab,$(F_TAB_))
    17 F_TAB = $(patsubst %.tab_,%.tab,$(F_TAB_))
    15 FNAME = $(patsubst %.tab,%,$(F_TAB))
    18 FNAME = $(patsubst %.tab,%,$(F_TAB))
    42 	done
    45 	done
    43 
    46 
    44 uninstall:
    47 uninstall:
    45 	rm -r -f $(dicdir)
    48 	rm -r -f $(dicdir)
    46 
    49 
    47 install-user: install
    50 .PHONY: install-local
    48 	mkdir -p $(HOME)/.stardict/dic
    51 install-local:
    49 	ln -s $(dicdir) $(HOME)/.stardict/dic/$(DICSETNAME)
    52 	mkdir -p $(dicdir-local)
       
    53 	for dic in $(FNAME); do \
       
    54 		install -m 644 $$dic.dict.dz $(dicdir-local); \
       
    55 		install -m 644 $$dic.idx $(dicdir-local); \
       
    56 		install -m 644 $$dic.ifo $(dicdir-local); \
       
    57 	done
    50 
    58 
    51 uninstall-user: uninstall
    59 .PHONY: uninstall-local
    52 	rm -f $(HOME)/.stardict/dic/$(DICSETNAME)
    60 uninstall-local:
       
    61 	rm -f -r $(HOME)/.stardict/dic/$(DICSETNAME)
    53 
    62 
    54 clean:
    63 clean:
    55 	for dic in $(FNAME); do \
    64 	for dic in $(FNAME); do \
    56 		rm -f $$dic.dict.dz $$dic.idx $$dic.ifo $$dic.tab; \
    65 		rm -f $$dic.dict.dz $$dic.idx $$dic.ifo $$dic.tab; \
    57 	done
    66 	done