summaryrefslogtreecommitdiff
path: root/Jamfile
blob: 3dbd289f44faaec318339f82bbb2ce75d883af20 (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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#
# Build flags
#

include Jamconfig ;
include $(HOME)/.jamconfig ;

HDRS = include filter ;

#
# Libraries
#

if -DNEED_GETOPT  in $(CCFLAGS) { Library libfitz : util/getopt.c ; }
if -DNEED_STRSEP  in $(CCFLAGS) { Library libfitz : util/strsep.c ; }
if -DNEED_STRLCPY in $(CCFLAGS) { Library libfitz : util/strlcpy.c ; }
if -DNEED_STRLCAT in $(CCFLAGS) { Library libfitz : util/strlcat.c ; }

if $(HAVE_JASPER)
{
	CCFLAGS += -DHAVE_JASPER ;
	LINKLIBS += -ljasper ;
	Library libfitz : filter/jpxd.c ;
}

if $(HAVE_JBIG2DEC)
{
	CCFLAGS += -DHAVE_JBIG2DEC ;
	LINKLIBS += -ljbig2dec ;
	Library libfitz : filter/jbig2d.c ;
}

Library libfitz :
	base/cpudep.c
	base/error.c
	base/memory.c
	base/md5.c
	base/arc4.c
	base/rect.c
	base/matrix.c
	base/hash.c
	base/rune.c
	;

Library libfitz :
	object/simple.c
	object/array.c
	object/dict.c
	object/print.c
	object/parse.c
	;

Library libfitz :
	filter/buffer.c
	filter/filter.c
	filter/filec.c		# unistd.h
	filter/filer.c		# unistd.h
	filter/filew.c		# unistd.h
	filter/null.c
	filter/arc4filter.c
	filter/pipeline.c
	filter/ahxd.c
	filter/ahxe.c
	filter/a85d.c
	filter/a85e.c
	filter/rld.c
	filter/rle.c
	filter/predict.c
	filter/lzwd.c
	filter/lzwe.c
	filter/faxd.c
	filter/faxdtab.c
	filter/faxe.c
	filter/faxetab.c
	filter/flate.c		# libz
	filter/dctd.c		# libjpeg
	filter/dcte.c		# libjpeg
	;

Library libfitz :
	tree/cmap.c
	tree/font.c
	tree/colorspace.c
	tree/image.c
	tree/shade.c
	tree/tree.c
	tree/node1.c
	tree/node2.c
	tree/text.c
	tree/path.c
	tree/debug.c
	tree/optimize.c
	;

Library libfitz :
	render/glyphcache.c
	render/pixmap.c
	render/porterduff.c
	render/meshdraw.c
	render/imagedraw.c
	render/imageunpack.c
	render/imagescale.c
	render/pathscan.c
	render/pathfill.c
	render/pathstroke.c
	render/render.c
	;

if $(OSPLAT) = PPC     { Library libfitz : render/archppc.c ; }
if $(OSPLAT) = SPARC   { Library libfitz : render/archsparc.c ; }
if $(OSPLAT) = X86     { Library libfitz : render/archx86.c ; }

Library libmupdf :
	mupdf/debug.c
	mupdf/lex.c
	mupdf/parse.c
	mupdf/crypt.c

	mupdf/open.c
	mupdf/repair.c
	mupdf/save.c
	mupdf/xref.c
	mupdf/stream.c
	mupdf/doctor.c

	mupdf/nametree.c
	mupdf/outline.c
	mupdf/annot.c
	mupdf/pagetree.c

	mupdf/store.c
	mupdf/resources.c
	mupdf/function.c
	mupdf/colorspace1.c
	mupdf/colorspace2.c
	mupdf/xobject.c
	mupdf/image.c
	mupdf/pattern.c
	mupdf/cmap.c
	mupdf/unicode.c
	mupdf/fontagl.c
	mupdf/fontenc.c
	mupdf/fontfile.c
	mupdf/font.c
	mupdf/type3.c

	mupdf/page.c
	mupdf/build.c
	mupdf/interpret.c

	mupdf/shade.c
	mupdf/shade1.c
	mupdf/shade2.c
	mupdf/shade3.c
	mupdf/shade4.c
	;

# Library libmupdf : mupdf/fontfilefc.c ;
# Library libmupdf : mupdf/fontfilems.c ;

rule HexDump
{
	DEPENDS $(<) : $(>) ;
	Clean clean : $(<) ;
}

actions HexDump
{
	xxd -i $(>) | sed -e 's/data_//g;s/, /,/g' > $(<)
}

HexDump data/Dingbats.c : data/Dingbats.cff ;
HexDump data/NimbusMonL-Bold.c : data/NimbusMonL-Bold.cff ;
HexDump data/NimbusMonL-BoldObli.c : data/NimbusMonL-BoldObli.cff ;
HexDump data/NimbusMonL-Regu.c : data/NimbusMonL-Regu.cff ;
HexDump data/NimbusMonL-ReguObli.c : data/NimbusMonL-ReguObli.cff ;
HexDump data/NimbusRomNo9L-Medi.c : data/NimbusRomNo9L-Medi.cff ;
HexDump data/NimbusRomNo9L-MediItal.c : data/NimbusRomNo9L-MediItal.cff ;
HexDump data/NimbusRomNo9L-Regu.c : data/NimbusRomNo9L-Regu.cff ;
HexDump data/NimbusRomNo9L-ReguItal.c : data/NimbusRomNo9L-ReguItal.cff ;
HexDump data/NimbusSanL-Bold.c : data/NimbusSanL-Bold.cff ;
HexDump data/NimbusSanL-BoldItal.c : data/NimbusSanL-BoldItal.cff ;
HexDump data/NimbusSanL-Regu.c : data/NimbusSanL-Regu.cff ;
HexDump data/NimbusSanL-ReguItal.c : data/NimbusSanL-ReguItal.cff ;
HexDump data/StandardSymL.c : data/StandardSymL.cff ;
HexDump data/URWChanceryL-MediItal.c : data/URWChanceryL-MediItal.cff ;

Library libmupdf :
	data/Dingbats.c
	data/NimbusMonL-Bold.c
	data/NimbusMonL-BoldObli.c
	data/NimbusMonL-Regu.c
	data/NimbusMonL-ReguObli.c
	data/NimbusRomNo9L-Medi.c
	data/NimbusRomNo9L-MediItal.c
	data/NimbusRomNo9L-Regu.c
	data/NimbusRomNo9L-ReguItal.c
	data/NimbusSanL-Bold.c
	data/NimbusSanL-BoldItal.c
	data/NimbusSanL-Regu.c
	data/NimbusSanL-ReguItal.c
	data/StandardSymL.c
	data/URWChanceryL-MediItal.c
	;

#
# Applications
#

LINKLIBS = -lfreetype -ljpeg -lz -lm ;

if $(OS) = MINGW
{
	rule UserObject
	{
		Res $(<) : $(>) ;
	}

	rule Res
	{
		Depends $(<) : $(>) ;
	}

	actions Res
	{
		windres -i $(>) -o $(<)
	}

	Main w32pdf : apps/w32pdf.c apps/w32res.rc ;
	LinkLibraries w32pdf : libmupdf libfitz ;
	LINKLIBS on w32pdf$(SUFEXE) = $(LINKLIBS) -lgdi32 -lcomdlg32 -mwindows ;
}

if $(OS) = MACOSX
{
	MACPDF = apps/macpdf.app/Contents/MacOS/macpdf ;
	Main $(MACPDF) : apps/macpdf.c ;
	LinkLibraries $(MACPDF) : libmupdf libfitz ;
	LINKLIBS on $(MACPDF) = $(LINKLIBS) -framework Carbon ;
}

if $(HAVE_X11)
{
	Main x11pdf : apps/x11pdf.c apps/ximage.c ;
	LinkLibraries x11pdf : libmupdf libfitz ;
	LINKLIBS on x11pdf$(SUFEXE) = $(LINKLIBS) -lX11 -lXext ;
}

if $(HAVE_GTK)
{
	Main gtkpdf : apps/gtkpdf.c ;
	CCFLAGS on apps/gtkpdf$(SUFOBJ) =
		$(CCFLAGS) `pkg-config --cflags gtk+ gthread` ;
	LinkLibraries gtkpdf : libmupdf libfitz ;
	LINKLIBS on gtkpdf$(SUFEXE) =
		$(LINKLIBS) `pkg-config --libs gtk+ gmodule gthread` ;
}

Main pdfclean : apps/pdfclean.c ;
Main pdfdebug : apps/pdfdebug.c ;
Main pdfrip : apps/pdfrip.c ;
Main pdfmerge : apps/pdfmerge.c ;
Main pdfselect : apps/pdfselect.c ;
LinkLibraries pdfclean pdfdebug pdfrip pdfmerge pdfselect : libmupdf libfitz ;