[295] | 1 | ## @file |
---|
| 2 | # Global Project Configuration File |
---|
| 3 | # |
---|
| 4 | |
---|
[304] | 5 | #------------------------------------------------------------------------------ |
---|
[308] | 6 | # Global definitions |
---|
| 7 | #------------------------------------------------------------------------------ |
---|
| 8 | |
---|
| 9 | # |
---|
[438] | 10 | # Lucide version string. |
---|
[308] | 11 | # |
---|
[438] | 12 | # This always has a format of X.Y.Z where each letter is a positive decimal |
---|
| 13 | # number representing the major version, minor version and revision accordingly. |
---|
| 14 | # |
---|
[519] | 15 | VERSION = 1.3.6 |
---|
[438] | 16 | |
---|
| 17 | # |
---|
| 18 | # Lucide build string. |
---|
| 19 | # |
---|
| 20 | # This is usually "beta" for the development phase and "GA" for the releases. |
---|
| 21 | # See also GENERATING DISTRIBUTION ARCHIVES in README.DEV for more information. |
---|
| 22 | # |
---|
[519] | 23 | BUILD = beta |
---|
[438] | 24 | |
---|
[433] | 25 | # |
---|
[438] | 26 | # Lucide build number for the WPI archive. |
---|
| 27 | # |
---|
| 28 | # By agreement, this number is 0 for "beta" builds and 1 for "GA" builds. |
---|
| 29 | # |
---|
[519] | 30 | WPIBUILD = 0 |
---|
[308] | 31 | |
---|
[433] | 32 | # |
---|
[438] | 33 | # Lucide version date in the format YYYY-MM-DD. |
---|
[433] | 34 | # |
---|
[519] | 35 | VERSIONDATE = 2012-xx-xx |
---|
[386] | 36 | |
---|
[308] | 37 | #------------------------------------------------------------------------------ |
---|
[312] | 38 | # Common libraries referenced by components |
---|
| 39 | #------------------------------------------------------------------------------ |
---|
| 40 | |
---|
| 41 | # |
---|
| 42 | # poppler |
---|
| 43 | # |
---|
[520] | 44 | #LIB_POPPLER_LIBS = $(patsubst %,$(PATH_STAGE_LIB)/%$(SUFF_LIB), \ |
---|
| 45 | # fofi goo poppler splash fontconfig freetype2 jpeg) |
---|
[312] | 46 | |
---|
| 47 | #------------------------------------------------------------------------------ |
---|
[304] | 48 | # General Stuff |
---|
| 49 | #------------------------------------------------------------------------------ |
---|
| 50 | |
---|
[295] | 51 | # |
---|
[304] | 52 | # Lucide C Compiler template |
---|
[295] | 53 | # |
---|
[304] | 54 | TEMPLATE_LucideC = Lucide C Compiler |
---|
| 55 | TEMPLATE_LucideC_TOOL = GCC3OMF |
---|
| 56 | TEMPLATE_LucideC_CFLAGS = |
---|
| 57 | TEMPLATE_LucideC_DEFS = OS2 |
---|
[468] | 58 | TEMPLATE_LucideC_INCS = $(PATH_LIB_CURL_INCS) |
---|
| 59 | TEMPLATE_LucideC_LIBPATH = $(PATH_LIB_CURL_LIBPATH) |
---|
[304] | 60 | |
---|
[295] | 61 | # |
---|
[304] | 62 | # Lucide C++ Compiler template |
---|
| 63 | # |
---|
| 64 | TEMPLATE_LucideCxx = Lucide C++ Compiler |
---|
| 65 | TEMPLATE_LucideCxx_TOOL = GXX3OMF |
---|
| 66 | TEMPLATE_LucideCxx_CXXFLAGS = |
---|
| 67 | TEMPLATE_LucideCxx_DEFS = OS2 |
---|
[468] | 68 | TEMPLATE_LucideCxx_INCS = $(PATH_LIB_CURL_INCS) |
---|
| 69 | TEMPLATE_LucideCxx_LIBPATH = $(PATH_LIB_CURL_LIBPATH) |
---|
[304] | 70 | |
---|
[361] | 71 | # |
---|
| 72 | # Lucide C PM application template |
---|
| 73 | # |
---|
| 74 | TEMPLATE_LucideC-PM = Lucide C PM application |
---|
| 75 | TEMPLATE_LucideC-PM_EXTENDS = LucideC |
---|
| 76 | TEMPLATE_LucideC-PM_EXTENDS_BY = appending |
---|
[524] | 77 | TEMPLATE_LucideC-PM_LDFLAGS.release = -Zlinker /PM:PM -Zno-fork |
---|
| 78 | TEMPLATE_LucideC-PM_LDFLAGS.debug = -Zlinker /PM:VIO |
---|
[361] | 79 | |
---|
| 80 | # |
---|
| 81 | # Lucide C++ PM application template |
---|
| 82 | # |
---|
| 83 | TEMPLATE_LucideCxx-PM = Lucide C++ PM application |
---|
| 84 | TEMPLATE_LucideCxx-PM_EXTENDS = LucideCxx |
---|
| 85 | TEMPLATE_LucideCxx-PM_EXTENDS_BY = appending |
---|
| 86 | TEMPLATE_LucideCxx-PM_LDFLAGS = $(TEMPLATE_LucideC-PM_LDFLAGS) |
---|
| 87 | |
---|
[304] | 88 | #------------------------------------------------------------------------------ |
---|
[308] | 89 | # GCC Stuff |
---|
| 90 | #------------------------------------------------------------------------------ |
---|
| 91 | |
---|
| 92 | # |
---|
| 93 | # Add RC support to GXX3OMF and GCC3OMF |
---|
| 94 | # (@todo create a new tool as extension to reuse the existing LINK commands) |
---|
| 95 | # |
---|
| 96 | |
---|
[520] | 97 | # 2016-03-10 SHL |
---|
| 98 | override TOOL_GXX3OMF_RC ?= rc$(HOSTSUFF_EXE) |
---|
[308] | 99 | TOOL_GXX3OMF_RCOBJSUFF ?= .res |
---|
| 100 | |
---|
[374] | 101 | TOOL_GXX3OMF_EXEPACK ?= lxlite /B- /L- /CS |
---|
[524] | 102 | TOOL_GXX3OMF_MAPSYM ?= runmapsym.cmd wmapsym.cmd |
---|
| 103 | TOOL_GXX3OMF_MAPXQS ?= mapxqs.exe $(outbase).map -o $(outbase).xqs |
---|
[308] | 104 | TOOL_GXX3OMF_COMPILE_RC_DEPEND = |
---|
| 105 | TOOL_GXX3OMF_COMPILE_RC_DEPORD = |
---|
| 106 | TOOL_GXX3OMF_COMPILE_RC_OUTPUT = |
---|
| 107 | TOOL_GXX3OMF_COMPILE_RC_OUTPUT_MAYBE = |
---|
[520] | 108 | # 2016-03-05 SHL |
---|
| 109 | override define TOOL_GXX3OMF_COMPILE_RC_CMDS |
---|
[312] | 110 | $(QUIET)cd $(subst /,\\,$(patsubst %/,%,$(dir $(source)))) && \ |
---|
[524] | 111 | $(TOOL_GXX3OMF_RC) -r \ |
---|
[312] | 112 | $(flags) \ |
---|
[335] | 113 | $(addprefix -i ,$(incs) $(subst ;, ,$(C_INCLUDE_PATH))) \ |
---|
| 114 | $(addprefix -D ,$(defs)) \ |
---|
[312] | 115 | $(source) $(obj) |
---|
[308] | 116 | endef |
---|
| 117 | |
---|
| 118 | override define TOOL_GXX3OMF_LINK_DLL_CMDS |
---|
[524] | 119 | $(QUIET)$(APPEND) $(outbase).rsp\ |
---|
[308] | 120 | $(TOOL_GXX3OMF_LDFLAGS.dll)\ |
---|
| 121 | $(flags)\ |
---|
| 122 | -o $(out)\ |
---|
| 123 | $(filter-out %.res,$(objs))\ |
---|
| 124 | $(foreach p,$(libpath), -L$(p))\ |
---|
| 125 | $(othersrc)\ |
---|
| 126 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
---|
| 127 | -Zmap=$(outbase).map |
---|
| 128 | $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp |
---|
| 129 | $(if $(filter %.res,$(objs)), \ |
---|
[312] | 130 | $(QUIET)$(TOOL_GXX3OMF_RC) $(filter %.res,$(objs)) $(out)) |
---|
[382] | 131 | $(if $(filter-out debug,$(BUILD_TYPE)), \ |
---|
| 132 | -$(QUIET)$(TOOL_GXX3OMF_EXEPACK) $(out)) |
---|
[524] | 133 | $(QUIET)$(TOOL_GXX3OMF_MAPSYM) $(outbase).map $(outbase).sym |
---|
| 134 | $(QUIET)$(TOOL_GXX3OMF_MAPXQS) |
---|
[308] | 135 | endef |
---|
| 136 | |
---|
| 137 | override define TOOL_GXX3OMF_LINK_PROGRAM_CMDS |
---|
[524] | 138 | $(QUIET)$(APPEND) $(outbase).rsp\ |
---|
[308] | 139 | $(flags)\ |
---|
| 140 | -o $(out)\ |
---|
| 141 | $(filter-out %.res,$(objs))\ |
---|
| 142 | $(foreach p,$(libpath), -L$(p))\ |
---|
| 143 | $(othersrc)\ |
---|
| 144 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
---|
| 145 | -Zmap=$(outbase).map |
---|
| 146 | $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp |
---|
| 147 | $(if $(filter %.res,$(objs)), \ |
---|
[312] | 148 | $(QUIET)$(TOOL_GXX3OMF_RC) $(filter %.res,$(objs)) $(out)) |
---|
[382] | 149 | $(if $(filter-out debug,$(BUILD_TYPE)), \ |
---|
| 150 | -$(QUIET)$(TOOL_GXX3OMF_EXEPACK) $(out)) |
---|
[524] | 151 | $(QUIET)$(TOOL_GXX3OMF_MAPSYM) $(outbase).map $(outbase).sym |
---|
| 152 | $(QUIET)$(TOOL_GXX3OMF_MAPXQS) |
---|
[308] | 153 | endef |
---|
| 154 | |
---|
[520] | 155 | # 2016-03-10 SHL |
---|
[524] | 156 | override TOOL_GCC3OMF_RC = $(TOOL_GXX3OMF_RC) |
---|
[308] | 157 | TOOL_GCC3OMF_RCOBJSUFF ?= $(TOOL_GXX3OMF_RCOBJSUFF) |
---|
| 158 | |
---|
[374] | 159 | TOOL_GCC3OMF_EXEPACK ?= $(TOOL_GXX3OMF_EXEPACK) |
---|
[524] | 160 | TOOL_GCC3OMF_MAPSYM ?= $(TOOL_GXX3OMF_MAPSYM) |
---|
| 161 | TOOL_GCC3OMF_MAPXQS ?= $(TOOL_GXX3OMF_MAPXQS) |
---|
[308] | 162 | TOOL_GCC3OMF_COMPILE_RC_DEPEND = $(TOOL_GXX3OMF_COMPILE_RC_DEPEND) |
---|
| 163 | TOOL_GCC3OMF_COMPILE_RC_DEPORD = $(TOOL_GXX3OMF_COMPILE_RC_DEPORD) |
---|
| 164 | TOOL_GCC3OMF_COMPILE_RC_OUTPUT = $(TOOL_GXX3OMF_COMPILE_RC_OUTPUT) |
---|
| 165 | TOOL_GCC3OMF_COMPILE_RC_OUTPUT_MAYBE = $(TOOL_GXX3OMF_COMPILE_RC_OUTPUT_MAYBE) |
---|
[520] | 166 | # 2016-03-10 SHL |
---|
| 167 | override TOOL_GCC3OMF_COMPILE_RC_CMDS = $(TOOL_GXX3OMF_COMPILE_RC_CMDS) |
---|
[308] | 168 | |
---|
| 169 | override define TOOL_GCC3OMF_LINK_DLL_CMDS |
---|
[524] | 170 | $(QUIET)$(APPEND) $(outbase).rsp\ |
---|
[308] | 171 | $(TOOL_GCC3OMF_LDFLAGS.dll)\ |
---|
| 172 | $(flags)\ |
---|
| 173 | -o $(out)\ |
---|
| 174 | $(filter-out %.res,$(objs))\ |
---|
| 175 | $(foreach p,$(libpath), -L$(p))\ |
---|
| 176 | $(othersrc)\ |
---|
| 177 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
---|
| 178 | -Zmap=$(outbase).map |
---|
| 179 | $(QUIET)$(TOOL_GCC3OMF_LD) @$(outbase).rsp |
---|
| 180 | $(if $(filter %.res,$(objs)), \ |
---|
[312] | 181 | $(QUIET)$(TOOL_GCC3OMF_RC) $(filter %.res,$(objs)) $(out)) |
---|
[382] | 182 | $(if $(filter-out debug,$(BUILD_TYPE)), \ |
---|
[524] | 183 | -$(QUIET)$(TOOL_GCC3OMF_EXEPACK) $(out)) |
---|
| 184 | $(QUIET)$(TOOL_GCC3OMF_MAPSYM) $(outbase).map $(outbase).sym |
---|
| 185 | $(QUIET)$(TOOL_GCC3OMF_MAPXQS) |
---|
[308] | 186 | endef |
---|
| 187 | |
---|
| 188 | override define TOOL_GCC3OMF_LINK_PROGRAM_CMDS |
---|
[524] | 189 | $(QUIET)$(APPEND) $(outbase).rsp\ |
---|
[308] | 190 | $(flags)\ |
---|
| 191 | -o $(out)\ |
---|
| 192 | $(filter-out %.res,$(objs))\ |
---|
| 193 | $(foreach p,$(libpath), -L$(p))\ |
---|
| 194 | $(othersrc)\ |
---|
| 195 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
---|
| 196 | -Zmap=$(outbase).map |
---|
| 197 | $(QUIET)$(TOOL_GCC3OMF_LD) @$(outbase).rsp |
---|
| 198 | $(if $(filter %.res,$(objs)), \ |
---|
[312] | 199 | $(QUIET)$(TOOL_GCC3OMF_RC) $(filter %.res,$(objs)) $(out)) |
---|
[382] | 200 | $(if $(filter-out debug,$(BUILD_TYPE)), \ |
---|
[524] | 201 | -$(QUIET)$(TOOL_GCC3OMF_EXEPACK) $(out)) |
---|
| 202 | $(QUIET)$(TOOL_GCC3OMF_MAPSYM) $(outbase).map $(outbase).sym |
---|
| 203 | $(QUIET)$(TOOL_GCC3OMF_MAPXQS) |
---|
[308] | 204 | endef |
---|
| 205 | |
---|
| 206 | #------------------------------------------------------------------------------ |
---|
[304] | 207 | # SOM Stuff |
---|
| 208 | #------------------------------------------------------------------------------ |
---|
| 209 | |
---|
[314] | 210 | # Paths: SOM SDK (defaults to the one from the OS/2 Toolkit installation) |
---|
| 211 | PATH_SDK_SOM ?= $(subst \,/,$(SOMBASE)) |
---|
[304] | 212 | ifeq ($(PATH_SDK_SOM),) |
---|
| 213 | $(error PATH_SDK_SOM is not set!) |
---|
| 214 | endif |
---|
| 215 | PATH_SDK_SOM_INCS ?= $(PATH_SDK_SOM)/include |
---|
| 216 | PATH_SDK_SOM_LIBPATH ?= $(PATH_SDK_SOM)/lib |
---|
| 217 | |
---|
| 218 | # Paths: SOM Tool |
---|
| 219 | PATH_TOOL_SOM_BIN ?= $(PATH_SDK_SOM)/bin |
---|
[314] | 220 | PATH_TOOL_SOM_DLL ?= $(PATH_SDK_SOM)/lib |
---|
| 221 | PATH_TOOL_SOM_MSG ?= $(PATH_SDK_SOM)/msg |
---|
| 222 | PATH_TOOL_SOM_INC ?= $(PATH_SDK_SOM)/include |
---|
[304] | 223 | |
---|
| 224 | # |
---|
| 225 | # SOM SDK |
---|
| 226 | # |
---|
| 227 | SDK_SOM := System Object Model Toolkit |
---|
| 228 | SDK_SOM_INCS ?= $(PATH_SDK_SOM_INCS) |
---|
| 229 | SDK_SOM_LIBPATH ?= $(PATH_SDK_SOM_LIBPATH) |
---|
| 230 | SDK_SOM_LIBS ?= somtk |
---|
| 231 | |
---|
| 232 | # |
---|
| 233 | # SOM Tool |
---|
| 234 | # |
---|
| 235 | # Notes: A valud value of the -s option must always be specified in IDLFLAGS; |
---|
| 236 | # the output of the first emitter is taken as the main output file and will be |
---|
| 237 | # sent to the compiler. All generated output go to $(dir $(outbase)) except the |
---|
| 238 | # output files ecplicitly listed in $(target)_IDLSOURCES which stay where they |
---|
| 239 | # are. |
---|
| 240 | # |
---|
| 241 | TOOL_SOM := System Object Model Tooklit |
---|
[314] | 242 | TOOL_SOM_IDL ?= $(PATH_TOOL_SOM_BIN)/sc$(HOSTSUFF_EXE) |
---|
[304] | 243 | TOOL_SOM_IDLFLAGS ?= |
---|
| 244 | TOOL_SOM_IDL_OUTPUT = $(addprefix $(outbase).,$(wordlist 2,1000,$(TOOL_SOM_IDL_EMITTERS))) |
---|
| 245 | TOOL_SOM_IDL_OUTPUT_MAYBE = |
---|
| 246 | TOOL_SOM_IDL_DEPEND = |
---|
| 247 | TOOL_SOM_IDL_DEPORD = |
---|
| 248 | # IDL-specific properties |
---|
| 249 | TOOL_SOM_IDL_OUT = $(outbase).$(if $(filter xc,$(firstword $(TOOL_SOM_IDL_EMITTERS))),cpp,$(firstword $(TOOL_SOM_IDL_EMITTERS))) |
---|
| 250 | # SOM-specific properties |
---|
| 251 | TOOL_SOM_IDL_EMITTERS = $(subst ;, ,$(patsubst -s"%",%,$(filter -s"%",$(flags)))) |
---|
| 252 | |
---|
| 253 | ## Compile an IDL file. |
---|
| 254 | # |
---|
| 255 | # @param $(target) Normalized main target name. |
---|
| 256 | # @param $(source) Source filename (relative). |
---|
| 257 | # @param $(out) Object file name. This shall be (re)created by the compilation. |
---|
| 258 | # @param $(dep) Dependcy file. This may be (re)created by the compilation. |
---|
| 259 | # @param $(flags) Flags. |
---|
| 260 | # @param $(defs) Definitions. |
---|
| 261 | # @param $(incs) Includes. |
---|
| 262 | # @param $(outbase) Output basename (full). Use this for list files and such. |
---|
| 263 | # |
---|
| 264 | define TOOL_SOM_IDL_CMDS |
---|
[314] | 265 | $(QUIET)$(REDIRECT) \ |
---|
| 266 | -E 'PATH=$(PATH_TOOL_SOM_BIN);$(PATH)' \ |
---|
| 267 | -E 'BEGINLIBPATH=$(PATH_TOOL_SOM_DLL);$(BEGINLIBPATH)' \ |
---|
| 268 | -E 'DPATH=$(PATH_TOOL_SOM_MSG);$(DPATH)' \ |
---|
| 269 | -E 'SMINCLUDE=$(PATH_TOOL_SOM_INC);$(INCLUDE)' \ |
---|
| 270 | -E 'INCLUDE=' \ |
---|
| 271 | -E 'LIB=' \ |
---|
| 272 | -- \ |
---|
| 273 | $(TOOL_SOM_IDL) $(flags) \ |
---|
[304] | 274 | $(addprefix -I, $(incs)) \ |
---|
| 275 | $(addprefix -D, $(defs)) \ |
---|
| 276 | -d $(dir $(outbase)) $(source) |
---|
| 277 | endef |
---|
| 278 | |
---|
| 279 | # |
---|
| 280 | # SOM Unit |
---|
| 281 | # |
---|
| 282 | |
---|
| 283 | # Add our target properties |
---|
| 284 | PROPS_TOOLS += IDLTOOL |
---|
| 285 | PROPS_SINGLE += IDLTOOL |
---|
| 286 | PROPS_ACCUMULATE_R += IDLFLAGS |
---|
| 287 | |
---|
| 288 | # Add ourselves to the default source handlers |
---|
| 289 | KBUILD_SRC_HANDLERS += \ |
---|
| 290 | .idl:def_src_handler_idl_idl |
---|
| 291 | |
---|
| 292 | # wrapper the compile command dependency check. |
---|
| 293 | ifndef NO_COMPILE_CMDS_DEPS |
---|
| 294 | _UNIT_SOM_IDL_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_SOM_IDL_CMDS_PREV_),$$(commands $(out)),FORCE) |
---|
| 295 | else |
---|
| 296 | _UNIT_SOM_IDL_CMDS_DEP = |
---|
| 297 | endif |
---|
| 298 | |
---|
| 299 | ## |
---|
| 300 | # Generates the rules for running IDL comiler on a specific source file. |
---|
| 301 | # |
---|
| 302 | # @param lots |
---|
| 303 | # |
---|
| 304 | define def_idl_rule |
---|
| 305 | |
---|
| 306 | $(out) + $(output) +| $(output_maybe) : \ |
---|
| 307 | $(deps) \ |
---|
| 308 | $(value _UNIT_SOM_IDL_CMDS_DEP) \ |
---|
| 309 | | \ |
---|
| 310 | $(orderdeps) |
---|
| 311 | %$$(call MSG_COMPILE,$(target),$(source),$$@,$(type)) |
---|
| 312 | $$(QUIET)$$(RM) -f -- $(dep) $(out) $(output) $(output_maybe) |
---|
| 313 | $(foreach f,$(out) $(output) $(output_maybe),\ |
---|
| 314 | $(if $(findstring $(notdir $f),$(notdir $($(target)_IDLSOURCES))),\ |
---|
[313] | 315 | $$(QUIET)$(CP) --ignore-non-existing \ |
---|
[493] | 316 | $(abspathex $(filter %$(notdir $f),$($(target)_IDLSOURCES)),$($(target)_DEFPATH)) \ |
---|
[313] | 317 | $f)) |
---|
[304] | 318 | |
---|
| 319 | $(cmds) |
---|
| 320 | |
---|
| 321 | $(foreach f,$(out) $(output) $(output_maybe),\ |
---|
| 322 | $(if $(findstring $(notdir $f),$(notdir $($(target)_IDLSOURCES))),\ |
---|
[313] | 323 | $$(QUIET)$(CP) --changed \ |
---|
| 324 | $f \ |
---|
[493] | 325 | $(abspathex $(filter %$(notdir $f),$($(target)_IDLSOURCES)),$($(target)_DEFPATH)))) |
---|
[304] | 326 | |
---|
| 327 | ifndef NO_COMPILE_CMDS_DEPS |
---|
| 328 | %$$(QUIET2)$$(APPEND) '$(dep)' |
---|
| 329 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_SOM_IDL_CMDS_PREV_' |
---|
| 330 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' |
---|
| 331 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' |
---|
| 332 | endif |
---|
| 333 | |
---|
| 334 | # if the generated file is listed in IDLSOURCES, add it to _GEN_SOURCES_ from |
---|
| 335 | # there (we did a copy trick for it), otherwise add it only of it's $(out) |
---|
| 336 | $(foreach f,$(out) $(output) $(output_maybe),\ |
---|
| 337 | $(if $(findstring $(notdir $f),$(notdir $($(target)_IDLSOURCES))),\ |
---|
| 338 | $(eval $(target)_GEN_SOURCES_ += $(filter %$(notdir $f),$($(target)_IDLSOURCES))),\ |
---|
| 339 | $(if $(findstring $f,$(out)),$(eval $(target)_GEN_SOURCES_ += $f)))) |
---|
| 340 | |
---|
| 341 | # update globals and target properties. |
---|
| 342 | _OUT_FILES += $(out) $(output) $(output_maybe) |
---|
| 343 | #$(target)_GEN_SOURCES_ += $(out) |
---|
| 344 | $(target)_INTERMEDIATES += $(intermediates) |
---|
| 345 | |
---|
| 346 | endef # def_idl_rule |
---|
| 347 | |
---|
| 348 | ## |
---|
| 349 | # Handler for .idl files listed in the SOURCES properties. |
---|
| 350 | # |
---|
| 351 | # .idl files are transformed into C/C++ header files and maybe to source files |
---|
| 352 | # compiled by the compiler. |
---|
| 353 | # |
---|
| 354 | # @param target The target file. |
---|
| 355 | # @param source The source file. |
---|
| 356 | # @param lots more |
---|
| 357 | # @returns quite a bit. |
---|
| 358 | # |
---|
| 359 | define def_src_handler_idl_idl |
---|
| 360 | |
---|
| 361 | local type := IDL |
---|
| 362 | |
---|
| 363 | # Figure out all the props. |
---|
| 364 | local tool := $(kb-src-tool dummy_var) |
---|
| 365 | ifeq ($(tool),) |
---|
| 366 | $(error kBuild: $(target) / $(sources) does not have IDLTOOL defined!) |
---|
| 367 | endif |
---|
| 368 | ifndef TOOL_$(tool)_IDL_CMDS |
---|
| 369 | $(error kBuild: TOOL_$(tool)_IDL_CMDS isn't defined! target=$(target) source=$(source)) |
---|
| 370 | endif |
---|
| 371 | local outbase := $(kb-obj-base outbase) |
---|
| 372 | local flags := $(kb-src-prop IDLFLAGS,dummy_var,left-to-right,) # rest depends on flags |
---|
| 373 | local out := $(TOOL_$(tool)_IDL_OUT) |
---|
| 374 | ifeq ($(out),) |
---|
| 375 | $(error kBuild: TOOL_$(tool)_IDL_OUT isn't defined! target=$(target) source=$(source)) |
---|
| 376 | endif |
---|
| 377 | local incs := $(kb-src-prop INCS,dummy_var,left-to-right,$(defpath)) |
---|
| 378 | local defs := $(kb-src-prop DEFS,dummy_var,left-to-right,) |
---|
| 379 | local deps := $(kb-src-prop DEPS,dummy_var,left-to-right,$(defpath)) |
---|
| 380 | local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right) |
---|
| 381 | |
---|
| 382 | # default path + source dep. |
---|
| 383 | ifneq ($(defpath),) |
---|
| 384 | local source := $(abspathex $(source),$(defpath)) |
---|
| 385 | endif |
---|
| 386 | local deps += $(source) |
---|
| 387 | |
---|
| 388 | # dependency file. |
---|
| 389 | local dep := $(out)$(SUFF_DEP) |
---|
| 390 | ifndef NO_COMPILE_CMDS_DEPS |
---|
| 391 | _DEPFILES_INCLUDED += $(dep) |
---|
| 392 | $(eval includedep $(dep)) |
---|
| 393 | endif |
---|
| 394 | |
---|
| 395 | # Call the tool. |
---|
| 396 | local cmds := $(TOOL_$(tool)_IDL_CMDS) |
---|
| 397 | local output := $(TOOL_$(tool)_IDL_OUTPUT) |
---|
| 398 | local output_maybe := $(TOOL_$(tool)_IDL_OUTPUT_MAYBE) |
---|
| 399 | local deps += $(TOOL_$(tool)_IDL_DEPEND) |
---|
| 400 | local orderdeps += $(TOOL_$(tool)_IDL_DEPORD) |
---|
| 401 | |
---|
| 402 | # Whether it generates a header file depends on flags. |
---|
| 403 | local intermediates := $(filter %.xh %.xih,$(output)) |
---|
| 404 | |
---|
| 405 | # Let the target include the generated files. |
---|
[322] | 406 | ifeq ($(filter $(patsubst %/,%,$(dir $(outbase))),$($(target)_INCS)),) |
---|
| 407 | $(target)_INCS += $(patsubst %/,%,$(dir $(outbase))) |
---|
| 408 | endif |
---|
[304] | 409 | |
---|
[322] | 410 | # Make sure the .idl directory is searched. |
---|
| 411 | ifeq ($(filter $(patsubst %/,%,$(dir $(source))),$($(target)_INCS)),) |
---|
| 412 | $(target)_INCS += $(patsubst %/,%,$(dir $(source))) |
---|
| 413 | endif |
---|
| 414 | |
---|
[304] | 415 | # Generate the rule. |
---|
| 416 | $(eval $(def_idl_rule)) |
---|
| 417 | |
---|
| 418 | endef # def_src_handler_idl_idl |
---|
| 419 | |
---|
| 420 | # |
---|
| 421 | # Lucide SOM class DLL template |
---|
| 422 | # |
---|
| 423 | TEMPLATE_SomDll = Lucide SOM class DLL |
---|
| 424 | TEMPLATE_SomDll_EXTENDS = LucideCxx |
---|
| 425 | TEMPLATE_SomDll_EXTENDS_BY = appending |
---|
| 426 | TEMPLATE_SomDll_CXXFLAGS = -Wno-write-strings # SOM compiler is loose here |
---|
| 427 | TEMPLATE_SomDll_DEFS = SOMLINK=_System |
---|
| 428 | TEMPLATE_SomDll_SDKS = SOM |
---|
| 429 | TEMPLATE_SomDll_IDLTOOL = SOM |
---|
| 430 | TEMPLATE_SomDll_IDLFLAGS = -c -s"xc;xh;xih" |
---|
| 431 | |
---|
| 432 | #------------------------------------------------------------------------------ |
---|
| 433 | # Other Stuff |
---|
| 434 | #------------------------------------------------------------------------------ |
---|
| 435 | |
---|
| 436 | # |
---|
[295] | 437 | # Include a site-specific config for local overrides |
---|
| 438 | # |
---|
| 439 | ifndef LOCALCFG |
---|
| 440 | LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk) |
---|
| 441 | ifneq ($(LOCALCFG),) |
---|
| 442 | include $(LOCALCFG) |
---|
| 443 | endif |
---|
| 444 | endif |
---|
| 445 | |
---|
[362] | 446 | # |
---|
| 447 | # Replace the built-in install command with good old copy because the former |
---|
| 448 | # strips EAs on OS/2 which kills file icons we attach with RC |
---|
| 449 | # |
---|
| 450 | INSTALL := $(PATH_ROOT)/tools/install.cmd |
---|
| 451 | |
---|
[520] | 452 | |
---|