-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
59 lines (41 loc) · 1.43 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
PYTHON := python3
ZIP := zip -r
KO_AFF := ko.aff
KO_DIC := ko.dic
CLEANFILES := $(KO_AFF) $(KO_DIC)
SOURCES := make-aff-dic.py config.py suffix.py suffixdata.py jamo.py \
flags.py aff.py josa.py template.aff
DICT_DATA = dict-ko-builtins.yaml dict-ko-data.yaml
DISTDIR := dist
HOST_DICT_PATH := /usr/share/hunspell/ko
PACKAGE := hunspell-dict-ko
VERSION := $(shell $(PYTHON) -c 'import config;print(config.version)')
RELEASETAG := HEAD
SRC_DISTNAME := hunspell-dict-ko-$(VERSION)
SRC_DISTFILE := $(DISTDIR)/$(SRC_DISTNAME).tar.xz
BIN_DISTNAME := ko-aff-dic-$(VERSION)
BIN_DISTFILE := $(DISTDIR)/$(BIN_DISTNAME).zip
BIN_DISTCONTENT = LICENSE.md LICENSE.GPL-3 $(KO_AFF) $(KO_DIC)
all: build
build: $(KO_AFF) $(KO_DIC)
$(KO_AFF) $(KO_DIC): $(DICT_DATA) $(SOURCES)
$(PYTHON) make-aff-dic.py $(KO_AFF) $(KO_DIC) $(DICT_DATA)
distdir::
if ! [ -d $(DISTDIR) ]; then mkdir $(DISTDIR); fi
clean:
rm -f $(CLEANFILES)
rm -rf $(DISTDIR)
dist:: bdist sdist
bdist:: distdir $(BIN_DISTCONTENT)
rm -f $(BIN_DISTFILE)
mkdir -p $(BIN_DISTNAME)
install -m644 $(BIN_DISTCONTENT) $(BIN_DISTNAME)/
$(ZIP) $(BIN_DISTFILE) $(BIN_DISTNAME)
rm -rf $(BIN_DISTNAME)
sdist:: distdir $(BIN_DISTCONTENT)
git -c 'tar.tar.xz.command=xz -c' archive --format=tar.xz --prefix=$(SRC_DISTNAME)/ -o $(SRC_DISTFILE) $(RELEASETAG)
test: build
$(MAKE) -C tests test
hosttest:
$(MAKE) -C tests test DICT=$(HOST_DICT_PATH)
.PHONY: all build clean dist distdir test autopkgtest