source: trunk/Config.kmk @ 445

Last change on this file since 445 was 445, checked in by dmik, 12 years ago

Changed version to 1.3.3 beta.

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