summaryrefslogtreecommitdiff
path: root/fonts/thai/fonts-tlwg/Makefile.am
blob: d4a33d56bc47f5cd007ea96b9082c35d5846d943 (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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
MAINTAINERCLEANFILES = Makefile.in configure aclocal.m4

EXTRA_DIST =	\
	ChangeLog.thai-ttf		\
	GPL				\
	build-aux/git-version-gen	\
	$(NULL)

SUBDIRS = scripts latex nf nectec sipa tlwg fontconfig tests

if INCLUDE_XFONTSDIR
install-data-hook:
	@if test -n "$(DESTDIR)" ; then                                \
	  echo "***" ;                                                 \
	  echo "*** Warning: Seems to be binary package building." ;   \
	  echo "***          So, font list/cache is not generated" ;   \
	  echo "***" ;                                                 \
	  exit 0;                                                      \
	fi
if INCLUDE_TTF
	mkdir -p $(DESTDIR)$(ttfdir)
	cd $(DESTDIR)$(ttfdir);                                        \
	  $(TTMKFDIR);                                                 \
	  $(MKFONTDIR)
	$(FCCACHE) -f $(DESTDIR)$(ttfdir)
endif
if INCLUDE_PFB
	mkdir -p $(DESTDIR)$(type1dir)
	cd $(DESTDIR)$(type1dir);                                      \
	  $(TYPE1INST);                                                \
	  $(MKFONTDIR)
	$(FCCACHE) -f $(DESTDIR)$(type1dir)
endif

uninstall-hook:
if INCLUDE_TTF
	$(RM) $(DESTDIR)$(ttfdir)/fonts.cache-1
	$(RM) $(DESTDIR)$(ttfdir)/fonts.dir
	$(RM) $(DESTDIR)$(ttfdir)/fonts.scale
	$(RM) $(DESTDIR)$(ttfdir)/encodings.dir
	cd $(DESTDIR)$(ttfdir); \
	$(TTMKFDIR); \
	if test `head -1 fonts.scale` -gt 0; then \
		$(MKFONTDIR); \
		$(FCCACHE) -f $(DESTDIR)$(ttfdir); \
	else \
		$(RM) $(DESTDIR)$(ttfdir)/fonts.scale; \
		$(RMDIR) $(DESTDIR)$(ttfdir); \
	fi
endif
if INCLUDE_PFB
	$(RM) $(DESTDIR)$(type1dir)/fonts.cache-1
	$(RM) $(DESTDIR)$(type1dir)/fonts.dir
	$(RM) $(DESTDIR)$(type1dir)/fonts.scale
	$(RM) $(DESTDIR)$(type1dir)/encodings.dir
	cd $(DESTDIR)$(type1dir); \
	$(TYPE1INST); \
	if test `head -1 fonts.scale` -gt 0; then \
		$(MKFONTDIR); \
		$(FCCACHE) -f $(DESTDIR)$(type1dir); \
	else \
		$(RM) $(DESTDIR)$(type1dir)/fonts.scale; \
		$(RMDIR) $(DESTDIR)$(type1dir); \
	fi
endif
endif # INCLUDE_XFONTSDIR

dist-hook:
	echo $(VERSION) > $(distdir)/VERSION

if INCLUDE_LATEX
tdsdist_tgz = $(LATEX_PACKAGE)-$(VERSION).tds.tar.gz
tdsdist_nv_tgz = $(LATEX_PACKAGE).tds.tar.gz
ctandist_tgz = $(LATEX_PACKAGE)-$(VERSION).ctan.tar.gz

tdsdist_zip = $(LATEX_PACKAGE)-$(VERSION).tds.zip
tdsdist_nv_zip = $(LATEX_PACKAGE).tds.zip
ctandist_zip = $(LATEX_PACKAGE)-$(VERSION).ctan.zip

tdsdistdir = $(LATEX_PACKAGE)-$(VERSION)-tds

inst-tds:
	rm -rf $(tdsdistdir)
	mkdir $(tdsdistdir)
	confdir=`cd $(top_srcdir) && pwd` \
	  && cd $(tdsdistdir) \
	  && $$confdir/configure --disable-ttf --enable-latex --prefix=/usr \
	       --with-texmfdir=/ --docdir=/doc/fonts/$(LATEX_PACKAGE) \
	  && $(MAKE) $(AM_MAKEFLAGS) \
	  && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=`pwd`/inst install \
	  && rm -rf inst/usr \
	  && mkdir -p inst/source/fonts/$(LATEX_PACKAGE) \
	  && make distdir distdir=inst/source/fonts/$(LATEX_PACKAGE)

dist-tds-tgz: inst-tds
	rm -f $(tdsdist_tgz)
	cd $(tdsdistdir)/inst \
	  && tar cf - * | gzip -9 -c > ../../$(tdsdist_tgz)
	rm -rf $(tdsdistdir)

dist-tds-zip: inst-tds
	rm -f $(tdsdist_zip)
	cd $(tdsdistdir)/inst \
	  && zip -r ../../$(tdsdist_zip) *
	rm -rf $(tdsdistdir)

dist-tds: dist-tds-zip

dist-ctan-tgz: dist-tds-tgz distdir
	rm -f $(ctandist_tgz) $(tdsdist_nv_tgz)
	cp $(tdsdist_tgz) $(tdsdist_nv_tgz)
	tar cf - $(tdsdist_nv_tgz) $(distdir) | gzip -9 -c > $(ctandist_tgz)
	rm $(tdsdist_nv_tgz)
	$(am__remove_distdir)

dist-ctan-zip: dist-tds-zip distdir
	rm -f $(ctandist_zip) $(tdsdist_nv_zip)
	cp $(tdsdist_zip) $(tdsdist_nv_zip)
	zip -r $(ctandist_zip) $(tdsdist_nv_zip) $(distdir)
	rm $(tdsdist_nv_zip)
	$(am__remove_distdir)

dist-ctan: dist-ctan-zip

endif # INCLUDE_LATEX

.PHONY: dist-tds dist-tds-tgz dist-tds-zip inst-tds
.PHONY: dist-ctan dist-ctan-tgz dist-ctan-zip

#
# Font Binary Tarballs
#

otf_package = otf-tlwg
ttf_package = ttf-tlwg
woff_package = woff-tlwg

otfdist_txz = $(otf_package)-$(VERSION).tar.xz
ttfdist_txz = $(ttf_package)-$(VERSION).tar.xz
woffdist_txz = $(woff_package)-$(VERSION).tar.xz

otfdist_zip = $(otf_package)-$(VERSION).zip
ttfdist_zip = $(ttf_package)-$(VERSION).zip
woffdist_zip = $(woff_package)-$(VERSION).zip

otfdistdir = $(otf_package)-$(VERSION)
ttfdistdir = $(ttf_package)-$(VERSION)
woffdistdir = $(woff_package)-$(VERSION)

fcdistdir = fontconfig-$(VERSION)

workingdir = work

inst-fonts.stamp:
	rm -rf $(otfdistdir) $(ttfdistdir) $(woffdistdir)
	rm -rf $(fcdistdir)
	rm -rf $(workingdir)
	mkdir $(workingdir)
	confdir=`cd $(top_srcdir) && pwd` \
	  abs_otfdistdir=`pwd`/$(otfdistdir) \
	  abs_ttfdistdir=`pwd`/$(ttfdistdir) \
	  abs_woffdistdir=`pwd`/$(woffdistdir) \
	  abs_fcdistdir=`pwd`/$(fcdistdir) \
	  && cd $(workingdir) \
	  && $$confdir/configure \
	       --enable-otf --with-otfdir=$$abs_otfdistdir \
	       --enable-ttf --with-ttfdir=$$abs_ttfdistdir \
	       --enable-woff --with-woffdir=$$abs_woffdistdir \
	       --datadir=$$abs_fcdistdir \
	  && $(MAKE) $(AM_MAKEFLAGS) \
	  && $(MAKE) $(AM_MAKEFLAGS) install
	cp -a $(fcdistdir)/* $(otfdistdir)
	cp -a $(fcdistdir)/* $(ttfdistdir)
	rm -rf $(fcdistdir)
	rm -rf $(workingdir)
	touch $@

dist-otf-txz: inst-fonts.stamp
	rm -f $(otfdist_txz)
	tar cJf $(otfdist_txz) $(otfdistdir)
	md5sum $(otfdist_txz) > $(otfdist_txz).md5sum

dist-otf-zip: inst-fonts.stamp
	rm -f $(otfdist_zip)
	zip -r $(otfdist_zip) $(otfdistdir)
	md5sum $(otfdist_zip) > $(otfdist_zip).md5sum

dist-ttf-txz: inst-fonts.stamp
	rm -f $(ttfdist_txz)
	tar cJf $(ttfdist_txz) $(ttfdistdir)
	md5sum $(ttfdist_txz) > $(ttfdist_txz).md5sum

dist-ttf-zip: inst-fonts.stamp
	rm -f $(ttfdist_zip)
	zip -r $(ttfdist_zip) $(ttfdistdir)
	md5sum $(ttfdist_zip) > $(ttfdist_zip).md5sum

dist-woff-txz: inst-fonts.stamp
	rm -f $(woffdist_txz)
	tar cJf $(woffdist_txz) $(woffdistdir)
	md5sum $(woffdist_txz) > $(woffdist_txz).md5sum

dist-woff-zip: inst-fonts.stamp
	rm -f $(woffdist_zip)
	zip -r $(woffdist_zip) $(woffdistdir)
	md5sum $(woffdist_zip) > $(woffdist_zip).md5sum

dist-fonts-clean:
	rm -rf $(otfdistdir) $(ttfdistdir) $(woffdistdir)
	rm -f inst-fonts.stamp

dist-fonts-txz: dist-otf-txz dist-ttf-txz dist-woff-txz

dist-fonts-zip: dist-otf-zip dist-ttf-zip dist-woff-zip

dist-fonts: dist-fonts-txz dist-fonts-zip dist-fonts-clean

.PHONY: dist-fonts-txz dist-otf-txz dist-ttf-txz dist-woff-txz
.PHONY: dist-fonts-zip dist-otf-zip dist-ttf-zip dist-woff-zip
.PHONY: dist-fonts dist-fonts-clean