Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / Makefile.top
blobe2d9d12c8f53ada538bf65688ada348224e41b3f
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 .PHONY : all bootstrap build check clean clean-build clean-host dev-install distclean distro-pack-install docs fetch findunusedcode id install install-strip subsequentcheck tags
5 ifeq ($(MAKECMDGOALS),)
6 MAKECMDGOALS:=all
7 endif
9 all: build
11 SHELL=/usr/bin/env bash
12 SRCDIR:=$(patsubst %/,%,$(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
14 ifeq ($(gb_Side),)
15 gb_Side:=host
16 endif
18 include $(SRCDIR)/config_$(gb_Side).mk
20 ifeq ($(GMAKE_OPTIONS),)
21 ifeq ($(VERBOSE),)
22 export GMAKE_OPTIONS:=-rs
23 else
24 export GMAKE_OPTIONS:=-r
25 endif
26 endif
28 gbuild_modules:= \
29 MathMLDTD\
30 Mesa\
31 UnoControls\
32 accessibility\
33 animations\
34 apple_remote\
35 avmedia\
36 basctl\
37 basebmp\
38 basegfx\
39 basic\
40 bean\
41 binaryurp\
42 canvas\
43 chart2\
44 clucene\
45 codemaker\
46 comphelper\
47 configmgr\
48 connectivity\
49 cppcanvas\
50 cppu\
51 cppuhelper\
52 cpputools\
53 cui\
54 dbaccess\
55 desktop\
56 drawinglayer\
57 dtrans\
58 editeng\
59 embeddedobj\
60 embedserv\
61 eventattacher\
62 extensions\
63 fileaccess\
64 filter\
65 forms\
66 formula\
67 fpicker\
68 framework\
69 hwpfilter\
70 i18npool\
71 i18nutil\
72 idl\
73 idlc\
74 io\
75 javaunohelper\
76 jurt\
77 jvmaccess\
78 jvmfwk\
79 l10ntools\
80 lingucomponent\
81 linguistic\
82 lotuswordpro\
83 nlpsolver\
84 np_sdk\
85 o3tl\
86 offapi\
87 officecfg\
88 oovbaapi\
89 oox\
90 package\
91 packimages\
92 padmin\
93 psprint_config\
94 qadevOOo\
95 regexp\
96 registry\
97 remotebridges\
98 reportbuilder\
99 reportdesign\
100 rdbmaker\
101 ridljar\
102 rsc\
103 sal\
104 salhelper\
105 sane\
106 sax\
108 scaddins\
109 sccomp\
110 scp2\
111 scripting\
113 sdext\
114 sfx2\
115 shell\
116 slideshow\
117 smoketest\
118 solenv\
119 sot\
120 starmath\
121 stoc\
122 store\
123 svl\
124 svtools\
125 svx\
127 swext\
128 tail_build\
129 test\
130 testtools\
131 toolkit\
132 tools\
133 translations\
134 twain\
135 ucb\
136 ucbhelper\
137 udkapi\
138 unixODBC\
139 unodevtools\
140 unoil\
141 unotest\
142 unotools\
143 unoxml\
144 ure\
145 uui\
146 vbahelper\
147 vcl\
148 wizards\
149 writerfilter\
150 writerperfect\
151 x11_extensions\
152 xmerge\
153 xml2cmp\
154 xmlhelp\
155 xmloff\
156 xmlreader\
157 xmlscript\
158 xmlsecurity\
160 dmake_modules:=\
161 afms\
162 apache-commons\
163 autodoc\
164 beanshell\
165 berkeleydb\
166 binfilter \
167 boost\
168 bridges\
169 cairo\
170 cli_ure\
171 cosv\
172 cppunit\
173 crashrep\
174 ct2n\
175 curl\
176 dictionaries \
177 epm\
178 expat\
179 external\
180 extras\
181 fontconfig\
182 freetype\
183 gdk-pixbuf\
184 gettext\
185 glib\
186 graphite\
187 helpcontent2 \
188 hsqldb\
189 hunspell\
190 hyphen\
191 icu\
192 instsetoo_native\
193 jfreereport\
194 jpeg\
195 languagetool\
196 libcdr\
197 libcmis\
198 libcroco\
199 libexttextcat\
200 libgsf\
201 libpng\
202 librsvg\
203 libvisio\
204 libwpd\
205 libwpg\
206 libwps\
207 libxml2\
208 libxmlsec\
209 libxslt\
210 lcms2\
211 lpsolve\
212 lucene\
213 mdds\
214 migrationanalysis\
215 more_fonts\
216 moz\
217 mysqlc\
218 mysqlcppconn\
219 mythes\
220 neon\
221 nss\
222 odk\
223 openssl\
224 pango\
225 postgresql\
226 postprocess\
227 python\
228 pyuno\
229 readlicense_oo\
230 redland\
231 rhino\
232 saxon\
233 setup_native\
234 soltools\
235 stax\
236 stlport\
237 sysui\
238 tomcat\
239 udm\
240 vigra\
241 xpdf\
242 xsltml\
243 zlib\
245 gb_TAILBUILDMODULES := $(shell $(GNUMAKE) -r -f $(SRCDIR)/tail_build/Makefile showmodules)
246 export gb_TAILBUILDTARGET=all slowcheck
248 define gbuild_module_rules
249 .PHONY: $(1) $(1).all $(1).clean $(1).deliver
251 $(1): bootstrap fetch
252         cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) gb_PARTIALBUILD=T
254 ifeq ($(filter $(1),$(gb_TAILBUILDMODULES)),)
255 $(1).all: bootstrap fetch
256         cd $(1) && unset MAKEFLAGS && \
257         $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
258 else
259 $(1).all: bootstrap fetch
260         cd tail_build && unset MAKEFLAGS && \
261         export gb_TAILBUILDTARGET="$(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)" && \
262         $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
263 endif
265 $(1).clean:
266         cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) clean gb_PARTIALBUILD=T
268 $(1).subsequentcheck:
269         cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck gb_PARTIALBUILD=T
271 $(1).deliver:
272         @true
274 endef
276 define gbuild_modules_rules
277 $(foreach m,$(1),$(call gbuild_module_rules,$(m)))
278 endef
280 define dmake_module_rules
281 .PHONY: $(1) $(1).all $(1).deliver $(1).clean
283 $(1): bootstrap fetch
284         cd $(1) && unset MAKEFLAGS && \
285         $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) -- -P$(GMAKE_PARALLELISM)
287 $(1).all: bootstrap fetch
288         cd $(1) && unset MAKEFLAGS && \
289         $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
291 $(1).deliver: $(1)
292         cd $(1) && $(SOLARENV)/bin/deliver.pl
294 $(1).clean:
295         cd $(1) && $(SOLARENV)/bin/deliver.pl -delete
296         rm -fr $(1)/$(INPATH)
298 endef
300 define dmake_modules_rules
301 $(foreach m,$(1),$(call dmake_module_rules,$(m)))
302 endef
305 # Partial Build
307 $(eval $(call gbuild_modules_rules,$(gbuild_modules)))
309 $(eval $(call dmake_modules_rules,$(dmake_modules)))
312 # Clean
314 clean: clean-host clean-build
316 clean-host:
317         rm -fr $(DEVINSTALLDIR)
318         rm -fr $(SOLARVER)/$(INPATH) # not necessarily below SRCDIR
319         rm -fr $(SRCDIR)/*/$(INPATH)
320         rm -fr install
322 clean-build:
323 ifeq ($(CROSS_COMPILING),YES)
324         rm -rf $(SOLARVER)/$(INPATH_FOR_BUILD) # not necessarily below SRCDIR
325         rm -rf $(SRCDIR)/*/$(INPATH_FOR_BUILD)
326 endif
329 # Distclean
331 distclean : clean
332 ifeq ($(BUILD_DMAKE),YES)
333         (if [ -f dmake/Makefile ] ; then $(GNUMAKE) -j $(GMAKE_PARALLELISM) -C dmake distclean; fi) && \
334         rm -f solenv/*/bin/dmake*
335 endif
336         rm -fr config_host.mk config_build.mk aclocal.m4 autom4te.cache \
337     bin/repo-list config.log config.status configure \
338         ooo.lst post_download post_download.log \
339         config_host.mk.last set_soenv.stamp src.downloaded warn
340         find $(SOLARENV)/gdb -name "*.pyc" -exec rm {} \;
343 # custom command
345 ifneq ( $(MAKECMDGOALS),cmd)
346 cmd:
347         echo "custom cmd" && ( $(cmd) )
349 endif
351 ifneq ($(filter-out clean distclean,$(MAKECMDGOALS)),)
353 # Fetch
355 fetch: src.downloaded
357 src.downloaded : Makefile.top download ooo.lst bin/repo-list
358 ifeq ($(DO_FETCH_TARBALLS),YES)
359         @./download $(SRCDIR)/ooo.lst && touch $@
360 else
361         @echo "Automatic fetching of external tarballs is disabled."
362 endif
365 # Bootstap
367 bootstrap: $(WORKDIR)/bootstrap
369 $(WORKDIR)/bootstrap:
370         @cd $(SRCDIR) && ./bootstrap
371         @mkdir -p $(dir $@) && touch $@
374 # Build
376 build-packimages: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
377 ifeq ($(DISABLE_SCRIPTING),TRUE)
378 # We must get the headers from vbahelper "delivered" because
379 # as we don't link to any libs from there they won't otherwise be, or
380 # something. And we still do include those headers always even if the
381 # libs aren't built in the --disable-scripting case. (Ifdefs for
382 # DISABLE_SCRIPTING will be added to the code later as necessary.)
383         $(GNUMAKE) vbahelper
384 endif
385 ifeq ($(DISABLE_DBCONNECTIVITY),TRUE)
386 # Ditto for dbconnectivity in the --disable-database-connectivity case
387         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
388 endif
389         cd packimages && unset MAKEFLAGS && \
390                 $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM) && \
391                 $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS)
393 build: build-packimages
394 ifeq ($(OS_FOR_BUILD),WNT)
395         cd instsetoo_native && unset MAKEFLAGS && $(SOLARENV)/bin/build.pl
396 else
397         cd instsetoo_native && unset MAKEFLAGS && \
398         $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) -- -P$(GMAKE_PARALLELISM)
399 endif
401 cross-toolset: bootstrap fetch
402         cd cross_toolset && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS)
406 # Install
409 install:
410         echo "Installing in $(INSTALLDIR)..." && \
411         ooinstall "$(INSTALLDIR)" && \
412         echo "" && \
413         echo "Installation finished, you can now execute:" && \
414         echo "$(INSTALLDIR)/program/soffice"
416 install-strip:
417         echo "Installing and stripping binaries in $(INSTALLDIR)..." && \
418         ooinstall --strip "$(INSTALLDIR)" && \
419         echo "" && \
420         echo "Installation finished, you can now execute:" && \
421         echo "$(INSTALLDIR)/program/soffice"
423 dev-install: build
424         @rm -rf $(DEVINSTALLDIR)
425         @mkdir $(DEVINSTALLDIR)
426 ifeq ($(DISABLE_LINKOO),TRUE)
427         @ooinstall $(DEVINSTALLDIR)/opt
428         @install-gdb-printers -L
429 else
430         @ooinstall -l $(DEVINSTALLDIR)/opt
431 endif
432         @rm -f $(SRCDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(SRCDIR)/install
434 distro-pack-install: install
435         $(SRCDIR)/bin/distro-install-clean-up
436         $(SRCDIR)/bin/distro-install-desktop-integration
437         $(SRCDIR)/bin/distro-install-sdk
438         $(SRCDIR)/bin/distro-install-file-lists
441         @create-ids
443 tags:
444         @create-tags
446 docs:
447         @mkdocs.sh $(SRCDIR)/docs $(SOLARENV)/inc/doxygen.cfg
449 findunusedcode:
450         @which callcatcher > /dev/null 2>&1 || \
451             (echo "callcatcher not installed" && false)
452         @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
453         @mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
454             ln -sf $(SRCDIR)/solenv/$(INPATH)/bin/dmake \
455                 $(SRCDIR)/solenv/callcatcher/bin/dmake
456         @$(GNUMAKE) -f $(SOLARENV)/bin/callcatcher.Makefile findunusedcode
457         @grep ::.*\( unusedcode.all \
458               | grep -v ^Atom \
459               | grep -v ^boost:: \
460               | grep -v ^CIcc \
461               | grep -v ^CLuceneError:: \
462               | grep -v ^cppu:: \
463               | grep -v ^Dde \
464               | grep -v ^graphite2:: \
465               | grep -v ^jvmaccess:: \
466               | grep -v ^libcdr:: \
467               | grep -v ^libcmis:: \
468               | grep -v ^libvisio:: \
469               | grep -v ^libwpg:: \
470               | grep -v ^libwps_tools_win:: \
471               | grep -v ^lucene:: \
472               | grep -v ^Matrix3d:: \
473               | grep -v ^salhelper:: \
474               | grep -v ^WP1 \
475               | grep -v ^WP3 \
476               | grep -v ^WP42 \
477               | grep -v ^WP6 \
478               | grep -v ^WPG \
479               | grep -v ^WPS \
480               | grep -v WPX \
481               > unusedcode.easy
483 check: dev-install subsequentcheck
485 subsequentcheck :| $(if $(filter-out subsequentcheck,$(MAKECMDGOALS)),dev-install)
486         $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
488 debugrun:
489         $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
491 endif # not clean or distclean
494 #########################
495 # help
497 .PHONY: help
498 help:
499         @cat $(SRCDIR)/solenv/gbuild/gbuild.help.txt
500         @true
503 # vim: set noet sw=4 ts=4: