Changeset 3257 in kBuild
- Timestamp:
- Jan 3, 2019 2:46:05 AM (6 years ago)
- Location:
- trunk/kBuild/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/tools/GXX.kmk
r3121 r3257 37 37 TOOL_GXX_CC ?= gcc$(HOSTSUFF_EXE) 38 38 TOOL_GXX_CXX ?= g++$(HOSTSUFF_EXE) 39 TOOL_GXX_PCH ?= $(TOOL_GXX_CXX) 39 40 TOOL_GXX_AS ?= gcc$(HOSTSUFF_EXE) 40 41 TOOL_GXX_AR ?= ar$(HOSTSUFF_EXE) … … 67 68 TOOL_GXX_CXXDEFS ?= 68 69 70 TOOL_GXX_PCHOBJSUFF ?= .h.gch 71 TOOL_GXX_PCHFLAGS ?= $(TOOL_GXX_CXXFLAGS) 72 TOOL_GXX_PCHFLAGS.debug ?= $(TOOL_GXX_CXXFLAGS.debug) 73 TOOL_GXX_PCHFLAGS.profile ?= $(TOOL_GXX_CXXFLAGS.profile) 74 TOOL_GXX_PCHFLAGS.release ?= $(TOOL_GXX_CXXFLAGS.release) 75 TOOL_GXX_PCHINCS ?= $(TOOL_GXX_CXXINCS) 76 TOOL_GXX_PCHDEFS ?= $(TOOL_GXX_CXXDEFS) 77 69 78 TOOL_GXX_ASFLAGS ?= -x assembler-with-cpp 70 79 TOOL_GXX_ASFLAGS.debug ?= -g … … 110 119 # @param $(source) Source filename (relative). 111 120 # @param $(obj) Object file name. This shall be (re)created by the compilation. 112 # @param $(dep) 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) 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. 118 127 # 119 128 # @param $(outbase) Output basename (full). Use this for list files and such. 120 129 # @param $(objsuff) Object suffix. 121 130 TOOL_GXX_COMPILE_CXX_OUTPUT = 122 TOOL_GXX_COMPILE_CXX_DEPEND = 131 TOOL_GXX_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE) 123 132 TOOL_GXX_COMPILE_CXX_DEPORD = 124 133 define TOOL_GXX_COMPILE_CXX_CMDS 125 134 $(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):" "" 141 endef 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. 156 TOOL_GXX_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE) 157 TOOL_GXX_COMPILE_PCH_DEPEND = 158 TOOL_GXX_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR) 159 define 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\ 128 163 -o $(obj)\ 129 164 $(abspath $(source)) 165 $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)" 130 166 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 131 167 endef … … 171 207 TOOL_GXX_LINK_LIBRARY_DEPORD = 172 208 define 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))) 175 211 $(foreach lib,$(othersrc)\ 176 212 ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \ … … 204 240 TOOL_GXX_LINK_PROGRAM_DEPORD = 205 241 define 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)) \ 207 243 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 208 244 endef … … 226 262 TOOL_GXX_LINK_DLL_DEPORD = 227 263 define 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)) \ 229 265 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) 230 266 endef -
trunk/kBuild/tools/GXX3.kmk
r3256 r3257 168 168 # @param $(outbase) Output basename (full). Use this for list files and such. 169 169 # @param $(objsuff) Object suffix. 170 TOOL_GXX3_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,) 170 171 TOOL_GXX3_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE) 171 172 TOOL_GXX3_COMPILE_CXX_DEPORD = 172 TOOL_GXX3_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,)173 173 TOOL_GXX3_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,) 174 174 define TOOL_GXX3_COMPILE_CXX_CMDS … … 210 210 # @param $(outbase) Output basename (full). Use this for list files and such. 211 211 # @param $(objsuff) Object suffix. 212 TOOL_GXX3_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE) 213 TOOL_GXX3_COMPILE_PCH_DEPEND = 212 214 TOOL_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)215 215 define TOOL_GXX3_COMPILE_PCH_CMDS 216 216 $(QUIET)$(TOOL_GXX3_PCH) -c\
Note:
See TracChangeset
for help on using the changeset viewer.