source: trunk/Config.kmk @ 542

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

Makefile changes to create unique .sym and .xqs files for exe and dll files. So exceptq can create trp files. Ticket [272]

File size: 15.0 KB
RevLine 
[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]15VERSION         = 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]23BUILD           = 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]30WPIBUILD        = 0
[308]31
[433]32#
[438]33# Lucide version date in the format YYYY-MM-DD.
[433]34#
[519]35VERSIONDATE     = 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]54TEMPLATE_LucideC                         = Lucide C Compiler
55TEMPLATE_LucideC_TOOL            = GCC3OMF
56TEMPLATE_LucideC_CFLAGS          =
57TEMPLATE_LucideC_DEFS            = OS2
[468]58TEMPLATE_LucideC_INCS            = $(PATH_LIB_CURL_INCS)
59TEMPLATE_LucideC_LIBPATH         = $(PATH_LIB_CURL_LIBPATH)
[304]60
[295]61#
[304]62# Lucide C++ Compiler template
63#
64TEMPLATE_LucideCxx                       = Lucide C++ Compiler
65TEMPLATE_LucideCxx_TOOL          = GXX3OMF
66TEMPLATE_LucideCxx_CXXFLAGS      =
67TEMPLATE_LucideCxx_DEFS          = OS2
[468]68TEMPLATE_LucideCxx_INCS          = $(PATH_LIB_CURL_INCS)
69TEMPLATE_LucideCxx_LIBPATH       = $(PATH_LIB_CURL_LIBPATH)
[304]70
[361]71#
72# Lucide C PM application template
73#
74TEMPLATE_LucideC-PM                              = Lucide C PM application
75TEMPLATE_LucideC-PM_EXTENDS              = LucideC
76TEMPLATE_LucideC-PM_EXTENDS_BY   = appending
[524]77TEMPLATE_LucideC-PM_LDFLAGS.release      = -Zlinker /PM:PM -Zno-fork
78TEMPLATE_LucideC-PM_LDFLAGS.debug        = -Zlinker /PM:VIO
[361]79
80#
81# Lucide C++ PM application template
82#
83TEMPLATE_LucideCxx-PM                            = Lucide C++ PM application
84TEMPLATE_LucideCxx-PM_EXTENDS            = LucideCxx
85TEMPLATE_LucideCxx-PM_EXTENDS_BY         = appending
86TEMPLATE_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
98override TOOL_GXX3OMF_RC                                        ?= rc$(HOSTSUFF_EXE)
[308]99TOOL_GXX3OMF_RCOBJSUFF                  ?= .res
100
[374]101TOOL_GXX3OMF_EXEPACK                    ?= lxlite /B- /L- /CS
[524]102TOOL_GXX3OMF_MAPSYM             ?= runmapsym.cmd wmapsym.cmd   
103TOOL_GXX3OMF_MAPXQS             ?= mapxqs.exe  $(outbase).map -o $(outbase).xqs
[308]104TOOL_GXX3OMF_COMPILE_RC_DEPEND   =
105TOOL_GXX3OMF_COMPILE_RC_DEPORD   =
106TOOL_GXX3OMF_COMPILE_RC_OUTPUT   =
107TOOL_GXX3OMF_COMPILE_RC_OUTPUT_MAYBE     =
[520]108# 2016-03-05 SHL
109override 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]116endef
117
118override 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]135endef
136
137override 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]153endef
154
[520]155# 2016-03-10 SHL
[524]156override TOOL_GCC3OMF_RC                                        = $(TOOL_GXX3OMF_RC)
[308]157TOOL_GCC3OMF_RCOBJSUFF                  ?= $(TOOL_GXX3OMF_RCOBJSUFF)
158
[374]159TOOL_GCC3OMF_EXEPACK                    ?= $(TOOL_GXX3OMF_EXEPACK)
[524]160TOOL_GCC3OMF_MAPSYM                     ?= $(TOOL_GXX3OMF_MAPSYM)
161TOOL_GCC3OMF_MAPXQS                     ?= $(TOOL_GXX3OMF_MAPXQS)
[308]162TOOL_GCC3OMF_COMPILE_RC_DEPEND                   = $(TOOL_GXX3OMF_COMPILE_RC_DEPEND)
163TOOL_GCC3OMF_COMPILE_RC_DEPORD                   = $(TOOL_GXX3OMF_COMPILE_RC_DEPORD)
164TOOL_GCC3OMF_COMPILE_RC_OUTPUT                   = $(TOOL_GXX3OMF_COMPILE_RC_OUTPUT)
165TOOL_GCC3OMF_COMPILE_RC_OUTPUT_MAYBE     = $(TOOL_GXX3OMF_COMPILE_RC_OUTPUT_MAYBE)
[520]166# 2016-03-10 SHL
167override TOOL_GCC3OMF_COMPILE_RC_CMDS                    = $(TOOL_GXX3OMF_COMPILE_RC_CMDS)
[308]168
169override 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]186endef
187
188override 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]204endef
205
206#------------------------------------------------------------------------------
[304]207# SOM Stuff
208#------------------------------------------------------------------------------
209
[314]210# Paths: SOM SDK (defaults to the one from the OS/2 Toolkit installation)
211PATH_SDK_SOM                            ?= $(subst \,/,$(SOMBASE))
[304]212ifeq ($(PATH_SDK_SOM),)
213$(error PATH_SDK_SOM is not set!)
214endif
215PATH_SDK_SOM_INCS                       ?= $(PATH_SDK_SOM)/include
216PATH_SDK_SOM_LIBPATH            ?= $(PATH_SDK_SOM)/lib
217
218# Paths: SOM Tool
219PATH_TOOL_SOM_BIN                       ?= $(PATH_SDK_SOM)/bin
[314]220PATH_TOOL_SOM_DLL                       ?= $(PATH_SDK_SOM)/lib
221PATH_TOOL_SOM_MSG                       ?= $(PATH_SDK_SOM)/msg
222PATH_TOOL_SOM_INC                       ?= $(PATH_SDK_SOM)/include
[304]223
224#
225# SOM SDK
226#
227SDK_SOM                                         := System Object Model Toolkit
228SDK_SOM_INCS                            ?= $(PATH_SDK_SOM_INCS)
229SDK_SOM_LIBPATH                         ?= $(PATH_SDK_SOM_LIBPATH)
230SDK_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#
241TOOL_SOM                                        := System Object Model Tooklit
[314]242TOOL_SOM_IDL                            ?= $(PATH_TOOL_SOM_BIN)/sc$(HOSTSUFF_EXE)
[304]243TOOL_SOM_IDLFLAGS           ?=
244TOOL_SOM_IDL_OUTPUT                      = $(addprefix $(outbase).,$(wordlist 2,1000,$(TOOL_SOM_IDL_EMITTERS)))
245TOOL_SOM_IDL_OUTPUT_MAYBE        =
246TOOL_SOM_IDL_DEPEND                      =
247TOOL_SOM_IDL_DEPORD                      =
248# IDL-specific properties
249TOOL_SOM_IDL_OUT                         = $(outbase).$(if $(filter xc,$(firstword $(TOOL_SOM_IDL_EMITTERS))),cpp,$(firstword $(TOOL_SOM_IDL_EMITTERS)))
250# SOM-specific properties
251TOOL_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#
264define 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)
277endef
278
279#
280# SOM Unit
281#
282
283# Add our target properties
284PROPS_TOOLS += IDLTOOL
285PROPS_SINGLE += IDLTOOL
286PROPS_ACCUMULATE_R += IDLFLAGS
287
288# Add ourselves to the default source handlers
289KBUILD_SRC_HANDLERS += \
290  .idl:def_src_handler_idl_idl
291
292# wrapper the compile command dependency check.
293ifndef NO_COMPILE_CMDS_DEPS
294 _UNIT_SOM_IDL_CMDS_DEP = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_SOM_IDL_CMDS_PREV_),$$(commands $(out)),FORCE)
295else
296 _UNIT_SOM_IDL_CMDS_DEP =
297endif
298
299##
300# Generates the rules for running IDL comiler on a specific source file.
301#
302# @param    lots
303#
304define 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
327ifndef 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'
332endif
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
346endef # 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#
359define def_src_handler_idl_idl
360
361local type      := IDL
362
363# Figure out all the props.
364local tool      := $(kb-src-tool dummy_var)
365ifeq ($(tool),)
366$(error kBuild: $(target) / $(sources) does not have IDLTOOL defined!)
367endif
368ifndef TOOL_$(tool)_IDL_CMDS
369$(error kBuild: TOOL_$(tool)_IDL_CMDS isn't defined! target=$(target) source=$(source))
370endif
371local outbase   := $(kb-obj-base outbase)
372local flags             := $(kb-src-prop IDLFLAGS,dummy_var,left-to-right,) # rest depends on flags
373local out               := $(TOOL_$(tool)_IDL_OUT)
374ifeq ($(out),)
375$(error kBuild: TOOL_$(tool)_IDL_OUT isn't defined! target=$(target) source=$(source))
376endif
377local incs              := $(kb-src-prop INCS,dummy_var,left-to-right,$(defpath))
378local defs              := $(kb-src-prop DEFS,dummy_var,left-to-right,)
379local deps              := $(kb-src-prop DEPS,dummy_var,left-to-right,$(defpath))
380local orderdeps := $(call DIRDEP,$(dir $(outbase))) $(kb-src-prop ORDERDEPS,dummy_var,left-to-right)
381
382# default path + source dep.
383ifneq ($(defpath),)
384local source    := $(abspathex $(source),$(defpath))
385endif
386local deps      += $(source)
387
388# dependency file.
389local dep               := $(out)$(SUFF_DEP)
390ifndef NO_COMPILE_CMDS_DEPS
391 _DEPFILES_INCLUDED += $(dep)
392 $(eval includedep $(dep))
393endif
394
395# Call the tool.
396local cmds                      := $(TOOL_$(tool)_IDL_CMDS)
397local output            := $(TOOL_$(tool)_IDL_OUTPUT)
398local output_maybe      := $(TOOL_$(tool)_IDL_OUTPUT_MAYBE)
399local deps                      += $(TOOL_$(tool)_IDL_DEPEND)
400local orderdeps         += $(TOOL_$(tool)_IDL_DEPORD)
401
402# Whether it generates a header file depends on flags.
403local intermediates := $(filter %.xh %.xih,$(output))
404
405# Let the target include the generated files.
[322]406ifeq ($(filter $(patsubst %/,%,$(dir $(outbase))),$($(target)_INCS)),)
407$(target)_INCS          += $(patsubst %/,%,$(dir $(outbase)))
408endif
[304]409
[322]410# Make sure the .idl directory is searched.
411ifeq ($(filter $(patsubst %/,%,$(dir $(source))),$($(target)_INCS)),)
412$(target)_INCS          += $(patsubst %/,%,$(dir $(source)))
413endif
414
[304]415# Generate the rule.
416$(eval $(def_idl_rule))
417
418endef # def_src_handler_idl_idl
419
420#
421# Lucide SOM class DLL template
422#
423TEMPLATE_SomDll              = Lucide SOM class DLL
424TEMPLATE_SomDll_EXTENDS          = LucideCxx
425TEMPLATE_SomDll_EXTENDS_BY       = appending
426TEMPLATE_SomDll_CXXFLAGS         = -Wno-write-strings # SOM compiler is loose here
427TEMPLATE_SomDll_DEFS             = SOMLINK=_System
428TEMPLATE_SomDll_SDKS             = SOM
429TEMPLATE_SomDll_IDLTOOL          = SOM
430TEMPLATE_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#
439ifndef LOCALCFG
440 LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk)
441 ifneq ($(LOCALCFG),)
442  include $(LOCALCFG)
443 endif
444endif
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#
450INSTALL := $(PATH_ROOT)/tools/install.cmd
451
[520]452
Note: See TracBrowser for help on using the repository browser.