Changeset 3258 for trunk/kBuild/tools/GXX3PLAIN.kmk
- Timestamp:
- Jan 3, 2019, 6:34:09 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/tools/GXX3PLAIN.kmk
r3121 r3258 37 37 TOOL_GXX3PLAIN_CC ?= gcc$(HOSTSUFF_EXE) 38 38 TOOL_GXX3PLAIN_CXX ?= g++$(HOSTSUFF_EXE) 39 TOOL_GXX3PLAIN_PCH ?= $(TOOL_GXX3PLAIN_CXX) 39 40 TOOL_GXX3PLAIN_AS ?= gcc$(HOSTSUFF_EXE) 40 41 TOOL_GXX3PLAIN_AR ?= ar$(HOSTSUFF_EXE) … … 74 75 75 76 TOOL_GXX3PLAIN_CXXOBJSUFF ?= .o 76 TOOL_GXX3PLAIN_CXXOBJSUFF ?= .o77 77 TOOL_GXX3PLAIN_CXXFLAGS ?= 78 78 TOOL_GXX3PLAIN_CXXFLAGS.debug ?= -g … … 82 82 TOOL_GXX3PLAIN_CXXDEFS ?= 83 83 84 TOOL_GXX3PLAIN_PCHOBJSUFF ?= .h.gch 85 TOOL_GXX3PLAIN_PCHFLAGS ?= $(TOOL_GXX3PLAIN_CXXFLAGS) 86 TOOL_GXX3PLAIN_PCHFLAGS.debug ?= $(TOOL_GXX3PLAIN_CXXFLAGS.debug) 87 TOOL_GXX3PLAIN_PCHFLAGS.profile ?= $(TOOL_GXX3PLAIN_CXXFLAGS.profile) 88 TOOL_GXX3PLAIN_PCHFLAGS.release ?= $(TOOL_GXX3PLAIN_CXXFLAGS.release) 89 TOOL_GXX3PLAIN_PCHINCS ?= $(TOOL_GXX3PLAIN_CXXINCS) 90 TOOL_GXX3PLAIN_PCHDEFS ?= $(TOOL_GXX3PLAIN_CXXDEFS) 91 84 92 TOOL_GXX3PLAIN_ASFLAGS ?= -x assembler-with-cpp 85 93 TOOL_GXX3PLAIN_ASFLAGS.debug ?= -g … … 108 116 TOOL_GXX3PLAIN_COMPILE_C_DEPEND = 109 117 TOOL_GXX3PLAIN_COMPILE_C_DEPORD = 110 ifdef KBUILD_USE_KOBJCACHE 111 TOOL_GXX3PLAIN_COMPILE_C_USES_KOBJCACHE = 1 112 TOOL_GXX3PLAIN_COMPILE_C_OUTPUT = $(outbase).i 118 TOOL_GXX3PLAIN_COMPILE_C_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).i,) 119 TOOL_GXX3PLAIN_COMPILE_C_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,) 113 120 define TOOL_GXX3PLAIN_COMPILE_C_CMDS 121 if "$(use_objcache)" != "" 114 122 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ 115 123 --kObjCache-cpp $(outbase).i\ … … 123 131 -o $(obj)\ 124 132 - 125 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 126 endef 127 else # !KBUILD_USE_KOBJCACHE 128 TOOL_GXX3PLAIN_COMPILE_C_OUTPUT = 129 define TOOL_GXX3PLAIN_COMPILE_C_CMDS 133 else 130 134 $(QUIET)$(TOOL_GXX3PLAIN_CC) -c\ 131 135 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ … … 133 137 -o $(obj)\ 134 138 $(abspath $(source)) 139 endif 135 140 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 136 141 endef 137 endif # !KBUILD_USE_KOBJCACHE138 142 139 143 140 144 ## Compile C++ source. 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_GXX3PLAIN_COMPILE_CXX_OUTPUT = $(if-expr "$(use_objcache)" != "",$(outbase).ii,) 157 TOOL_GXX3PLAIN_COMPILE_CXX_DEPEND = $($(target)_1_GCC_PCH_FILE) 158 TOOL_GXX3PLAIN_COMPILE_CXX_DEPORD = 159 TOOL_GXX3PLAIN_COMPILE_CXX_USES_KOBJCACHE = $(if-expr "$(use_objcache)" != "",1,) 160 define TOOL_GXX3PLAIN_COMPILE_CXX_CMDS 161 if "$(use_objcache)" != "" 162 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ 163 --kObjCache-cpp $(outbase).ii\ 164 $(TOOL_GXX3PLAIN_CXX) -E -o - $(if-expr defined($(target)_PCH_HDR)\ 165 ,-fpch-preprocess -Winvalid-pch -I$($(target)_1_GCC_PCH_DIR) -include $(basename $($(target)_1_GCC_PCH_FILE)),)\ 166 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ 167 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 168 $(abspath $(source))\ 169 --kObjCache-cc $(obj)\ 170 $(TOOL_GXX3PLAIN_CXX) -c\ 171 $(flags) -fpreprocessed $(if-expr defined($(target)_PCH_HDR),-fpch-preprocess,) -x c++\ 172 -o $(obj)\ 173 - 174 else 175 $(QUIET)$(TOOL_GXX3PLAIN_CXX) -c\ 176 $(flags) $(addprefix -I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(addprefix -D, $(defs))\ 177 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 178 -o $(obj) $(if-expr defined($(target)_PCH_HDR) \ 179 ,-Winvalid-pch -include $(basename $($(target)_1_GCC_PCH_FILE)),) \ 180 $(abspath $(source)) 181 endif 182 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 183 endef 184 185 186 ## Precompile C++ header. 141 187 # @param $(target) Normalized main target name. 142 188 # @param $(source) Source filename (relative). … … 150 196 # @param $(outbase) Output basename (full). Use this for list files and such. 151 197 # @param $(objsuff) Object suffix. 152 TOOL_GXX3PLAIN_COMPILE_CXX_DEPEND = 153 TOOL_GXX3PLAIN_COMPILE_CXX_DEPORD = 154 ifdef KBUILD_USE_KOBJCACHE 155 TOOL_GXX3PLAIN_COMPILE_CXX_USES_KOBJCACHE = 1 156 TOOL_GXX3PLAIN_COMPILE_CXX_OUTPUT = $(outbase).ii 157 define TOOL_GXX3PLAIN_COMPILE_CXX_CMDS 158 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ 159 --kObjCache-cpp $(outbase).ii\ 160 $(TOOL_GXX3PLAIN_CXX) -E -o -\ 161 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ 162 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 163 $(abspath $(source))\ 164 --kObjCache-cc $(obj)\ 165 $(TOOL_GXX3PLAIN_CXX) -c\ 166 $(flags) -fpreprocessed -x c++\ 167 -o $(obj)\ 168 - 198 TOOL_GXX3PLAIN_COMPILE_PCH_OUTPUT = $($(target)_1_GCC_PCH_FILE) 199 TOOL_GXX3PLAIN_COMPILE_PCH_DEPEND = 200 TOOL_GXX3PLAIN_COMPILE_PCH_DEPORD = $($(target)_1_GCC_PCH_DIR) 201 define TOOL_GXX3PLAIN_COMPILE_PCH_CMDS 202 $(QUIET)$(TOOL_GXX3PLAIN_PCH) -c\ 203 $(flags) $(addprefix -I, $($(target)_1_GCC_PCH_DIR) $(incs)) $(addprefix -D, $(defs))\ 204 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ 205 -o $(obj)\ 206 $(abspath $(source)) 207 $(INSTALL) --hard-link-files-when-possible -m 0644 -- "$(obj)" "$($(target)_1_GCC_PCH_FILE)" 169 208 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" 170 209 endef 171 else # !KBUILD_USE_KOBJCACHE172 TOOL_GXX3PLAIN_COMPILE_CXX_OUTPUT =173 define TOOL_GXX3PLAIN_COMPILE_CXX_CMDS174 $(QUIET)$(TOOL_GXX3PLAIN_CXX) -c\175 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\176 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\177 -o $(obj)\178 $(abspath $(source))179 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""180 endef181 endif # !KBUILD_USE_KOBJCACHE182 210 183 211 … … 221 249 TOOL_GXX3PLAIN_LINK_LIBRARY_DEPORD = 222 250 define TOOL_GXX3PLAIN_LINK_LIBRARY_CMDS 223 $(call xargs,$(QUIET)$(TOOL_GXX3PLAIN_AR) $(flags) $(out),$( objs))251 $(call xargs,$(QUIET)$(TOOL_GXX3PLAIN_AR) $(flags) $(out),$(filter-out %.h.gch,$(objs))) 224 252 $(foreach lib,$(othersrc)\ 225 253 ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \ … … 254 282 TOOL_GXX3PLAIN_LINK_PROGRAM_DEPORD = 255 283 define TOOL_GXX3PLAIN_LINK_PROGRAM_CMDS 256 $(QUIET)$(TOOL_GXX3PLAIN_LD) $(flags) -o $(out) $( objs)\284 $(QUIET)$(TOOL_GXX3PLAIN_LD) $(flags) -o $(out) $(filter-out %.h.gch,$(objs))\ 257 285 $(filter %.def, $(othersrc))\ 258 286 $(foreach p,$(libpath), -L$(p))\ … … 282 310 $(QUIET)$(TOOL_GXX3PLAIN_LD) $(TOOL_GXX3PLAIN_LDFLAGS.dll) $(flags) -o $(out)\ 283 311 $(if $(filter-out win32 os2, $(KBUILD_TARGET)),$(call TOOL_GXX3PLAIN_LD_SONAME,$(target),$(out)))\ 284 $( objs)\312 $(filter-out %.h.gch,$(objs))\ 285 313 $(filter %.def, $(othersrc))\ 286 314 $(foreach p,$(libpath), -L$(p))\ … … 313 341 $(QUIET)$(if $(TOOL_GXX3PLAIN_LD_SYSMOD.$(bld_trg)),$(TOOL_GXX3PLAIN_LD_SYSMOD.$(bld_trg)),$(TOOL_GXX3PLAIN_LD_SYSMOD))\ 314 342 $(TOOL_GXX3PLAIN_LDFLAGS_SYSMOD.$(bld_trg)) $(flags) -o $(out) \ 315 $( objs)\343 $(filter-out %.h.gch,$(objs))\ 316 344 $(filter %.def, $(othersrc))\ 317 345 $(foreach p,$(libpath), -L$(p))\
Note:
See TracChangeset
for help on using the changeset viewer.