File: Makefile.am

package info (click to toggle)
medicalterms 20160103-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 528 kB
  • ctags: 33
  • sloc: sh: 472; perl: 197; makefile: 91
file content (129 lines) | stat: -rw-r--r-- 4,517 bytes parent folder | download | duplicates (3)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# The Makefile for medicalterms
## Process this file with automake to produce Makefile.in
#
# Copyright © 2005-2016 Dr. Tobias Quathamer <t.quathamer@mailbox.org>
#
# This file is part of Medicalterms.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

SUBDIRS = bin dicts

CLEANFILES = german-medical \
	de_med.dic


PLAIN_LISTS = $(shell find dicts/ -name "*txt" ! -name "*-xx-*" ! -name "*-a-*")
COMPOUND_LISTS = $(shell find dicts/ -name "*txt" -name "*-xx-*")

all-local: german-medical de_med.dic

install-data-local: install-german-medical install-de_med.dic

uninstall-local: uninstall-german-medical uninstall-de_med.dic


#####################################################################
# plain wordlist for installing in /usr/share/dict/
#####################################################################

# Generates a complete wordlist without TeX ligatures in ISO-8859-1 encoding
german-medical: $(PLAIN_LISTS) $(COMPOUND_LISTS)
	$(srcdir)/bin/get_words $(PLAIN_LISTS) $(COMPOUND_LISTS) | \
	$(PERL) -pe 's/qq//g' | \
	$(SORT) -u | \
	$(ASPELL) expand --encoding=UTF-8 --lang=de | \
	$(PERL) -pe 's/ /\n/g' | \
	$(ASPELL) conv UTF-8 ISO-8859-1 | \
	LANG=de_DE LC_ALL=de_DE $(SORT) -u > $@

.PHONY: install-german-medical
install-german-medical: german-medical
	$(INSTALL) --directory $(DESTDIR)$(datadir)/dict/
	$(INSTALL_DATA) german-medical $(DESTDIR)$(datadir)/dict/

.PHONY: uninstall-german-medical
uninstall-german-medical:
	rm -f $(DESTDIR)$(datadir)/dict/german-medical


#####################################################################
# hunspell
#####################################################################

de_med.dic: $(PLAIN_LISTS) $(COMPOUND_LISTS)
# Get all plain list words
	$(srcdir)/bin/get_words $(PLAIN_LISTS) | \
	$(PERL) -pe 's/qq//g' | \
	$(SORT) -u > $@.plain.tmp
# Get all compoundable list words
	$(srcdir)/bin/get_words $(COMPOUND_LISTS) | \
	$(PERL) -pe 's/qq//g' | \
	$(PERL) -pe "if (/\//) {s,$$,m,} else {s,$$,/m,}" | \
	$(SORT) -u > $@.compound.tmp
# Add lowercase compoundable words
	$(srcdir)/bin/get_words $(COMPOUND_LISTS) | \
	$(PERL) -pe 's/qq//g' | \
	$(PERL) -ne 'tr/ÄÖÜ/äöü/; print lcfirst;' | \
	$(PERL) -pe "if (/\//) {s,$$,ozm,} else {s,$$,/ozm,}" | \
	$(SORT) -u > $@.compound.lower.tmp
# Create list for all words
	cat $@.plain.tmp $@.compound.tmp $@.compound.lower.tmp | \
	$(ASPELL) conv UTF-8 ISO-8859-1 | \
	LANG=de_DE LC_ALL=de_DE $(SORT) -u > $@.tmp
	wc -l < $@.tmp > $@
	cat $@.tmp >> $@
	rm -f $@.tmp $@.plain.tmp $@.compound.tmp $@.compound.lower.tmp

.PHONY: install-de_med.dic
install-de_med.dic: de_med.dic
	$(INSTALL) --directory $(DESTDIR)$(datadir)/hunspell
	$(INSTALL_DATA) de_med.dic $(DESTDIR)$(datadir)/hunspell

.PHONY: uninstall-de_med.dic
uninstall-de_med.dic:
	rm -f $(DESTDIR)$(datadir)/hunspell/de_med.dic


#####################################################################
# Create a tarball for igerman98 contrib directory
#####################################################################

.PHONY: igerman-contrib
igerman-contrib:
	mkdir $@
	mkdir $@/dicts
	cp $(srcdir)/dicts/*txt $@/dicts
	for wordlist in $@/dicts/*txt; do \
		$(srcdir)/bin/get_words $$wordlist > tmp; \
		$(srcdir)/bin/convert_to_igerman98 tmp > $$wordlist; \
		$(ASPELL) conv UTF-8 ISO-8859-1 < $$wordlist > tmp; \
		mv tmp $$wordlist; \
	done
	$(ASPELL) conv UTF-8 ISO-8859-1 < README.medicalterms \
		> $@/README.medicalterms
	cd $@ && tar czf $(PACKAGE_TARNAME)-igerman98-$(PACKAGE_VERSION).tar.gz *
	mv $@/$(PACKAGE_TARNAME)-igerman98-$(PACKAGE_VERSION).tar.gz .
	rm -rf $@


#####################################################################
# This is for creating a release tarball which is signed
#####################################################################

.PHONY: release
release: distcheck
	rm -f $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz.sig
	gpg --detach-sign $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz