summaryrefslogtreecommitdiff
path: root/solenv/gbuild/extensions/post_GbuildToJson.mk
blob: 7f05392e11797703c2fd006bbe81acb0a51b48e7 (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
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#


# Outstanding work:
#
# fill files names in:
#   --ASMOBJECTS
#   --GENCOBJECTS
#   --YACCOBJECTS
#   --LEXOBJECTS
#   --JAVAOBJECTS
#   --PYTHONOBJECTS
#
# Add black listed modules a json files (--BLACKLIST)
#
# Reduce number of blacklisted modules

ifneq ($(filter gbuildtojson,$(MAKECMDGOALS)),)

ifeq ($(MAKE_VERSION),3.81)
$(error make version 3.81 not supported for gbuildtojson; install newer make via LODE)
endif

# possibly recurse to ensure gbuildtojson was build before running the modded make
gb_GbuildToJson_prep := $(shell $(MAKE) -f $(SRCDIR)/solenv/Makefile Executable_gbuildtojson)
gb_FULLDEPS:=

gbuildtojson:
	@true


gb_GbuildToJson_PHONY := $(WORKDIR)/GBUILDTOJSONPHONY
.PHONY : $(gb_GbuildToJson_PHONY)
$(gb_GbuildToJson_PHONY):
	@true



define gb_LinkTarget__command
mkdir -p $(WORKDIR)/GbuildToJson/$(dir $(2))
mkdir -p $(WORKDIR)/LinkTarget/$(dir $(2))
$(if $(GBUILDTOJSON_LD_LIBRARY_PATH),LD_LIBRARY_PATH=$(GBUILDTOJSON_LD_LIBRARY_PATH)) \
$(call gb_Executable_get_command,gbuildtojson) \
--makefile=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_MAKEFILE)) \
--linktarget=$(call var2file,$(shell $(gb_MKTEMP)),100,$(2)) \
--ilibtarget=$(call var2file,$(shell $(gb_MKTEMP)),100,$(ILIBTARGET)) \
--cxxobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(CXXOBJECTS)) \
--yaccobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(YACCOBJECTS)) \
--objcobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(OBJCOBJECTS)) \
--objcxxobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(OBJCXXOBJECTS)) \
--cxxclrobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(CXXCLROBJECTS)) \
--asmobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(ASMOBJECTS)) \
--lexobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(LEXOBJECTS)) \
--gencobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(GENCOBJECTS)) \
--gencxxobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(GENCXXOBJECTS)) \
--gencxxclrobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(GENCXXCLROBJECTS)) \
--cobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(COBJECTS)) \
--javaobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(JAVAOBJECTS)) \
--pythonobjects=$(call var2file,$(shell $(gb_MKTEMP)),100,$(PYTHONOBJECTS)) \
--cflags=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CFLAGS)) \
--cflagsappend=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CFLAGS_APPEND)) \
--cxxflags=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXFLAGS)) \
--cxxflagsappend=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXFLAGS_APPEND)) \
--objcflags=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCFLAGS)) \
--objcflagsappend=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCFLAGS_APPEND)) \
--objcxxflags=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCXXFLAGS)) \
--objcxxflagsappend=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_OBJCXXFLAGS_APPEND)) \
--cxxclrflags=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXCLRFLAGS)) \
--cxxclrflagsappend=$(call var2file,$(shell $(gb_MKTEMP)),100,$(T_CXXCLRFLAGS_APPEND)) \
--defs=$(call var2file,$(shell $(gb_MKTEMP)),100,$(DEFS)) \
--include=$(call var2file,$(shell $(gb_MKTEMP)),100,$(INCLUDE)) \
--linked_libs=$(call var2file,$(shell $(gb_MKTEMP)),100,$(LINKED_LIBS)) \
--linked_static_libs=$(call var2file,$(shell $(gb_MKTEMP)),100,$(LINKED_STATIC_LIBS)) \
> $(WORKDIR)/GbuildToJson/$(2)
endef

define gb_Postprocess_register_target
gbuildtojson : $(call gb_LinkTarget_get_target,$(call gb_$(2)_get_linktarget,$(3)))

$(call gb_LinkTarget_get_target,$(call gb_$(2)_get_linktarget,$(3))): $(gb_Helper_MISCDUMMY) $(gb_GbuildToJson_PHONY)
$(call gb_LinkTarget_get_target,$(call gb_$(2)_get_linktarget,$(3))): T_MAKEFILE := $(lastword $(MAKEFILE_LIST))
endef

define gb_CppunitTest_register_target
gbuildtojson : $(call gb_LinkTarget_get_target,$(2))

$(call gb_LinkTarget_get_target,$(2)): $(gb_Helper_MISCDUMMY) $(gb_GbuildToJson_PHONY)
$(call gb_LinkTarget_get_target,$(2)): T_MAKEFILE := $(lastword $(MAKEFILE_LIST))
endef

gb_LinkTarget_use_static_libraries =
gb_UnoApiHeadersTarget_get_target = $(gb_Helper_MISCDUMMY)
gb_UnpackedTarball_get_final_target = $(gb_Helper_MISCDUMMY)
gb_LinkTarget__get_headers_check =
define gb_LinkTarget_add_cobject
$(call gb_LinkTarget_get_target,$(1)) : COBJECTS += $(2)

endef
define gb_LinkTarget_add_cxxobject_internal
$(call gb_LinkTarget_get_target,$(1)) : CXXOBJECTS += $(2)

endef
define gb_LinkTarget_add_generated_c_object
$(call gb_LinkTarget_get_target,$(1)) : GENCOBJECTS += $(2)

endef
define gb_LinkTarget_add_generated_cxx_object_internal
$(call gb_LinkTarget_get_target,$(1)) : GENCXXOBJECTS += $(2)

endef
define gb_LinkTarget_add_generated_cxxclrobject
$(call gb_LinkTarget_get_target,$(1)) : GENCXXCLROBJECTS += $(2)

endef
define gb_LinkTarget_add_objcobject
$(call gb_LinkTarget_get_target,$(1)) : OBJCOBJECTS += $(2)

endef
define gb_LinkTarget_add_objcxxobject
$(call gb_LinkTarget_get_target,$(1)) : OBJCXXOBJECTS += $(2)

endef
define gb_LinkTarget_add_cxxclrobject
$(call gb_LinkTarget_get_target,$(1)) : CXXCLROBJECTS += $(2)

endef
define gb_LinkTarget_add_scanners
$(call gb_LinkTarget_get_target,$(1)) : LEXOBJECTS += $(2)

endef
define gb_LinkTarget_add_grammars
$(call gb_LinkTarget_get_target,$(1)) : YACCOBJECTS += $(2)

endef
gb_LinkTarget_use_package =
gb_LinkTarget_use_generated_package =
gb_LinkTarget_add_sdi_headers =
gb_LinkTarget_use_external_project =
gb_LinkTarget__check_srcdir_paths =
gb_LinkTarget__command_objectlist = @true
gb_WinResTarget_WinResTarget_init =
gb_WinResTarget_set_rcfile =
gb_WinResTarget_add_defs =
gb_LinkTarget_set_nativeres =
gb_LinkTarget_add_nativeres =
gb_Library_set_componentfile =

#$(call gb_Library_get_exports_target,%):
$(WORKDIR)/LinkTarget/Library/%.exports:
	@true

define gb_LinkTarget__use_custom_headers
$(call gb_LinkTarget__add_include,$(1),$(call gb_CustomTarget_get_workdir,$(2)))

endef


define gb_Module__add_target_impl
$(call gb_Module__read_targetfile,$(1),$(2),target)

$(call gb_Module_get_nonl10n_target,$(1)) : $(3)

endef

define gb_Module__add_check_target_impl
$(call gb_Module__read_targetfile,$(1),$(2),check target)

$(call gb_Module_get_check_target,$(1)) : $(3)

endef

define gb_Module_add_target
$(if $(filter Library_% Executable_%,$(2)),$(call gb_Module__add_target_impl,$(1),$(2),$$(gb_Module_CURRENTTARGET)))
endef

define gb_Module_add_check_target
$(if $(filter CppunitTest_% Library_%,$(2)),$(call gb_Module__add_check_target_impl,$(1),$(2),$$(gb_Module_CURRENTTARGET)))
endef

gb_Module_add_l10n_target =

gb_GbuildToJson_BLACKLISTEDMODULES := cli_ure jurt external

define gb_Module__add_moduledir_impl
include $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Module_MODULELOCATIONS)))/$(2)/Module_$(notdir $(2)).mk
$(call gb_Module_get_target,$(1)) : $$(firstword $$(gb_Module_TARGETSTACK))
gb_Module_TARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_TARGETSTACK)),$$(gb_Module_TARGETSTACK))

endef

define gb_Module_add_moduledir
$(if $(filter $(gb_GbuildToJson_BLACKLISTEDMODULES),$(2)),,$(call gb_Module__add_moduledir_impl,$(1),$(2)))

endef

endif

# vim: set noet ts=4 sw=4: