summaryrefslogtreecommitdiff
path: root/Makefile
blob: ca485e4c417bf83fe416c43eac07cc8e6905dbe4 (plain)
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
# requires dictfmt and dictzip tools (from the package dictfmt)

PREFIX = /usr

SRC = 1.htm 2.htm 3.htm 4.htm 5.htm \
      6.htm 7.htm 8.htm 9.htm 10.htm
JARGONS = $(SRC:.htm=.jargon)

$(JARGONS): htmtojargon.awk symbols.sed xmlcleanup.sed xmlcleanup2.sed

all: oed.dict.dz

.htm.jargon:
	awk -f htmtojargon.awk < "$<" \
	| sed -f symbols.sed \
	| sed -f xmlcleanup.sed \
	| sed -f xmlcleanup2.sed \
	> "$@"

symbols.sed: symbols symbolstosed.awk
	awk -f symbolstosed.awk < symbols > $@

oed.dict: $(JARGONS)
	cat $(JARGONS) \
	| dictfmt -j --utf8 \
	  --columns 0 --headword-separator ' ' \
	  -u http://njw.me.uk/oed \
	  -s "Oxford English Dictionary Second Edition v3" \
	  oed

oed.dict.dz: oed.dict
	dictzip -k $<

install: all
	cp oed.dict.dz oed.index $(DESTDIR)$(PREFIX)/share/dictd/
	test -x /usr/sbin/dictdconfig && dictdconfig -w
	test -x /etc/init.d/dictd && /etc/init.d/dictd restart

.SUFFIXES: .htm .jargon .sed .dict .dz
.PHONY: all install