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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
|
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
.PHONY : all bootstrap build check clean clean-build clean-host dev-install distclean distro-pack-install docs fetch findunusedcode id install install-strip install-tb subsequentcheck tags
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS:=all
endif
all: build
SHELL=/usr/bin/env bash
SRCDIR:=$(patsubst %/,%,$(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
ifeq ($(gb_Side),)
gb_Side:=host
endif
include $(SRCDIR)/config_$(gb_Side).mk
ifeq ($(GMAKE_OPTIONS),)
ifeq ($(verbose)$(VERBOSE),)
export GMAKE_OPTIONS:=-rs
else
export GMAKE_OPTIONS:=-r
endif
endif
# This list tells which modules are gbuild ones. It does *not* tell which modules to build. That is directed
# by the module being mentioned in packimages/prj/build.lst, etc, recursively.
gbuild_modules:= \
MathMLDTD\
Mesa\
UnoControls\
accessibility\
afms\
android\
animations\
apache-commons\
apple_remote\
autodoc\
avmedia\
basctl\
basebmp\
basegfx\
basic\
bean\
beanshell\
binaryurp\
bluez_bluetooth\
boost\
bridges\
canvas\
chart2\
cli_ure\
clucene\
codemaker\
comphelper\
configmgr\
connectivity\
cosv\
cppcanvas\
cppu\
cppuhelper\
cpputools\
cui\
dbaccess\
desktop\
dictionaries \
drawinglayer\
dtrans\
editeng\
embeddedobj\
embedserv\
eventattacher\
extensions\
extras\
fileaccess\
filter\
forms\
formula\
fpicker\
framework\
helpcompiler\
hsqldb\
hwpfilter\
i18npool\
i18nutil\
idl\
idlc\
io\
javaunohelper\
jfreereport\
jpeg\
jurt\
jvmaccess\
jvmfwk\
l10ntools\
languagetool\
libcdr\
libcmis\
libmspub\
liborcus\
libpng\
librsvg\
libvisio\
libwpd\
libwpg\
libwps\
lingucomponent\
linguistic\
lotuswordpro\
mdds\
more_fonts\
neon\
nlpsolver\
np_sdk\
o3tl\
offapi\
officecfg\
oovbaapi\
oox\
package\
packimages\
padmin\
psprint_config\
pyuno\
qadevOOo\
rdbmaker\
readlicense_oo\
regexp\
registry\
remotebridges\
reportbuilder\
reportdesign\
rhino\
ridljar\
rsc\
sal\
salhelper\
sane\
sax\
saxon\
sc\
scaddins\
sccomp\
scp2\
scripting\
sd\
sdext\
sfx2\
shell\
slideshow\
smoketest\
solenv\
soltools\
sot\
starmath\
stoc\
store\
svl\
svtools\
svx\
sw\
swext\
tail_build\
test\
testtools\
tomcat\
toolkit\
tools\
touch\
translations\
tubes\
twain\
ucb\
ucbhelper\
ucpp\
udkapi\
udm\
unixODBC\
unodevtools\
unoil\
unotest\
unotools\
unoxml\
ure\
uui\
vbahelper\
vcl\
vigra\
wizards\
writerfilter\
writerperfect\
x11_extensions\
xmerge\
xmlhelp\
xmloff\
xmlreader\
xmlscript\
xmlsecurity\
xsltml\
dmake_modules:=\
berkeleydb\
binfilter \
cairo\
cppunit\
crashrep\
ct2n\
curl\
epm\
expat\
external\
fontconfig\
freetype\
gdk-pixbuf\
gettext\
glib\
graphite\
helpcontent2 \
hunspell\
hyphen\
icu\
instsetoo_native\
libcroco\
libexttextcat\
libgsf\
liblangtag\
libxml2\
libxmlsec\
libxslt\
lcms2\
lpsolve\
migrationanalysis\
moz\
mysqlc\
mysqlcppconn\
mythes\
nss\
odk\
openldap\
openssl\
pango\
postgresql\
postprocess\
python\
redland\
setup_native\
stax\
stlport\
sysui\
xpdf\
zlib\
export gb_TAILBUILDTARGET=all slowcheck
define gbuild_module_rules
.PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).subsequentcheck $(1).deliver
$(1): bootstrap fetch
cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) gb_PARTIALBUILD=T
$(1).all: bootstrap fetch
$$(if $$(filter $(1),$$(shell $(GNUMAKE) -r -f $(SRCDIR)/tail_build/Makefile showmodules)), \
cd tail_build && unset MAKEFLAGS && \
export gb_TAILBUILDTARGET="$(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)" && \
, \
cd $(1) && unset MAKEFLAGS && \
) \
$(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
$(1).build:
cd $(1) && $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) build gb_PARTIALBUILD=T
$(1).check:
cd $(1) && $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) check gb_PARTIALBUILD=T
$(1).clean:
cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) clean gb_PARTIALBUILD=T
$(1).subsequentcheck:
cd $(1) && $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck gb_PARTIALBUILD=T
$(1).deliver:
@true
endef
define gbuild_modules_rules
$(foreach m,$(1),$(call gbuild_module_rules,$(m)))
endef
define dmake_module_rules
.PHONY: $(1) $(1).all $(1).deliver $(1).clean
$(1): bootstrap fetch
cd $(1) && unset MAKEFLAGS && \
$(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) -- -P$(GMAKE_PARALLELISM)
$(1).all: bootstrap fetch
cd $(1) && unset MAKEFLAGS && \
$(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
$(1).deliver: $(1)
cd $(1) && $(SOLARENV)/bin/deliver.pl
$(1).clean:
cd $(1) && $(SOLARENV)/bin/deliver.pl -delete
rm -fr $(1)/$(INPATH)
endef
define dmake_modules_rules
$(foreach m,$(1),$(call dmake_module_rules,$(m)))
endef
#
# Partial Build
#
$(eval $(call gbuild_modules_rules,$(gbuild_modules)))
$(eval $(call dmake_modules_rules,$(dmake_modules)))
# run a JunitTest - relies on naming convention (module prefix)
$(WORKDIR)/JunitTest/%/done :
cd $(firstword $(subst _, ,$*)) && $(GNUMAKE) $(GMAKE_OPTIONS) $@ gb_PARTIALBUILD=T
# run a CppunitTest - relies on naming convention (module prefix)
$(WORKDIR)/CppunitTest/%.test :
cd $(firstword $(subst _, ,$*)) && $(GNUMAKE) $(GMAKE_OPTIONS) $@ gb_PARTIALBUILD=T
#
# Clean
#
clean: clean-host clean-build
clean-host:
ifeq ($(BUILD_DMAKE),YES)
if [ -f dmake/Makefile ] ; then $(GNUMAKE) -j $(GMAKE_PARALLELISM) -C dmake clean; fi
endif
rm -fr $(DEVINSTALLDIR)
rm -fr $(OUTDIR)
rm -fr $(WORKDIR)
rm -fr $(SRCDIR)/*/$(INPATH)
rm -fr $(SRCDIR)/solenv/$(OUTPATH)
rm -fr install
clean-build:
ifeq ($(CROSS_COMPILING),YES)
rm -rf $(SOLARVER)/$(INPATH_FOR_BUILD) # not necessarily below SRCDIR
rm -rf $(SRCDIR)/*/$(INPATH_FOR_BUILD)
endif
include $(SRCDIR)/compilerplugins/Makefile.mk
#
# Distclean
#
distclean : clean compilerplugins-clean
ifeq ($(BUILD_DMAKE),YES)
(if [ -f dmake/Makefile ] ; then $(GNUMAKE) -j $(GMAKE_PARALLELISM) -C dmake distclean; fi) && \
rm -f solenv/*/bin/dmake*
endif
rm -fr config_host.mk config_build.mk aclocal.m4 autom4te.cache \
bin/repo-list config.log config.status configure \
ooo.lst post_download post_download.log \
config_host.mk.last set_soenv.stamp src.downloaded warn \
solenv/bin/concat-deps.exe solenv/bin/concat-deps
find $(SOLARENV)/gdb -name "*.pyc" -exec rm {} \;
#
# custom command
#
ifneq ( $(MAKECMDGOALS),cmd)
cmd:
echo "custom cmd" && ( $(cmd) )
endif
ifneq ($(filter-out clean distclean,$(MAKECMDGOALS)),)
#
# Fetch
#
fetch: src.downloaded
src.downloaded : Makefile.top download ooo.lst bin/repo-list
ifeq ($(DO_FETCH_TARBALLS),YES)
@./download $(SRCDIR)/ooo.lst && touch $@
else
@echo "Automatic fetching of external tarballs is disabled."
endif
#
# Bootstap
#
bootstrap: $(WORKDIR)/bootstrap compilerplugins
$(WORKDIR)/bootstrap: solenv/bin/concat-deps.c
@cd $(SRCDIR) && ./bootstrap
@mkdir -p $(dir $@) && touch $@
#
# Build
#
build-packimages: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
ifeq ($(DISABLE_SCRIPTING),TRUE)
# We must get the headers from vbahelper "delivered" because
# as we don't link to any libs from there they won't otherwise be, or
# something. And we still do include those headers always even if the
# libs aren't built in the --disable-scripting case. (Ifdefs for
# DISABLE_SCRIPTING will be added to the code later as necessary.)
$(GNUMAKE) vbahelper
endif
ifeq ($(DISABLE_DBCONNECTIVITY),TRUE)
# Ditto for dbconnectivity in the --disable-database-connectivity case
cd connectivity && sed -e 's/^\(export [A-Z0-9_]*=\)\(.*\)$$/\1"\2"/' <../config_host.mk >conftmp.sh && . conftmp.sh && rm conftmp.sh && $(SOLARENV)/bin/deliver.pl
endif
cd packimages && unset MAKEFLAGS && \
$(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM) && \
$(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS)
build: build-packimages
ifeq ($(OS_FOR_BUILD),WNT)
cd instsetoo_native && unset MAKEFLAGS && $(SOLARENV)/bin/build.pl
else
cd instsetoo_native && unset MAKEFLAGS && \
$(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) -- -P$(GMAKE_PARALLELISM)
endif
ifeq ($(OS),ANDROID)
cd android && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS)
endif
build-nocheck : export SKIP_TESTS := YES
build-nocheck : build
cross-toolset: bootstrap fetch
cd cross_toolset && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS)
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
ifneq (WNT,$(OS))
# We need to build nss for nsinstall... See NSINSTALL=... in nss/makefile.mk
$(GNUMAKE) gb_Side=build nss
endif
endif
#
# Install
#
install:
echo "Installing in $(INSTALLDIR)..." && \
ooinstall "$(INSTALLDIR)" && \
echo "" && \
echo "Installation finished, you can now execute:" && \
echo "$(INSTALLDIR)/program/soffice"
install-strip:
echo "Installing and stripping binaries in $(INSTALLDIR)..." && \
ooinstall --strip "$(INSTALLDIR)" && \
echo "" && \
echo "Installation finished, you can now execute:" && \
echo "$(INSTALLDIR)/program/soffice"
dev-install: build
@rm -rf $(DEVINSTALLDIR)
@mkdir $(DEVINSTALLDIR)
ifeq ($(OS_FOR_BUILD),WNT)
cd instsetoo_native && unset MAKEFLAGS && $(SOLARENV)/bin/build.pl LIBO_DEV_INSTALL=TRUE
unzip -q -d "$(DEVINSTALLDIR)" "$(SRCDIR)/instsetoo_native/$(INPATH)/LibreOffice/archive/install/en-US/LibO*_install-arc_en-US.zip"
mv "$(DEVINSTALLDIR)"/LibO*_install-arc_en-US/* "$(DEVINSTALLDIR)"/opt
else
ifeq ($(DISABLE_LINKOO),TRUE)
@ooinstall $(DEVINSTALLDIR)/opt
@install-gdb-printers -L
else
@ooinstall -l $(DEVINSTALLDIR)/opt
endif
endif
@rm -f $(SRCDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(SRCDIR)/install
dev-install-nocheck : export SKIP_TESTS := YES
dev-install-nocheck : dev-install
install-tb:
@rm -rf $(DEVINSTALLDIR)
@mkdir $(DEVINSTALLDIR)
ifeq ($(OS_FOR_BUILD),WNT)
cd instsetoo_native && unset MAKEFLAGS && $(SOLARENV)/bin/build.pl LIBO_DEV_INSTALL=TRUE
unzip -q -d "$(DEVINSTALLDIR)" "$(SRCDIR)/instsetoo_native/$(INPATH)/LibreOffice/archive/install/en-US/LibO*_install-arc_en-US.zip"
mv "$(DEVINSTALLDIR)"/LibO*_install-arc_en-US/* "$(DEVINSTALLDIR)"/opt
else
@ooinstall $(DEVINSTALLDIR)/opt
@install-gdb-printers
endif
@rm -f $(SRCDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(SRCDIR)/install
distro-pack-install: install
$(SRCDIR)/bin/distro-install-clean-up
$(SRCDIR)/bin/distro-install-desktop-integration
$(SRCDIR)/bin/distro-install-sdk
$(SRCDIR)/bin/distro-install-file-lists
id:
@create-ids
tags:
@create-tags
docs:
@mkdocs.sh $(SRCDIR)/docs $(SOLARENV)/inc/doxygen.cfg
findunusedcode:
@which callcatcher > /dev/null 2>&1 || \
(echo "callcatcher not installed" && false)
@sed -e s,$$INPATH,callcatcher,g $(SRCDIR)/config_host.mk | sed -e s,"export OOO_JUNIT_JAR=.*","export OOO_JUNIT_JAR=",g > $(SRCDIR)/config_host_callcatcher.mk
@echo unexport ARCH_FLAGS >> $(SRCDIR)/config_host_callcatcher.mk
@echo unexport CFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
@echo unexport CXXFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
@mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
ln -sf $(SRCDIR)/solenv/$(INPATH)/bin/dmake \
$(SRCDIR)/solenv/callcatcher/bin/dmake
@$(GNUMAKE) -f $(SOLARENV)/bin/callcatcher.Makefile findunusedcode
@grep ::.*\( unusedcode.all \
| grep -v ^Atom \
| grep -v ^atom:: \
| grep -v ^boost:: \
| grep -v ^CIcc \
| grep -v ^CLuceneError:: \
| grep -v ^cppu:: \
| grep -v ^Dde \
| grep -v ^graphite2:: \
| grep -v ^jvmaccess:: \
| grep -v ^libcdr:: \
| grep -v ^libcmis:: \
| grep -v ^libmspub:: \
| grep -v ^libvisio:: \
| grep -v ^libwpg:: \
| grep -v ^libwps_tools_win:: \
| grep -v ^lucene:: \
| grep -v ^Matrix3d:: \
| grep -v ^salhelper:: \
| grep -v ^VSDInternalStream:: \
| grep -v ^WP1 \
| grep -v ^WP3 \
| grep -v ^WP42 \
| grep -v ^WP6 \
| grep -v ^WPG \
| grep -v ^WPS \
| grep -v WPX \
| grep -v ^WSObject \
> unusedcode.easy
check: dev-install subsequentcheck
subsequentcheck :| $(if $(filter-out subsequentcheck,$(MAKECMDGOALS)),dev-install)
$(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
unitcheck:
$(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
slowcheck:
$(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
debugrun:
$(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
endif # not clean or distclean
# vim: set noet sw=4 ts=4:
|