VirtualBox

Changeset 3257 in kBuild


Ignore:
Timestamp:
Jan 3, 2019 2:46:05 AM (6 years ago)
Author:
bird
Message:

GXX,GXX3: PCH updates

Location:
trunk/kBuild/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/tools/GXX.kmk

    r3121 r3257  
    3737TOOL_GXX_CC  ?= gcc$(HOSTSUFF_EXE)
    3838TOOL_GXX_CXX ?= g++$(HOSTSUFF_EXE)
     39TOOL_GXX_PCH ?= $(TOOL_GXX_CXX)
    3940TOOL_GXX_AS  ?= gcc$(HOSTSUFF_EXE)
    4041TOOL_GXX_AR  ?= ar$(HOSTSUFF_EXE)
     
    6768TOOL_GXX_CXXDEFS          ?=
    6869
     70TOOL_GXX_PCHOBJSUFF       ?= .h.gch
     71TOOL_GXX_PCHFLAGS         ?= $(TOOL_GXX_CXXFLAGS)
     72TOOL_GXX_PCHFLAGS.debug   ?= $(TOOL_GXX_CXXFLAGS.debug)
     73TOOL_GXX_PCHFLAGS.profile ?= $(TOOL_GXX_CXXFLAGS.profile)
     74TOOL_GXX_PCHFLAGS.release ?= $(TOOL_GXX_CXXFLAGS.release)
     75TOOL_GXX_PCHINCS          ?= $(TOOL_GXX_CXXINCS)
     76TOOL_GXX_PCHDEFS          ?= $(TOOL_GXX_CXXDEFS)
     77
    6978TOOL_GXX_ASFLAGS          ?= -x assembler-with-cpp
    7079TOOL_GXX_ASFLAGS.debug    ?= -g
     
    110119# @param    $(source)   Source filename (relative).
    111120# @param    $(obj)      Object file name. This shall be (re)created by the compilation.
    112 # @param    $(dep)          Dependcy file. This shall be (re)created by the compilation.
    113 # @param    $(flags)    Flags.
    114 # @param    $(defs)     Definitions. No -D or something.
    115 # @param    $(incs)     Includes. No -I or something.
    116 # @param    $(dirdep)   Directory creation dependency.
    117 # @param    $(deps)             Other dependencies.
     121# @param    $(dep)      Dependcy file. This shall be (re)created by the compilation.
     122# @param    $(flags)    Flags.
     123# @param    $(defs)     Definitions. No -D or something.
     124# @param    $(incs)     Includes. No -I or something.
     125# @param    $(dirdep)   Directory creation dependency.
     126# @param    $(deps)     Other dependencies.
    118127#
    119128# @param    $(outbase)  Output basename (full). Use this for list files and such.
    120129# @param    $(objsuff)  Object suffix.
    121130TOOL_GXX_COMPILE_CXX_OUTPUT =
    122 TOOL_GXX_COMPILE_CXX_DEPEND =
     131TOOL_GXX_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE)
    123132TOOL_GXX_COMPILE_CXX_DEPORD =
    124133define TOOL_GXX_COMPILE_CXX_CMDS
    125134        $(QUIET)$(TOOL_GXX_CXX) -c\
    126                 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
    127                 -Wp,-MD,$(dep) -Wp,-MT,$(obj) \
     135                $(flags) $(addprefix -I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(addprefix -D, $(defs))\
     136                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
     137                -o $(obj) $(if-expr defined($(target)_PCH_HDR) \
     138                ,-Winvalid-pch -include $(basename $($(target)_1_GCC_PCH_FILE)),) \
     139                $(abspath $(source))
     140        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
     141endef
     142
     143
     144## Precompile C++ header.
     145# @param    $(target)   Normalized main target name.
     146# @param    $(source)   Source filename (relative).
     147# @param    $(obj)      Object file name. This shall be (re)created by the compilation.
     148# @param    $(dep)          Dependcy file. This shall be (re)created by the compilation.
     149# @param    $(flags)    Flags.
     150# @param    $(defs)     Definitions. No -D or something.
     151# @param    $(incs)     Includes. No -I or something.
     152# @param    $(dirdep)   Directory creation dependency.
     153# @param    $(deps)             Other dependencies.
     154# @param    $(outbase)  Output basename (full). Use this for list files and such.
     155# @param    $(objsuff)  Object suffix.
     156TOOL_GXX_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
     157TOOL_GXX_COMPILE_PCH_DEPEND =
     158TOOL_GXX_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR)
     159define TOOL_GXX_COMPILE_PCH_CMDS
     160        $(QUIET)$(TOOL_GXX_PCH) -c\
     161                $(flags) $(addprefix -I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(addprefix -D, $(defs))\
     162                -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
    128163                -o $(obj)\
    129164                $(abspath $(source))
     165        $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)"
    130166        $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
    131167endef
     
    171207TOOL_GXX_LINK_LIBRARY_DEPORD =
    172208define TOOL_GXX_LINK_LIBRARY_CMDS
    173         $(QUIET)$(TOOL_GXX_AR) $(flags) $(out) $(objs)
    174         $(call xargs,$(QUIET)$(TOOL_GXX_AR) $(flags) $(out),$(objs))
     209        $(QUIET)$(TOOL_GXX_AR) $(flags) $(out) $(filter-out %.h.gch,$(objs))
     210        $(call xargs,$(QUIET)$(TOOL_GXX_AR) $(flags) $(out),$(filter-out %.h.gch,$(objs)))
    175211        $(foreach lib,$(othersrc)\
    176212                ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \
     
    204240TOOL_GXX_LINK_PROGRAM_DEPORD =
    205241define TOOL_GXX_LINK_PROGRAM_CMDS
    206         $(QUIET)$(TOOL_GXX_LD) $(flags) -o $(out) $(objs) \
     242        $(QUIET)$(TOOL_GXX_LD) $(flags) -o $(out) $(filter-out %.h.gch,$(objs)) \
    207243                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
    208244endef
     
    226262TOOL_GXX_LINK_DLL_DEPORD =
    227263define TOOL_GXX_LINK_DLL_CMDS
    228         $(QUIET)$(TOOL_GXX_LD) $(TOOL_GXX_LDFLAGS.dll) $(flags) -o $(out) $(objs) \
     264        $(QUIET)$(TOOL_GXX_LD) $(TOOL_GXX_LDFLAGS.dll) $(flags) -o $(out) $(filter-out %.h.gch,$(objs)) \
    229265                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
    230266endef
  • trunk/kBuild/tools/GXX3.kmk

    r3256 r3257  
    168168# @param    $(outbase)  Output basename (full). Use this for list files and such.
    169169# @param    $(objsuff)  Object suffix.
     170TOOL_GXX3_COMPILE_CXX_OUTPUT         = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)
    170171TOOL_GXX3_COMPILE_CXX_DEPEND         = $($(target)_1_GCC_PCH_FILE)
    171172TOOL_GXX3_COMPILE_CXX_DEPORD         =
    172 TOOL_GXX3_COMPILE_CXX_OUTPUT         = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)
    173173TOOL_GXX3_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,)
    174174define TOOL_GXX3_COMPILE_CXX_CMDS
     
    210210# @param    $(outbase)  Output basename (full). Use this for list files and such.
    211211# @param    $(objsuff)  Object suffix.
     212TOOL_GXX3_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
     213TOOL_GXX3_COMPILE_PCH_DEPEND =
    212214TOOL_GXX3_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR)
    213 TOOL_GXX3_COMPILE_PCH_DEPEND =
    214 TOOL_GXX3_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE)
    215215define TOOL_GXX3_COMPILE_PCH_CMDS
    216216        $(QUIET)$(TOOL_GXX3_PCH) -c\
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette