source: trunk/Config.kmk @ 603

Last change on this file since 603 was 603, checked in by Gregg Young, 5 years ago

Changes to build system to get LuGBM to build when building the entire package and to build the def files from templates.

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