source: trunk/Config.kmk @ 701

Last change on this file since 701 was 701, checked in by Gregg Young, 3 years ago

Updated make files and documentation for 1.41 GA

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.41
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     = 2019-02-18
37
38#
39# Lucide version time used in build level strings set to any valid time
40#
41VERSIONTIME     = 01:41: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      = -std=gnu++11
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)
127                $(QUIET)$(PATH_ROOT)/tools/wipfc.exe $(gbm_en.hlp_SOURCES) 
128                $(QUIET)$(PATH_ROOT)/tools/wipfc.exe -l es_ES $(Lucide_es.hlp_SOURCES)
129endef   
130# 2016-03-05 SHL
131override define TOOL_GXX3OMF_COMPILE_RC_CMDS
132        $(QUIET)cd $(subst /,\\,$(patsubst %/,%,$(dir $(source)))) && \
133                $(TOOL_GXX3OMF_RC) -r \
134                $(flags) \
135                $(source) /fo=$(obj)
136endef
137
138define TOOL_GXX3OMF_LINK_DLL_CMDS
139        $(QUIET)$(APPEND) $(outbase).rsp\
140                $(TOOL_GXX3OMF_LDFLAGS.dll)\
141                $(flags)\
142                -o $(out)\
143                $(filter-out %.res,$(objs))\
144                $(foreach p,$(libpath), -L$(p))\
145                $(othersrc)\
146                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
147                -Zmap=$(outbase).map
148        $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp
149        $(if $(filter %.res,$(objs)), \
150                $(QUIET)$(TOOL_GXX3OMF_RC) $(filter %.res,$(objs)) $(out))
151        $(if $(filter-out debug,$(BUILD_TYPE)), \
152                -$(QUIET)$(TOOL_GXX3OMF_EXEPACK) $(out))
153endef
154
155override define TOOL_GXX3OMF_LINK_PROGRAM_CMDS
156        $(QUIET)$(APPEND) $(outbase).rsp\
157                $(flags)\
158                -o $(out)\
159                $(filter-out %.res,$(objs))\
160                $(foreach p,$(libpath), -L$(p))\
161                $(othersrc)\
162                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
163                -Zmap=$(outbase).map
164        $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp
165        $(if $(filter %.res,$(objs)), \
166                $(QUIET)$(TOOL_GXX3OMF_RC) $(filter %.res,$(objs)) $(out))
167        $(if $(filter-out debug,$(BUILD_TYPE)), \
168                -$(QUIET)$(TOOL_GXX3OMF_EXEPACK) $(out))
169endef
170
171# 2016-03-10 SHL
172override TOOL_GCC3OMF_RCFLAGS           ?= $(TOOL_GXX3OMF_RCFLAGS)
173override TOOL_GCC3OMF_RC                                        = $(TOOL_GXX3OMF_RC)
174TOOL_GCC3OMF_RCOBJSUFF                  ?= $(TOOL_GXX3OMF_RCOBJSUFF)
175
176TOOL_GCC3OMF_EXEPACK                    ?= $(TOOL_GXX3OMF_EXEPACK)
177TOOL_GCC3OMF_COMPILE_RC_DEPEND                   = $(TOOL_GXX3OMF_COMPILE_RC_DEPEND)
178TOOL_GCC3OMF_COMPILE_RC_DEPORD                   = $(TOOL_GXX3OMF_COMPILE_RC_DEPORD)
179TOOL_GCC3OMF_COMPILE_RC_OUTPUT                   = $(TOOL_GXX3OMF_COMPILE_RC_OUTPUT)
180TOOL_GCC3OMF_COMPILE_RC_OUTPUT_MAYBE     = $(TOOL_GXX3OMF_COMPILE_RC_OUTPUT_MAYBE)
181# 2016-03-10 SHL
182override TOOL_GCC3OMF_COMPILE_RC_CMDS                    = $(TOOL_GXX3OMF_COMPILE_RC_CMDS)
183
184override define TOOL_GCC3OMF_LINK_DLL_CMDS
185        $(QUIET)$(APPEND) $(outbase).rsp\
186                $(TOOL_GCC3OMF_LDFLAGS.dll)\
187                $(flags)\
188                -o $(out)\
189                $(filter-out %.res,$(objs))\
190                $(foreach p,$(libpath), -L$(p))\
191                $(othersrc)\
192                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
193                -Zmap=$(outbase).map
194        $(QUIET)$(TOOL_GCC3OMF_LD) @$(outbase).rsp
195        $(if $(filter %.res,$(objs)), \
196                $(QUIET)$(TOOL_GCC3OMF_RC) $(filter %.res,$(objs)) $(out))
197        $(if $(filter-out debug,$(BUILD_TYPE)), \
198                -$(QUIET)$(TOOL_GCC3OMF_EXEPACK) $(out))
199endef
200
201define TOOL_GCC3OMF_LINK_PROGRAM_CMDS
202        $(QUIET)$(APPEND) $(outbase).rsp\
203                $(flags)\
204                -o $(out)\
205                $(filter-out %.res,$(objs))\
206                $(foreach p,$(libpath), -L$(p))\
207                $(othersrc)\
208                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
209                -Zmap=$(outbase).map
210        $(QUIET)$(TOOL_GCC3OMF_LD) @$(outbase).rsp
211        $(if $(filter %.res,$(objs)), \
212                $(QUIET)$(TOOL_GCC3OMF_RC) $(filter %.res,$(objs)) $(out))
213        $(if $(filter-out debug,$(BUILD_TYPE)), \
214                -$(QUIET)$(TOOL_GCC3OMF_EXEPACK) $(out)) 
215endef
216
217#------------------------------------------------------------------------------
218# SOM Stuff
219#------------------------------------------------------------------------------
220
221# Paths: SOM SDK (defaults to the one from the OS/2 Toolkit installation)
222PATH_SDK_SOM                            ?= $(subst \,/,$(SOMBASE))
223ifeq ($(PATH_SDK_SOM),)
224$(error PATH_SDK_SOM is not set!)
225endif
226PATH_SDK_SOM_INCS                       ?= $(PATH_SDK_SOM)/include
227PATH_SDK_SOM_LIBPATH            ?= $(PATH_SDK_SOM)/lib
228
229# Paths: SOM Tool
230PATH_TOOL_SOM_BIN                       ?= $(PATH_SDK_SOM)/bin
231PATH_TOOL_SOM_DLL                       ?= $(PATH_SDK_SOM)/lib
232PATH_TOOL_SOM_MSG                       ?= $(PATH_SDK_SOM)/msg
233PATH_TOOL_SOM_INC                       ?= $(PATH_SDK_SOM)/include
234
235#
236# SOM SDK
237#
238SDK_SOM                                         := System Object Model Toolkit
239SDK_SOM_INCS                            ?= $(PATH_SDK_SOM_INCS)
240SDK_SOM_LIBPATH                         ?= $(PATH_SDK_SOM_LIBPATH)
241SDK_SOM_LIBS                            ?= somtk
242
243#
244# SOM Tool
245#
246# Notes: A valud value of the -s option must always be specified in IDLFLAGS;
247# the output of the first emitter is taken as the main output file and will be
248# sent to the compiler. All generated output go to $(dir $(outbase)) except the
249# output files ecplicitly listed in $(target)_IDLSOURCES which stay where they
250# are.
251#
252TOOL_SOM                                        := System Object Model Tooklit
253TOOL_SOM_IDL                            ?= $(PATH_TOOL_SOM_BIN)/sc$(HOSTSUFF_EXE)
254TOOL_SOM_IDLFLAGS           ?=
255TOOL_SOM_IDL_OUTPUT                      = $(addprefix $(outbase).,$(wordlist 2,1000,$(TOOL_SOM_IDL_EMITTERS)))
256TOOL_SOM_IDL_OUTPUT_MAYBE        =
257TOOL_SOM_IDL_DEPEND                      =
258TOOL_SOM_IDL_DEPORD                      =
259# IDL-specific properties
260TOOL_SOM_IDL_OUT                         = $(outbase).$(if $(filter xc,$(firstword $(TOOL_SOM_IDL_EMITTERS))),cpp,$(firstword $(TOOL_SOM_IDL_EMITTERS)))
261# SOM-specific properties
262TOOL_SOM_IDL_EMITTERS            = $(subst ;, ,$(patsubst -s"%",%,$(filter -s"%",$(flags))))
263
264## Compile an IDL file.
265#
266# @param    $(target)   Normalized main target name.
267# @param    $(source)   Source filename (relative).
268# @param    $(out)      Object file name. This shall be (re)created by the compilation.
269# @param    $(dep)      Dependcy file. This may be (re)created by the compilation.
270# @param    $(flags)    Flags.
271# @param    $(defs)     Definitions.
272# @param    $(incs)     Includes.
273# @param    $(outbase)  Output basename (full). Use this for list files and such.
274#
275define TOOL_SOM_IDL_CMDS
276        $(QUIET)$(REDIRECT) \
277        -E 'PATH=$(PATH_TOOL_SOM_BIN);$(PATH)' \
278        -E 'BEGINLIBPATH=$(PATH_TOOL_SOM_DLL);$(BEGINLIBPATH)' \
279        -E 'DPATH=$(PATH_TOOL_SOM_MSG);$(DPATH)' \
280        -E 'SMINCLUDE=$(PATH_TOOL_SOM_INC);$(INCLUDE)' \
281        -E 'INCLUDE=' \
282        -E 'LIB=' \
283        -- \
284        $(TOOL_SOM_IDL) $(flags) \
285        $(addprefix -I, $(incs)) \
286        $(addprefix -D, $(defs)) \
287        -d $(dir $(outbase)) $(source)
288endef
289
290#
291# SOM Unit
292#
293
294# Add our target properties
295PROPS_TOOLS += IDLTOOL
296PROPS_SINGLE += IDLTOOL
297PROPS_ACCUMULATE_R += IDLFLAGS
298
299# Add ourselves to the default source handlers
300KBUILD_SRC_HANDLERS += \
301  .idl:def_src_handler_idl_idl
302
303# wrapper the compile command dependency check.
304ifndef NO_COMPILE_CMDS_DEPS
305 _UNIT_SOM_IDL_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_SOM_IDL_CMDS_PREV_),$$(commands $(out)),FORCE)
306else
307 _UNIT_SOM_IDL_CMDS_DEP =
308endif
309
310##
311# Generates the rules for running IDL comiler on a specific source file.
312#
313# @param    lots
314#
315define def_idl_rule
316
317$(out) + $(output) +| $(output_maybe) : \
318                $(deps) \
319                $(value _UNIT_SOM_IDL_CMDS_DEP) \
320                | \
321                $(orderdeps)
322        %$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
323        $$(QUIET)$$(RM) -f -- $(dep) $(out) $(output) $(output_maybe)
324        $(foreach f,$(out) $(output) $(output_maybe),\
325                $(if $(findstring $(notdir $f),$(notdir $($(target)_IDLSOURCES))),\
326                        $$(QUIET)$(CP) --ignore-non-existing \
327                                $(abspathex $(filter %$(notdir $f),$($(target)_IDLSOURCES)),$($(target)_DEFPATH)) \
328                                $f))
329
330$(cmds)
331
332        $(foreach f,$(out) $(output) $(output_maybe),\
333                $(if $(findstring $(notdir $f),$(notdir $($(target)_IDLSOURCES))),\
334                        $$(QUIET)$(CP) --changed \
335                                $f \
336                                $(abspathex $(filter %$(notdir $f),$($(target)_IDLSOURCES)),$($(target)_DEFPATH))))
337
338ifndef NO_COMPILE_CMDS_DEPS
339        %$$(QUIET2)$$(APPEND) '$(dep)'
340        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_SOM_IDL_CMDS_PREV_'
341        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
342        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
343endif
344
345# if the generated file is listed in IDLSOURCES, add it to _GEN_SOURCES_ from
346# there (we did a copy trick for it), otherwise add it only of it's $(out)
347$(foreach f,$(out) $(output) $(output_maybe),\
348        $(if $(findstring $(notdir $f),$(notdir $($(target)_IDLSOURCES))),\
349                $(eval $(target)_GEN_SOURCES_ += $(filter %$(notdir $f),$($(target)_IDLSOURCES))),\
350                $(if $(findstring $f,$(out)),$(eval $(target)_GEN_SOURCES_ += $f))))
351
352# update globals and target properties.
353_OUT_FILES += $(out) $(output) $(output_maybe)
354#$(target)_GEN_SOURCES_ += $(out)
355$(target)_INTERMEDIATES += $(intermediates)
356
357endef # def_idl_rule
358
359##
360# Handler for .idl files listed in the SOURCES properties.
361#
362# .idl files are transformed into C/C++ header files and maybe to source files
363# compiled by the compiler.
364#
365# @param    target      The target file.
366# @param    source      The source file.
367# @param    lots more
368# @returns  quite a bit.
369#
370define def_src_handler_idl_idl
371
372local type      := IDL
373
374# Figure out all the props.
375local tool      := $(kb-src-tool dummy_var)
376ifeq ($(tool),)
377$(error kBuild: $(target) / $(sources) does not have IDLTOOL defined!)
378endif
379ifndef TOOL_$(tool)_IDL_CMDS
380$(error kBuild: TOOL_$(tool)_IDL_CMDS isn't defined! target=$(target) source=$(source))
381endif
382local outbase   := $(kb-obj-base outbase)
383local flags             := $(kb-src-prop IDLFLAGS,dummy_var,left-to-right,) # rest depends on flags
384local out               := $(TOOL_$(tool)_IDL_OUT)
385ifeq ($(out),)
386$(error kBuild: TOOL_$(tool)_IDL_OUT isn't defined! target=$(target) source=$(source))
387endif
388local incs              := $(kb-src-prop INCS,dummy_var,left-to-right,$(defpath))
389local defs              := $(kb-src-prop DEFS,dummy_var,left-to-right,)
390local deps              := $(kb-src-prop DEPS,dummy_var,left-to-right,$(defpath))
391local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
392
393# default path + source dep.
394ifneq ($(defpath),)
395local source    := $(abspathex $(source),$(defpath))
396endif
397local deps      += $(source)
398
399# dependency file.
400local dep               := $(out)$(SUFF_DEP)
401ifndef NO_COMPILE_CMDS_DEPS
402 _DEPFILES_INCLUDED += $(dep)
403 $(eval includedep $(dep))
404endif
405
406# Call the tool.
407local cmds                      := $(TOOL_$(tool)_IDL_CMDS)
408local output            := $(TOOL_$(tool)_IDL_OUTPUT)
409local output_maybe      := $(TOOL_$(tool)_IDL_OUTPUT_MAYBE)
410local deps                      += $(TOOL_$(tool)_IDL_DEPEND)
411local orderdeps         += $(TOOL_$(tool)_IDL_DEPORD)
412
413# Whether it generates a header file depends on flags.
414local intermediates := $(filter %.xh %.xih,$(output))
415
416# Let the target include the generated files.
417ifeq ($(filter $(patsubst %/,%,$(dir $(outbase))),$($(target)_INCS)),)
418$(target)_INCS          += $(patsubst %/,%,$(dir $(outbase)))
419endif
420
421# Make sure the .idl directory is searched.
422ifeq ($(filter $(patsubst %/,%,$(dir $(source))),$($(target)_INCS)),)
423$(target)_INCS          += $(patsubst %/,%,$(dir $(source)))
424endif
425
426# Generate the rule.
427$(eval $(def_idl_rule))
428
429endef # def_src_handler_idl_idl
430
431#
432# Lucide SOM class DLL template
433#
434TEMPLATE_SomDll              = Lucide SOM class DLL
435TEMPLATE_SomDll_EXTENDS          = LucideCxx
436TEMPLATE_SomDll_EXTENDS_BY       = appending
437TEMPLATE_SomDll_CXXFLAGS         = -Wno-write-strings # SOM compiler is loose here
438TEMPLATE_SomDll_DEFS             = SOMLINK=_System
439TEMPLATE_SomDll_SDKS             = SOM
440TEMPLATE_SomDll_IDLTOOL          = SOM
441TEMPLATE_SomDll_IDLFLAGS         = -c -s"xc;xh;xih"
442
443#------------------------------------------------------------------------------
444# Other Stuff
445#------------------------------------------------------------------------------
446
447#
448# Include a site-specific config for local overrides
449#
450ifndef LOCALCFG
451 LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk)
452 ifneq ($(LOCALCFG),)
453  include $(LOCALCFG)
454 endif
455endif
456
457#
458# Replace the built-in install command with good old copy because the former
459# strips EAs on OS/2 which kills file icons we attach with RC
460#
461INSTALL := $(PATH_ROOT)/tools/install.cmd
462
Note: See TracBrowser for help on using the repository browser.