blob: a326701b92ebdfd3d18ccaa96d805473aad6700d [file] [log] [blame]
Takeshi Abeb2bd33e2011-08-10 02:12:48 +09001# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
Michael Stahlb0b92d12012-05-15 14:47:37 +02002#
Michael Meeks72e5d0c2013-04-24 17:14:03 +01003# This file is part of the LibreOffice project.
Michael Stahlb0b92d12012-05-15 14:47:37 +02004#
5# This Source Code Form is subject to the terms of the Mozilla Public
6# License, v. 2.0. If a copy of the MPL was not distributed with this
7# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8#
Norbert Thiebaudc857dff2012-01-24 15:48:30 -06009
Thorsten Behrens5a953642016-08-18 02:43:14 +020010gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck subsequentcheck perfcheck uicheck screenshot
Matúš Kukan14443162014-09-05 12:43:34 +020011
Thorsten Behrens23118ce2022-09-11 12:21:22 +020012.PHONY : check-if-root bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install docs download etags fetch get-submodules id install install-gdb-printers install-strip tags debugrun help showmodules translations packageinfo coverage internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
Matúš Kukan0e6212c2012-12-23 19:27:28 +010013
Luboš Luňáka58e0862020-03-02 11:45:24 +010014MAKECMDGOALS?=build
Thorsten Behrens243c05a2021-12-04 18:21:04 +010015build_goal:=$(if $(filter build uicheck,$(MAKECMDGOALS)),build)\
Luboš Luňáka58e0862020-03-02 11:45:24 +010016 $(if $(filter check,$(MAKECMDGOALS)),unitcheck slowcheck subsequentcheck $(if $(filter Linux, $(shell uname)), uicheck))\
17 $(filter build-l10n-only build-non-l10n-only debugrun help showmodules translations $(gb_Top_MODULE_CHECK_TARGETS) check packageinfo gbuildtojson,$(MAKECMDGOALS))
Norbert Thiebaude48d33b2012-01-26 16:29:26 -060018
Matúš Kukan0e6212c2012-12-23 19:27:28 +010019SRCDIR := @SRC_ROOT@
20BUILDDIR := @BUILDDIR@
Miklos Vajna13de7522017-11-20 09:04:51 +010021COMPILER_PLUGINS := @COMPILER_PLUGINS@
David Tardon40ae8f32013-05-30 16:12:22 +020022GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T)
Norbert Thiebaudc857dff2012-01-24 15:48:30 -060023
David Tardon40ae8f32013-05-30 16:12:22 +020024# Run autogen.sh if needed and force make to restart itself.
25# ... but there are several cases where we do not want to run
26# autogen.sh:
27# 1. if we are building from tarballs, not git checkout (I do not
28# think packagers would ever want that. I certainly do not.)
29# 2. if we are making help, clean or distclean, because they do not
30# need updated configuration
Peter Foley7abf6862014-09-08 14:52:03 -040031ifeq (,$(MAKE_RESTARTS)$(if $(GIT_BUILD),,T)$(if $(filter-out help showmodules clean distclean,$(MAKECMDGOALS)),,T))
Norbert Thiebaudc857dff2012-01-24 15:48:30 -060032
Michael Stahl1176ae52017-07-27 13:18:11 +020033# note: this must touch both Makefile and $(BUILDDIR)/Makefile, because make
34# may be invoked using either of these paths, and it will restart itself only
35# if the updated target is exactly the same path as the Makefile it is using
Matúš Kukan0e6212c2012-12-23 19:27:28 +010036.PHONY : force-restart
Michael Stahl1176ae52017-07-27 13:18:11 +020037Makefile $(BUILDDIR)/Makefile: $(BUILDDIR)/config_host.mk $(BUILDDIR)/config_host_lang.mk force-restart
Matúš Kukan0e6212c2012-12-23 19:27:28 +010038 @touch $@
Norbert Thiebaudc857dff2012-01-24 15:48:30 -060039
Michael Stahlb0b92d12012-05-15 14:47:37 +020040# run configure in an environment not polluted by config_host.mk
Matúš Kukan38a22f562013-11-21 00:02:18 +010041$(BUILDDIR)/config_host.mk : $(wildcard \
Jan-Marek Glogowski69b6c872021-12-24 13:47:46 +010042 $(SRCDIR)/autogen.sh \
Michael Stahlb0b92d12012-05-15 14:47:37 +020043 $(SRCDIR)/config_host.mk.in \
David Tardonc8708f32015-03-26 09:19:01 +010044 $(SRCDIR)/config_host_lang.mk.in \
Norbert Thiebaudae4e3272012-12-11 07:49:24 -060045 $(SRCDIR)/Makefile.in \
Michael Stahl2a9ecb82013-01-18 22:11:53 +010046 $(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
Peter Foley39558762012-10-19 16:59:21 -040047 $(SRCDIR)/configure.ac \
Matúš Kukan38a22f562013-11-21 00:02:18 +010048 $(SRCDIR)/config_host/*.h.in \
Michael Stahl745cf842018-05-08 17:24:15 +020049 $(SRCDIR)/download.lst \
Jan-Marek Glogowski6bed8aa2021-12-24 13:45:47 +010050 $(SRCDIR)/m4/*.m4 \
Matúš Kukan38a22f562013-11-21 00:02:18 +010051 $(BUILDDIR)/autogen.input \
Tor Lillqvistc32d54f2017-09-22 16:51:22 +030052 $(BUILDDIR)/autogen.lastrun \
Michael Stahl086c1352016-07-20 13:28:24 +020053 ) \
Jan-Marek Glogowski3e241392016-07-31 13:06:18 +020054 $(shell . $(SRCDIR)/bin/get_config_variables JAVA_HOME && \
Michael Stahlfcdf75d2016-09-23 17:05:54 +020055 if test -n "$${JAVA_HOME}" -a ! -d "$${JAVA_HOME}/bin"; then echo force-restart; fi)
Michael Stahlfe8c5f62014-06-02 00:18:08 +020056 sh -c $(SRCDIR)/autogen.sh
Norbert Thiebaud84399902012-01-26 14:26:49 -060057
Matúš Kukan0e6212c2012-12-23 19:27:28 +010058else # MAKE_RESTARTS
59
Luboš Luňáka58e0862020-03-02 11:45:24 +010060.DEFAULT_GOAL := build
Tor Lillqvist46625762016-04-14 09:01:48 +030061
Stephan Bergmanncfab6952021-07-19 17:32:06 +020062# Nested test is to check if the systemd-detect-virt command doesn't exist or it reports we're not
63# in a container:
Michael Stahl21f82772017-02-22 15:01:12 +010064check-if-root:
Caolán McNamara1eb18362021-04-07 15:12:39 +010065 @if test ! `uname` = 'Haiku' -a `id -u` = 0; then \
Caolán McNamara1eb18362021-04-07 15:12:39 +010066 if test ! -x "$$(command -v systemd-detect-virt)" || ! systemd-detect-virt -c -q; then \
67 echo; \
68 echo 'Building LibreOffice as root is a very bad idea, use a regular user.'; \
69 echo; \
70 exit 1; \
71 fi \
Michael Stahl21f82772017-02-22 15:01:12 +010072 fi
73
Bjoern Michaelsen4a016d12013-11-21 00:34:20 +010074gb_Side ?= host
Matúš Kukan0e6212c2012-12-23 19:27:28 +010075
76include $(BUILDDIR)/config_$(gb_Side).mk
Matúš Kukan0e6212c2012-12-23 19:27:28 +010077
Stephan Bergmann5067d312015-10-02 11:30:40 +020078export GMAKE_OPTIONS?=-r$(if $(verbose),,s)$(value $(MAKEFLAGS))
Matúš Kukan0e6212c2012-12-23 19:27:28 +010079
Luboš Luňákf605cfc2014-03-23 15:58:00 +010080PARALLELISM_OPTION := $(if $(filter-out 0,$(PARALLELISM)),-j $(PARALLELISM),)
81
Matúš Kukanf2e73652013-02-27 18:40:36 +010082#
83# Partial Build
84#
Bjoern Michaelsen60c64b42013-11-20 19:21:34 +010085define gb_Top_GbuildModuleRules
Thorsten Behrens23118ce2022-09-11 12:21:22 +020086.PHONY: $(1) $(1).build $(1).all $(1).check $(1).clean $(1).showdeliverables $(1).coverage $(foreach target,$(gb_Top_MODULE_CHECK_TARGETS),$(1).$(target))
Jan-Marek Glogowski4b8cef42022-01-16 20:08:19 +010087.PHONY: $(1).allbuild $(1).buildall $(1).allcheck $(1).checkall
Matúš Kukan0e6212c2012-12-23 19:27:28 +010088
89$(1): bootstrap fetch
Gabor Kelemen079659e2022-04-28 11:14:24 +020090 cd $(SRCDIR)/$(2) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
Matúš Kukan0e6212c2012-12-23 19:27:28 +010091
Thorsten Behrens23118ce2022-09-11 12:21:22 +020092$(1).build $(1).check $(1).coverage $(foreach target,$(gb_Top_MODULE_CHECK_TARGETS),$(1).$(target)): bootstrap fetch
Stephan Bergmann102d87f2016-06-29 15:03:13 +020093 cd $(SRCDIR)/$(2) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
94
95$(1).clean $(1).showdeliverables:
Luboš Luňák35720ea2014-03-23 21:20:00 +010096 cd $(SRCDIR)/$(2) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
Matúš Kukan0e6212c2012-12-23 19:27:28 +010097
Jan-Marek Glogowski4b8cef42022-01-16 20:08:19 +010098$(1).allbuild $(1).buildall: bootstrap fetch
Gabor Kelemen079659e2022-04-28 11:14:24 +020099 $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1)
Luboš Luňákd6496fc2022-01-12 16:21:26 +0100100
Jan-Marek Glogowski4b8cef42022-01-16 20:08:19 +0100101$(1).allcheck $(1).checkall: bootstrap fetch
Gabor Kelemen079659e2022-04-28 11:14:24 +0200102 $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)
Matúš Kukanbdd92142013-02-26 15:15:22 +0100103
Jan-Marek Glogowski4b8cef42022-01-16 20:08:19 +0100104$(1).all:
105 @echo "'make $(1).all' was renamed to 'make $(1).allcheck' (or use 'make $(1).allbuild' to build without unit tests)"
106 @exit 42
Luboš Luňákd6496fc2022-01-12 16:21:26 +0100107
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100108endef
Norbert Thiebaudae4e3272012-12-11 07:49:24 -0600109
Bjoern Michaelsen60c64b42013-11-20 19:21:34 +0100110define gb_Top_GbuildModulesRules
111$(foreach m,$(1),$(call gb_Top_GbuildModuleRules,$(notdir $(m)),$(m)))
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100112endef
113
Michael Stahldddff6e2013-10-23 16:33:50 +0200114gbuild_modules := $(patsubst $(SRCDIR)/%/,%,$(dir $(wildcard $(SRCDIR)/*/Module_*.mk $(SRCDIR)/external/*/Module_*.mk)))
Peter Foley96f94302013-03-24 09:34:55 -0400115
Noel Grandin065d6cc2014-07-07 14:29:05 +0200116gbuild_internal_modules := $(filter-out odk external,$(patsubst $(SRCDIR)/%/,%,$(dir $(wildcard $(SRCDIR)/*/Module_*.mk))))
117
118internal.clean: $(addsuffix .clean,$(gbuild_internal_modules))
119
120
Bjoern Michaelsen60c64b42013-11-20 19:21:34 +0100121$(eval $(call gb_Top_GbuildModulesRules,$(gbuild_modules)))
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100122
Peter Foleyac3e90b2013-03-02 13:06:22 -0500123gbuild_TARGETS := AllLangHelp \
Stephan Bergmann0dacfe22017-10-20 13:46:49 +0200124 AllLangMoTarget \
David Tardone78646e2013-05-07 12:29:34 +0200125 AllLangPackage \
Matúš Kukan7a878f92013-06-10 00:56:28 +0200126 AutoInstall \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500127 CliLibrary \
128 CliNativeLibrary \
Michael Stahl6bd0f9b2013-10-28 10:32:03 +0100129 CliUnoApi \
Stephan Bergmann657bca92016-12-16 10:09:45 +0100130 CompilerTest \
Jan-Marek Glogowskice827c52021-12-15 15:54:44 +0100131 ComponentTarget \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500132 Configuration \
133 CppunitTest \
134 CustomTarget \
135 Dictionary \
136 Executable \
137 Extension \
Michael Stahl704451d2013-10-31 00:15:51 +0100138 ExtensionPackage \
Michael Stahl60211132013-10-31 00:58:46 +0100139 ExtensionPackageSet \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500140 ExternalPackage \
141 ExternalProject \
Stephan Bergmann514baf72015-01-07 13:45:56 +0100142 Gallery \
David Tardon0fd330e2013-05-04 13:21:33 +0200143 GeneratedPackage \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500144 InstallModule \
145 InstallScript \
146 InternalUnoApi \
147 Jar \
148 JunitTest \
149 Library \
150 Module \
151 Package \
David Tardon9d54f0e2013-04-07 09:45:19 +0200152 PackageSet \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500153 Pagein \
David Tardondf7b8632013-05-24 15:49:11 +0200154 Postprocess \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500155 Pyuno \
Michael Stahl3094d722013-04-18 22:59:25 +0200156 PythonTest \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500157 Rdb \
Stephan Bergmann777a05b2018-01-12 10:03:55 +0100158 SdiTarget \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500159 StaticLibrary \
David Tardoned729832013-04-06 13:10:54 +0200160 UIConfig \
Markus Mohrhard3ead72d2016-05-09 10:05:14 +0200161 UITest \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500162 UnoApi \
Peter Foleyac3e90b2013-03-02 13:06:22 -0500163 UnpackedTarball \
164 WinResTarget \
David Tardonea18ca02013-03-31 11:34:10 +0200165 Zip \
David Tardon3d50cfa2013-04-14 08:18:27 +0200166
Peter Foleyac3e90b2013-03-02 13:06:22 -0500167# build a generic gbuild target
Samuel Thibault8d4d2bf2018-02-15 15:08:03 +0100168$(foreach target,$(gbuild_TARGETS),$(target)_% $(foreach module,$(gbuild_modules),$(target)_$(module)/%)) UIConfig_modules/% %.genpatch: bootstrap fetch
Luboš Luňákf8062812014-03-23 17:46:23 +0100169 $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100170
Samuel Thibault77b09e72018-03-14 13:37:31 +0100171$(gbuild_TARGETS):
172 $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
173
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100174#
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100175# Clean
176#
177clean: clean-host clean-build
178
179clean-host:
Michael Stahlf1d08892013-10-01 15:30:08 +0200180 rm -fr $(TESTINSTALLDIR)
David Tardonbba6e9e2013-04-03 17:13:32 +0200181 rm -fr $(INSTDIR)
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100182 rm -fr $(WORKDIR)
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100183
184clean-build:
Michael Stahld729d162014-02-27 16:19:43 +0100185ifneq ($(CROSS_COMPILING),)
Matúš Kukan58ff5d52013-09-25 09:44:35 +0200186 rm -fr $(INSTDIR_FOR_BUILD)
Matúš Kukanf2e73652013-02-27 18:40:36 +0100187 rm -fr $(WORKDIR_FOR_BUILD)
Christian Lohmaier5cb55162017-11-30 13:52:40 +0100188ifeq ($(OS),ANDROID)
Michael Weghornf2180bd2020-07-17 09:33:31 +0200189 rm -fr $(BUILDDIR)/android/obj
190 rm -fr $(BUILDDIR)/android/jniLibs
Christian Lohmaier5cb55162017-11-30 13:52:40 +0100191 rm -fr $(SRCDIR)/android/source/build
192 rm -fr $(SRCDIR)/android/source/assets
193 rm -fr $(SRCDIR)/android/source/assets_fullUI
194 rm -fr $(SRCDIR)/android/source/assets_strippedUI
195endif
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100196endif
197
198include $(SRCDIR)/compilerplugins/Makefile.mk
199
200#
201# Distclean
202#
Christian Lohmaierd5c11dd2022-10-20 13:15:32 +0200203distclean : clean compilerplugins-clean mac-app-store-package.clean
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100204 rm -fr \
205 $(BUILDDIR)/Makefile \
206 $(BUILDDIR)/aclocal.m4 \
207 $(BUILDDIR)/autom4te.cache \
Stephan Bergmannf63b5c52016-06-30 11:23:22 +0200208 $(BUILDDIR)/bin/bffvalidator.sh \
Stephan Bergmann7471d392016-09-05 12:10:36 +0200209 $(BUILDDIR)/bin/odfvalidator.sh \
210 $(BUILDDIR)/bin/officeotron.sh \
Stephan Bergmann16b48022013-12-17 14:06:42 +0100211 $(BUILDDIR)/config.Build.log \
Stephan Bergmannf3e1cc62021-06-01 09:11:40 +0200212 $(BUILDDIR)/config.Build.warn \
Stephan Bergmannc2096ec2021-06-01 08:06:05 +0200213 $(BUILDDIR)/config.log \
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100214 $(BUILDDIR)/config.status \
Stephan Bergmannf3e1cc62021-06-01 09:11:40 +0200215 $(BUILDDIR)/config.warn \
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100216 $(BUILDDIR)/config_build.mk \
Peter Foley13ebef02016-01-22 11:47:43 -0500217 $(BUILDDIR)/config_build_lang.mk \
Stephan Bergmann46d434c2018-11-28 13:07:03 +0100218 $(BUILDDIR)/config_build \
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100219 $(BUILDDIR)/config_host.mk \
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100220 $(BUILDDIR)/config_host.mk.stamp \
David Tardonc8708f32015-03-26 09:19:01 +0100221 $(BUILDDIR)/config_host_lang.mk \
222 $(BUILDDIR)/config_host_lang.mk.stamp \
Stephan Bergmann353e1772013-02-04 08:39:08 +0100223 $(BUILDDIR)/config_host/*.h \
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100224 $(BUILDDIR)/configure \
Stephan Bergmannda21c672020-05-04 17:31:12 +0200225 $(BUILDDIR)/hardened_runtime.xcent \
Stephan Bergmanncb50efb2013-01-14 11:05:50 +0100226 $(BUILDDIR)/instsetoo_native/util/openoffice.lst \
Stephan Bergmann74895bf2021-12-02 23:11:52 +0100227 $(BUILDDIR)/solenv/lockfile/autoconf.h \
Christian Lohmaierc78b49e2022-06-29 13:17:14 +0200228 $(BUILDDIR)/lo.xcent \
Stephan Bergmann5e9196b2020-12-16 11:30:33 +0100229 $(BUILDDIR)/sysui/desktop/macosx/Info.plist \
Christian Lohmaier8d7e2662021-12-15 14:21:36 +0100230 $(BUILDDIR)/vs-code*.code-workspace*
Yunusemre Şentürkb7aea472022-02-09 14:59:34 +0300231 $(if $(filter WNT,$(OS)),env -i PATH="$$PATH") $(FIND) $(SRCDIR)/solenv/gdb -name \*.pyc -exec rm -f {} \;
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100232
233#
234# custom command
235#
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100236cmd:
Michael Stahlc5f620f2021-11-08 21:29:05 +0100237 $(if $(verbose),echo "custom cmd" &&) ( $(cmd) )
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100238
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100239#
240# Fetch
241#
Michael Stahle3ba7642014-03-10 23:42:26 +0100242ifneq ($(DO_FETCH_TARBALLS),)
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100243include $(SRCDIR)/Makefile.fetch
244fetch: download
245fetch: get-submodules
246
247ifneq (,$(wildcard $(SRCDIR)/.git))
248get-submodules:
Stephan Bergmannc4170e42018-03-27 16:38:07 +0200249ifneq ($(foreach i,$(GIT_NEEDED_SUBMODULES),$(SRCDIR)/$(i)/.git),$(wildcard $(foreach i,$(GIT_NEEDED_SUBMODULES),$(SRCDIR)/$(i)/.git)))
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100250 cd $(SRCDIR) && ./g -f clone
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100251endif
jan Iversene6d23322018-03-11 12:27:43 +0100252ifeq ($(shell test -d $(SRCDIR)/.git; echo $$?),0)
Andrea Gelminifbec6ac2016-01-04 12:22:58 +0100253 @cd $(SRCDIR) && ./g -z # make sure the git hooks are in place even if no submodules are needed
jan Iversene6d23322018-03-11 12:27:43 +0100254endif
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100255
256else # these sources are from a tarball, so get the other source tarballs
257gb_LO_VER := $(shell . $(SRCDIR)/sources.ver && echo $$lo_sources_ver)
258$(if $(gb_LO_VER),,$(error Error while retrieving $$lo_sources_ver from $(SRCDIR)/sources.ver))
259
260get-submodules: | download
261ifneq ($(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),$(SRCDIR)/src/libreoffice-$(i)-$(gb_LO_VER)),$(wildcard $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),$(SRCDIR)/src/libreoffice-$(i)-$(gb_LO_VER))))
262 $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
Caolán McNamarab057e972022-10-29 19:24:33 +0100263 $(call fetch_Download_item_unchecked,https://download.documentfoundation.org/libreoffice/src/$(shell echo $(gb_LO_VER) | sed -e "s/\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/"),libreoffice-$(i)-$(gb_LO_VER).tar.xz))
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100264 $(SRCDIR)/bin/unpack-sources $(SRCDIR) $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
265 $(TARFILE_LOCATION)/libreoffice-$(i)-$(gb_LO_VER).tar.xz)
266endif
267
268endif
269
270else
271fetch:
272 @echo "Automatic fetching of external tarballs is disabled."
273
274endif
275
276#
Michael Stahl496cba22016-06-23 14:34:15 +0200277# Bootstrap
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100278#
Michael Stahl21f82772017-02-22 15:01:12 +0100279bootstrap: check-if-root compilerplugins
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100280
281#
282# Build
283#
Bjoern Michaelsen4eebd652013-11-19 14:25:45 +0100284# Note: this will pipe through all gbuild targets to ... gbuild
Luboš Luňáka58e0862020-03-02 11:45:24 +0100285# with some translations like "check"->"unitcheck subsequentcheck uicheck" for historic reasons
Michael Stahlbbadfca2013-10-03 18:49:25 +0200286#
Jan-Marek Glogowski70e4c652021-05-20 15:51:21 +0200287build: bootstrap fetch $(if $(CROSS_COMPILING),cross-toolset,install-gdb-printers) \
288 $(if $(filter check,$(MAKECMDGOALS)),$(if $(COMPILER_PLUGINS),$(if $(LODE_HOME),clang-format-check)))
Riccardo Magliocchettic716b382014-11-04 16:26:45 +0100289 $(MAKE) $(PARALLELISM_OPTION) $(IWYU_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(build_goal)
Michael Stahla626bdd2018-10-31 19:06:30 +0100290ifeq ($(OS),iOS)
Luboš Luňákf8062812014-03-23 17:46:23 +0100291 $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) ios
Tor Lillqvist685a12a2013-04-19 09:27:44 +0300292endif
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100293
Thorsten Behrens23118ce2022-09-11 12:21:22 +0200294build-non-l10n-only build-l10n-only check debugrun translations packageinfo coverage $(gb_Top_MODULE_CHECK_TARGETS): build
Peter Foley7abf6862014-09-08 14:52:03 -0400295
Bjoern Michaelsen1fcd5c42016-11-23 01:29:32 +0100296help showmodules gbuildtojson:
Peter Foley7abf6862014-09-08 14:52:03 -0400297 $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
Bjoern Michaelsen04dead12013-11-13 02:12:48 +0100298
Jan-Marek Glogowski70e4c652021-05-20 15:51:21 +0200299cross-toolset: bootstrap fetch install-gdb-printers
Tor Lillqvist66559392019-09-20 16:45:46 +0300300# fetch again in case there are externals only needed on build platform
Michael Stahla626bdd2018-10-31 19:06:30 +0100301ifneq ($(OS),iOS)
Christian Lohmaier372f2972017-05-28 14:25:54 +0200302 $(MAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(BUILDDIR)/Makefile fetch
jan Iversena3f66d22017-05-24 07:38:58 +0200303endif
Jan-Marek Glogowski63972e72020-07-17 22:14:39 +0200304 $(MAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100305
Stephan Bergmann937df582017-09-07 17:01:43 +0200306install-gdb-printers:
Michael Stahla626bdd2018-10-31 19:06:30 +0100307ifneq ($(filter-out WNT MACOSX iOS,$(OS)),)
Jan-Marek Glogowski70e4c652021-05-20 15:51:21 +0200308ifneq ($(INSTDIR_FOR_BUILD),$(INSTDIR))
309 mkdir -p $(INSTDIR_FOR_BUILD)
310 $(SRCDIR)/solenv/bin/install-gdb-printers -a $(INSTDIR_FOR_BUILD) -c
311endif
Stephan Bergmann937df582017-09-07 17:01:43 +0200312 mkdir -p $(INSTDIR)
313 $(SRCDIR)/solenv/bin/install-gdb-printers -a $(INSTDIR) -c
314endif
315
Tor Lillqvist18041132013-08-16 11:06:51 +0300316
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100317#
318# Install
319#
320
Bjoern Michaelsenac32aaf2013-11-20 19:36:03 +0100321define gb_Top_DoInstall
322echo "$(1) in $(INSTALLDIR) ..." && \
Stephan Bergmannb02fe062014-11-21 11:45:16 +0100323$(SRCDIR)/solenv/bin/ooinstall $(2) "$(INSTALLDIR)"
Bjoern Michaelsenac32aaf2013-11-20 19:36:03 +0100324
325endef
326
327ifneq ($(OS),MACOSX)
328define gb_Top_InstallFinished
329echo && echo "If you want to edit the .ui files with glade first execute:" && \
330echo && echo "export GLADE_CATALOG_SEARCH_PATH=$(2)/share/glade" && \
331echo && echo "$(1) finished, you can now execute:" && \
332echo "$(2)/program/soffice"
333
334endef
335else
336define gb_Top_InstallFinished
337echo && echo "$(1) finished, you can now run: " && \
338echo "open $(2)/$(PRODUCTNAME).app" && \
339echo "" && \
340echo "To debug: gdb $(2)/$(PRODUCTNAME).app/Contents/MacOS/soffice"
341
342endef
343endif
344
345ifneq ($(OS),MACOSX)
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100346install:
Bjoern Michaelsenac32aaf2013-11-20 19:36:03 +0100347 @$(call gb_Top_DoInstall,Installing,)
348 @$(call gb_Top_InstallFinished,Installation,$(INSTALLDIR))
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100349
350install-strip:
Bjoern Michaelsenac32aaf2013-11-20 19:36:03 +0100351 @$(call gb_Top_DoInstall,Installing and stripping binaries,--strip)
352 @$(call gb_Top_InstallFinished,Installation,$(INSTALLDIR))
Tor Lillqvist18041132013-08-16 11:06:51 +0300353endif # !MACOSX
354
Michael Stahlbe592882013-10-01 15:08:15 +0200355test-install: build
Michael Stahlf1d08892013-10-01 15:30:08 +0200356 @rm -rf $(TESTINSTALLDIR)
Michael Stahlb81f49c2013-10-01 17:39:52 +0200357 @mkdir -p $(TESTINSTALLDIR)
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100358ifeq ($(OS_FOR_BUILD),WNT)
Luboš Luňákf8062812014-03-23 17:46:23 +0100359 cd $(SRCDIR)/instsetoo_native && $(MAKE) LIBO_TEST_INSTALL=TRUE $(GMAKE_OPTIONS)
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100360else
Stephan Bergmannb02fe062014-11-21 11:45:16 +0100361 @$(SRCDIR)/solenv/bin/ooinstall $(TESTINSTALLDIR)
Miklos Vajnac5c99652021-08-02 21:02:15 +0200362ifeq ($(OS),MACOSX)
Andras Timar6e9a41d2015-05-11 22:26:29 +0200363#
Bartosz Kosiorek9c0d40f2018-11-27 11:40:49 +0100364# Create Resources/*.lproj directories for languages supported by macOS
Andras Timar6e9a41d2015-05-11 22:26:29 +0200365 set -x; for lang in ca cs da de el en es fi fr hr hu id it ja ko ms nl no pl pt pt_PT ro ru sk sv th tr uk vi zh_CN zh_TW; do \
Tor Lillqvistb640a132016-08-04 09:17:20 +0300366 lproj=$(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Resources/$$lang.lproj; \
367 mkdir "$$lproj"; \
Tor Lillqvistebdb1b82014-09-19 12:47:02 +0300368 done
Andras Timar6e9a41d2015-05-11 22:26:29 +0200369#
Tor Lillqvist8ba6e0d2014-09-20 01:01:09 +0300370# Remove unnecessary executables in the LibreOfficePython framework
Tor Lillqvistb640a132016-08-04 09:17:20 +0300371 rm -rf $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/bin
Tor Lillqvist8ba6e0d2014-09-20 01:01:09 +0300372#
373# Remove the python.o object file which is weird and interferes with app store uploading
374# And with it removed, presumably the other stuff in the Python lib/python3.3/config-3.3m probably does not make sense either.
Tor Lillqvistb640a132016-08-04 09:17:20 +0300375 rm -rf $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/Frameworks/LibreOfficePython.framework/Versions/[1-9]*/lib/python[1-9]*/config-[1-9]*
Tor Lillqvist8ba6e0d2014-09-20 01:01:09 +0300376#
Stephan Bergmannd4e4c852017-05-10 15:21:02 +0200377ifneq ($(ENABLE_MACOSX_SANDBOX),)
Tor Lillqvist404f9f52017-11-14 18:54:27 +0200378
379# Remove the gengal binary that we hardly need and the shell scripts
380# for which code signatures (stored as extended attributes) won't
Andrea Gelminideea8e0d2017-11-15 15:26:16 +0100381# survive upload to the App Store anyway. See
Tor Lillqvist404f9f52017-11-14 18:54:27 +0200382# https://developer.apple.com/library/content/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-TNTAG201
383# We could put the shell scripts somewhere in Resources instead, but
384# no 3rd-party code that would be interested in them would look there
385# anyway.
Tor Lillqvistb640a132016-08-04 09:17:20 +0300386 rm $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/MacOS/gengal
387 rm $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/MacOS/unopkg
Tor Lillqvisted89b432017-11-14 17:13:48 +0200388 rm $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/MacOS/unoinfo
Tor Lillqvist8ba6e0d2014-09-20 01:01:09 +0300389endif
Christian Lohmaierb43f0b02022-06-29 13:35:01 +0200390ifneq ($(MACOSX_PROVISIONING_PROFILE),)
391 cp "$(MACOSX_PROVISIONING_PROFILE)" $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app/Contents/embedded.provisionprofile
392endif
Tor Lillqvistaf70b5b2020-11-19 22:04:21 +0200393ifneq ($(MACOSX_CODESIGNING_IDENTITY),)
Tor Lillqvist8ba6e0d2014-09-20 01:01:09 +0300394# Then use the macosx-codesign-app-bundle script
Tor Lillqvistb640a132016-08-04 09:17:20 +0300395 @$(SRCDIR)/solenv/bin/macosx-codesign-app-bundle $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app
Tor Lillqvist2b71c1a2013-01-31 23:22:35 +0200396endif
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100397endif
Miklos Vajnac5c99652021-08-02 21:02:15 +0200398endif
Bjoern Michaelsenac32aaf2013-11-20 19:36:03 +0100399 @$(call gb_Top_InstallFinished,Test Installation,$(TESTINSTALLDIR))
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100400
Christian Lohmaierd5c11dd2022-10-20 13:15:32 +0200401# target to bypass the packaging steps/to only assemble the package
402mac-app-store-package.prepare: $(BUILDDIR)/$(PLATFORMID)/done
403
404# shorthand target to build a complete package for the currently building architecture
405mac-app-store-package: mac-app-store-package.$(PLATFORMID)
406
407# recipe/targets to do the actual packaging
Andrea Gelmini8507f632022-10-24 09:48:39 +0200408# the symbolication switch to productbuild unfortunately is undocumented, but that is what XCode
Christian Lohmaierd5c11dd2022-10-20 13:15:32 +0200409# uses when it creates a package with symbols for uploading to the appstore
410mac-app-store-package.$(PLATFORMID) mac-app-store-package.universal: mac-app-store-package.%: $(BUILDDIR)/%/done
Tor Lillqvist8ff6bfb2014-06-06 18:51:48 +0300411ifneq ($(MACOSX_PACKAGE_SIGNING_IDENTITY),)
Christian Lohmaierd5c11dd2022-10-20 13:15:32 +0200412 $(SRCDIR)/solenv/bin/macosx-codesign-app-bundle $*/"$(PRODUCTNAME)".app
413 productbuild $(if $(ENABLE_SYMBOLS_FOR),--symbolication $*/Symbols) --component $*/"$(PRODUCTNAME)".app /Applications --sign $(MACOSX_PACKAGE_SIGNING_IDENTITY) $(PRODUCTNAME_WITHOUT_SPACES).pkg
Tor Lillqvist8ff6bfb2014-06-06 18:51:48 +0300414else
415 @echo You did not provide an installer signing identity with --enable-macosx-package-signing
416 @exit 1
417endif
418
Andrea Gelmini0b665c52022-10-24 09:49:01 +0200419# the builds need to persist a standard "make clean" to be able to combine them into a universal
Christian Lohmaierd5c11dd2022-10-20 13:15:32 +0200420# binary, so provide an additional target that can be used standalone or via make distclean
421mac-app-store-package.clean:
422 rm -rf \
423 $(BUILDDIR)/macosx_x86_64 \
424 $(BUILDDIR)/macosx_aarch64 \
425 $(BUILDDIR)/universal \
426 $(BUILDDIR)/$(PRODUCTNAME_WITHOUT_SPACES).pkg
427
428# used by the mac-app-store targets
429$(BUILDDIR)/$(PLATFORMID)/done: test-install
430 rm -rf $(PLATFORMID)
431 mkdir -p $(PLATFORMID)/Symbols
432 mv $(TESTINSTALLDIR)/$(PRODUCTNAME_WITHOUT_SPACES).app $(PLATFORMID)/"$(PRODUCTNAME)".app
433ifneq ($(ENABLE_SYMBOLS_FOR),)
434 symbols -arch all -symbolsPackageDir $(PLATFORMID)/Symbols $(PLATFORMID)/"$(PRODUCTNAME)".app/Contents/Frameworks/[^L]* $(PLATFORMID)/"$(PRODUCTNAME)".app/Contents/MacOS/*
435 strip -S $(PLATFORMID)/"$(PRODUCTNAME)".app/Contents/Frameworks/[^L]* $(PLATFORMID)/"$(PRODUCTNAME)".app/Contents/MacOS/*
436endif
437 touch $@
438
439# build one arch using the mac-app-store-package.prepare target, make clean and change the autogen.input
Andrea Gelmini8507f632022-10-24 09:48:39 +0200440# to build for the other target, then use mac-app-store-package.universal to build for the other arch and
Christian Lohmaierd5c11dd2022-10-20 13:15:32 +0200441# combine the two into a universal binary
442$(BUILDDIR)/universal/done: $(BUILDDIR)/macosx_x86_64/done $(BUILDDIR)/macosx_aarch64/done
443 rm -rf universal
444 mkdir -p universal/Symbols
445ifneq ($(ENABLE_SYMBOLS_FOR),)
446 cp -a macosx_x86_64/Symbols/* macosx_aarch64/Symbols/* universal/Symbols/
447endif
448 $(SRCDIR)/bin/merge-app-bundles macosx_x86_64/"$(PRODUCTNAME)".app macosx_aarch64/"$(PRODUCTNAME)".app universal/"$(PRODUCTNAME)".app
449 touch $@
450
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100451distro-pack-install: install
Stephan Bergmann0ba869f2018-01-08 10:40:32 +0100452 $(SRCDIR)/bin/distro-install-clean-up
453 $(SRCDIR)/bin/distro-install-desktop-integration
454 $(SRCDIR)/bin/distro-install-sdk
455 $(SRCDIR)/bin/distro-install-file-lists
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100456
Bjoern Michaelsenc6fe5c62013-12-08 03:39:37 +0100457install-package-%:
Luboš Luňákf8062812014-03-23 17:46:23 +0100458 $(MAKE) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
Bjoern Michaelsenc6fe5c62013-12-08 03:39:37 +0100459
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100460id:
Stephan Bergmannb02fe062014-11-21 11:45:16 +0100461 @$(SRCDIR)/solenv/bin/create-ids
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100462
463tags:
Stephan Bergmannb02fe062014-11-21 11:45:16 +0100464 @$(SRCDIR)/solenv/bin/create-tags
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100465
Takeshi Abe775d99c2014-11-07 21:14:50 +0900466etags:
Stephan Bergmannb02fe062014-11-21 11:45:16 +0100467 @$(SRCDIR)/solenv/bin/create-tags -e
Takeshi Abe775d99c2014-11-07 21:14:50 +0900468
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100469docs:
Stephan Bergmannb02fe062014-11-21 11:45:16 +0100470 @$(SRCDIR)/solenv/bin/mkdocs.sh $(SRCDIR)/docs $(SRCDIR)/solenv/inc/doxygen.cfg
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100471
Bjoern Michaelsene4fbcc52013-10-15 10:18:29 +0200472findunusedheaders:
Arkadiy Illarionov63a7df32017-06-10 22:24:32 +0300473 $(SRCDIR)/bin/find-unusedheaders.py
Bjoern Michaelsene4fbcc52013-10-15 10:18:29 +0200474
Markus Mohrhardc7c86b42016-05-23 22:57:56 +0200475symbols:
Markus Mohrhardbe1dcb52016-05-24 00:33:10 +0200476 rm -fr $(WORKDIR)/symbols/
Markus Mohrhardc7c86b42016-05-23 22:57:56 +0200477 mkdir -p $(WORKDIR)/symbols/
Markus Mohrharddaa721d2016-05-24 09:12:41 +0200478ifeq ($(OS),WNT)
Christian Lohmaier960b2872021-06-17 14:46:03 +0200479 $(SRCDIR)/bin/symbolstore.py $(WORKDIR)/UnpackedTarball/breakpad/src/tools/windows/dump_syms/Release/dump_syms.exe $(WORKDIR)/symbols/ $(INSTDIR)/program/
Thorsten Behrens17e9a5bf2017-01-15 11:50:27 +0100480 $(SRCDIR)/bin/symstore.sh
Markus Mohrharddaa721d2016-05-24 09:12:41 +0200481else
Markus Mohrhardc7c86b42016-05-23 22:57:56 +0200482 $(SRCDIR)/bin/symbolstore.py $(WORKDIR)/UnpackedTarball/breakpad/src/tools/linux/dump_syms/dump_syms $(WORKDIR)/symbols/ $(INSTDIR)/program/*
Markus Mohrharddaa721d2016-05-24 09:12:41 +0200483endif
484
Markus Mohrhardb862ad842016-05-24 00:33:32 +0200485 cd $(WORKDIR)/symbols/ && zip -r $(WORKDIR)/symbols.zip *
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100486
Markus Mohrharded267692016-08-19 14:34:46 +0200487create-mar:
488 rm -fr $(WORKDIR)/installation/mar/
489 rm -fr $(WORKDIR)/installation/temp/
490 mkdir -p $(WORKDIR)/installation/temp/
491 mkdir -p $(WORKDIR)/installation/mar/
492 tar -xzf $(WORKDIR)/installation/LibreOfficeDev/archive/install/en-US/LibreOffice* -C $(WORKDIR)/installation/temp/
493 $(SRCDIR)/bin/update/make_full_update.sh $(WORKDIR)/installation/mar/test.mar $(WORKDIR)/installation/temp/*/
494
Markus Mohrhard1e4e5032016-05-24 04:27:18 +0200495upload-symbols:
496 $(MAKE) -f $(SRCDIR)/Makefile.gbuild upload-symbols
497
Markus Mohrhard27e63fa2016-08-28 02:23:37 +0200498create-update-info:
499 $(MAKE) -f $(SRCDIR)/Makefile.gbuild create-update-info
500
Markus Mohrhard8baabac2016-11-28 01:04:17 +0100501upload-update-info:
502 $(MAKE) -f $(SRCDIR)/Makefile.gbuild upload-update-info
503
Markus Mohrhardeb317fa2017-04-26 02:43:25 +0200504create-partial-info:
505 $(MAKE) -f $(SRCDIR)/Makefile.gbuild create-partial-info
506
Michael Meeksd614ca72013-03-04 18:01:19 +0000507dump-deps:
Jan-Marek Glogowskif7da3a42021-12-13 12:05:33 +0100508 @$(SRCDIR)/bin/module-deps.pl $(if $(verbose),-v) $(MAKE) $(SRCDIR)/Makefile.gbuild
Michael Meeksd614ca72013-03-04 18:01:19 +0000509
David Ostrovsky0670c3f2013-03-09 16:08:47 +0100510dump-deps-png:
Jan-Marek Glogowskif7da3a42021-12-13 12:05:33 +0100511 @$(SRCDIR)/bin/module-deps.pl $(if $(verbose),-v) $(MAKE) $(SRCDIR)/Makefile.gbuild | dot -Tpng -o lo.png
David Ostrovsky0670c3f2013-03-09 16:08:47 +0100512
Stephan Bergmanna19440b2014-02-17 18:03:44 +0100513dump-deps-sort:
Jan-Marek Glogowskif7da3a42021-12-13 12:05:33 +0100514 @$(SRCDIR)/bin/module-deps.pl -t $(if $(verbose),-v) $(MAKE) $(SRCDIR)/Makefile.gbuild
Stephan Bergmanna19440b2014-02-17 18:03:44 +0100515
Miklos Vajna13de7522017-11-20 09:04:51 +0100516clang-format-check:
517 @$(SRCDIR)/solenv/clang-format/check-last-commit
518
Bjoern Michaelsen60c64b42013-11-20 19:21:34 +0100519define gb_Top_GbuildToIdeIntegration
xuenhua37613bf2022-04-23 17:45:28 +0800520$(1)-ide-integration: gbuildtojson $(if $(filter MACOSX,$(OS_FOR_BUILD)),python3.allbuild)
Michael Stahl646b8b62016-12-15 14:11:05 +0100521 cd $(SRCDIR) && \
522 $(if $(filter MACOSX,$(OS_FOR_BUILD)),PATH="$(INSTROOT_FOR_BUILD)/Frameworks/LibreOfficePython.framework/Versions/Current/bin:$(PATH)") \
Mike Kaganski18742c22022-02-14 19:19:41 +0100523 bin/gbuild-to-ide --ide $(1) --make $(MAKE)
Bjoern Michaelsenba99e292013-11-15 18:39:46 +0100524
525endef
526
jan Iversen87363912017-01-30 17:29:08 +0100527$(foreach ide,\
528 codelite \
Mike Kaganski27d1cc62021-10-08 09:56:51 +0200529 vs \
jan Iversen87363912017-01-30 17:29:08 +0100530 kdevelop \
Markus Mohrhard071c09d2014-08-07 22:11:50 +0200531 vim \
Gulsah Kosebc7a4902015-11-27 20:28:10 +0200532 qtcreator \
jan Iversen5568df92017-11-18 16:33:08 +0100533 xcode \
534 eclipsecdt,\
jan Iversenceb10d52017-11-18 16:07:12 +0100535$(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
Bjoern Michaelsenba99e292013-11-15 18:39:46 +0100536
Christian Lohmaier8d7e2662021-12-15 14:21:36 +0100537# vscode integration is based on compile_commands.json, which is generated by vim-ide-integration
538# the workspace template created by configure doesn't provide advanced/fine grained targets but
539# rather supplies some useful settings and basic examples for run/debug configurations
540# this target is provided primarily for consistency with the other ide-integrations
541vscode-ide-integration: $(BUILDDIR)/vs-code.code-workspace vim-ide-integration
542
Andrea Gelmini5e4af7b2022-10-15 09:42:52 +0200543# ToDo: there probably is a way to have it at least create the compile-commands.json file
Christian Lohmaierc461e9d2022-10-12 11:25:35 +0200544# for the vim/vs-code integration without building the registry stuff
545gbuildtojson: Rdb
546
Christian Lohmaier8d7e2662021-12-15 14:21:36 +0100547$(BUILDDIR)/vs-code.code-workspace: $(BUILDDIR)/vs-code.code-workspace.template
548 @test -e $@ || cp $< $@ && \
549 cmp -s $@ $< || echo "ATTN: $(@F) differs from $(<F), please check yourself for changes"
550
Matúš Kukan0e6212c2012-12-23 19:27:28 +0100551endif # MAKE_RESTARTS
552
553# vim: set noet sw=4 ts=4: