source: trunk/Config.kmk

Last change on this file was 711, checked in by Gregg Young, 18 months ago

Build changes to add Polish lng file; Fixed lugbm-gcc.def generation Ticket #380; Fixed some grammar in the wis file.

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