Changeset 2623 in kBuild
- Timestamp:
- Aug 5, 2012 2:38:18 AM (13 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/tools/MINGWW64.kmk
r2611 r2623 1 1 # $Id$ 2 2 ## @file 3 # kBuild Tool Config - MinGW 32 GCC v3.3+.4 # 5 6 # 7 # Copyright (c) 2004-201 0knut st. osmundsen <[email protected]>3 # kBuild Tool Config - MinGW-W64. 4 # 5 6 # 7 # Copyright (c) 2004-2012 knut st. osmundsen <[email protected]> 8 8 # 9 9 # This file is part of kBuild. … … 32 32 # 33 33 34 ifdef TOOL_MINGW 3235 $(error Already included (TOOL_MINGW 32=$(TOOL_MINGW32)))36 endif 37 TOOL_MINGW 32 := MinGW32 GCC v3.3+.34 ifdef TOOL_MINGWW64 35 $(error Already included (TOOL_MINGWW64=$(TOOL_MINGWW64))) 36 endif 37 TOOL_MINGWW64 := MinGW-W64 - The incomprehensible 64-bit GCC port to Windows. 38 38 39 39 # Tool Specific Properties 40 ifndef PATH_TOOL_MINGW 3241 PATH_TOOL_MINGW 32 := $(wildcard $(PATH_DEVTOOLS_BLD)/mingw32/v*.*)42 ifeq ($(PATH_TOOL_MINGW 32),)43 PATH_TOOL_MINGW 32 := $(wildcard $(PATH_DEVTOOLS)/win.x86/mingw32/v*.*)44 endif 45 ifeq ($(PATH_TOOL_MINGW 32),)46 PATH_TOOL_MINGW 32 := $(wildcard $(PATH_DEVTOOLS)/x86.win32/mingw32/v*.*)47 endif 48 ifneq ($(PATH_TOOL_MINGW 32),)49 PATH_TOOL_MINGW 32 := $(lastword $(sort $(PATH_TOOL_MINGW32)))40 ifndef PATH_TOOL_MINGWW64 41 PATH_TOOL_MINGWW64 := $(wildcard $(PATH_DEVTOOLS_BLD)/mingw-w64/r*) 42 ifeq ($(PATH_TOOL_MINGWW64),) 43 PATH_TOOL_MINGWW64 := $(wildcard $(PATH_DEVTOOLS)/win.amd64/mingw-w64/r*) 44 endif 45 ifeq ($(PATH_TOOL_MINGWW64),) 46 PATH_TOOL_MINGWW64 := $(wildcard $(PATH_DEVTOOLS)/win.x86/mingw-w64/r*) 47 endif 48 ifneq ($(PATH_TOOL_MINGWW64),) 49 PATH_TOOL_MINGWW64 := $(lastword $(sort $(PATH_TOOL_MINGWW64))) 50 50 endif 51 51 else 52 52 # Resolve any fancy stuff once and for all. 53 PATH_TOOL_MINGW 32 := $(PATH_TOOL_MINGW32)53 PATH_TOOL_MINGWW64 := $(PATH_TOOL_MINGWW64) 54 54 endif 55 55 56 56 # figure out if it's native or needs a win32 launcher 57 TOOL_MINGW 32_HOSTSUFF_EXE ?= $(HOSTSUFF_EXE)58 ifndef TOOL_MINGW 32_PREFIX59 ifneq ($(PATH_TOOL_MINGW 32),)60 TOOL_MINGW 32_PREFIX := $(PATH_TOOL_MINGW32)/bin/57 TOOL_MINGWW64_HOSTSUFF_EXE ?= $(HOSTSUFF_EXE) 58 ifndef TOOL_MINGWW64_PREFIX 59 ifneq ($(PATH_TOOL_MINGWW64),) 60 TOOL_MINGWW64_PREFIX := $(PATH_TOOL_MINGWW64)/bin/ 61 61 else 62 TOOL_MINGW 32_PREFIX :=62 TOOL_MINGWW64_PREFIX := 63 63 endif 64 64 ifneq ($(KBUILD_HOST),win) 65 # we're cross compiling either using an emulator (wine/odin) or a cross compiler.66 ifneq ($(PATH_TOOL_MINGW32),$(subst /win.x86,,$(subst /x86.win,,$(PATH_TOOL_MINGW32))))67 TOOL_MINGW 32_PREFIX := $(EXEC_X86_WIN32) $(TOOL_MINGW32_PREFIX)68 TOOL_MINGW 32_HOSTSUFF_EXE := .exe69 else70 TOOL_MINGW32_PREFIX := $(TOOL_MINGW32_PREFIX)i386-mingw32msvc-71 TOOL_MINGW32_HOSTSUFF_EXE :=72 TOOL_MINGW32_XCOMPILE := 173 endif65 # # we're cross compiling either using an emulator (wine/odin) or a cross compiler. 66 # ifneq ($(PATH_TOOL_MINGWW64),$(subst /win.x86,,$(subst /x86.win,,$(PATH_TOOL_MINGWW64)))) 67 TOOL_MINGWW64_PREFIX := $(EXEC_X86_WIN32) $(TOOL_MINGWW64_PREFIX) 68 TOOL_MINGWW64_HOSTSUFF_EXE := .exe 69 # else 70 # TOOL_MINGWW64_PREFIX := $(TOOL_MINGWW64_PREFIX)i386-mingw32msvc- 71 # TOOL_MINGWW64_HOSTSUFF_EXE := 72 # TOOL_MINGWW64_XCOMPILE := 1 73 # endif 74 74 endif 75 75 else 76 76 # Resolve any fancy stuff once and for all. 77 TOOL_MINGW 32_PREFIX := $(TOOL_MINGW32_PREFIX)78 endif 79 80 TOOL_MINGW 32_CC ?= $(TOOL_MINGW32_PREFIX)gcc$(TOOL_MINGW32_HOSTSUFF_EXE)81 TOOL_MINGW 32_CXX ?= $(TOOL_MINGW32_PREFIX)g++$(TOOL_MINGW32_HOSTSUFF_EXE)82 TOOL_MINGW 32_AS ?= $(TOOL_MINGW32_PREFIX)gcc$(TOOL_MINGW32_HOSTSUFF_EXE)83 TOOL_MINGW 32_AR ?= $(TOOL_MINGW32_PREFIX)ar$(TOOL_MINGW32_HOSTSUFF_EXE)84 ifndef TOOL_MINGW 32_XCOMPILE# The gentoo package doesn't have g++.85 TOOL_MINGW 32_LD ?= $(TOOL_MINGW32_PREFIX)g++$(TOOL_MINGW32_HOSTSUFF_EXE)77 TOOL_MINGWW64_PREFIX := $(TOOL_MINGWW64_PREFIX) 78 endif 79 80 TOOL_MINGWW64_CC ?= $(TOOL_MINGWW64_PREFIX)gcc$(TOOL_MINGWW64_HOSTSUFF_EXE) 81 TOOL_MINGWW64_CXX ?= $(TOOL_MINGWW64_PREFIX)g++$(TOOL_MINGWW64_HOSTSUFF_EXE) 82 TOOL_MINGWW64_AS ?= $(TOOL_MINGWW64_PREFIX)gcc$(TOOL_MINGWW64_HOSTSUFF_EXE) 83 TOOL_MINGWW64_AR ?= $(TOOL_MINGWW64_PREFIX)ar$(TOOL_MINGWW64_HOSTSUFF_EXE) 84 ifndef TOOL_MINGWW64_XCOMPILE# The gentoo package doesn't have g++. 85 TOOL_MINGWW64_LD ?= $(TOOL_MINGWW64_PREFIX)g++$(TOOL_MINGWW64_HOSTSUFF_EXE) 86 86 else 87 TOOL_MINGW 32_LD ?= $(TOOL_MINGW32_PREFIX)gcc$(TOOL_MINGW32_HOSTSUFF_EXE)88 endif 89 TOOL_MINGW 32_DLLWRAP ?= $(TOOL_MINGW32_PREFIX)dllwrap$(TOOL_MINGW32_HOSTSUFF_EXE)90 TOOL_MINGW 32_DLLTOOL ?= $(TOOL_MINGW32_PREFIX)dlltool$(TOOL_MINGW32_HOSTSUFF_EXE)87 TOOL_MINGWW64_LD ?= $(TOOL_MINGWW64_PREFIX)gcc$(TOOL_MINGWW64_HOSTSUFF_EXE) 88 endif 89 TOOL_MINGWW64_DLLWRAP ?= $(TOOL_MINGWW64_PREFIX)dllwrap$(TOOL_MINGWW64_HOSTSUFF_EXE) 90 TOOL_MINGWW64_DLLTOOL ?= $(TOOL_MINGWW64_PREFIX)dlltool$(TOOL_MINGWW64_HOSTSUFF_EXE) 91 91 92 92 # General Properties used by kBuild 93 TOOL_MINGW 32_COBJSUFF ?= .o94 TOOL_MINGW 32_CFLAGS ?= -g95 TOOL_MINGW 32_CFLAGS.debug ?= -O096 TOOL_MINGW 32_CFLAGS.release ?= -O297 TOOL_MINGW 32_CFLAGS.profile ?= -O2 #-pg98 TOOL_MINGW 32_CINCS ?=99 TOOL_MINGW 32_CDEFS ?=100 101 TOOL_MINGW 32_CXXOBJSUFF ?= .o102 TOOL_MINGW 32_CXXOBJSUFF ?= .o103 TOOL_MINGW 32_CXXFLAGS ?= -g104 TOOL_MINGW 32_CXXFLAGS.debug ?= -O0105 TOOL_MINGW 32_CXXFLAGS.release ?= -O2106 TOOL_MINGW 32_CXXFLAGS.profile ?= -O2 #-pg107 TOOL_MINGW 32_CXXINCS ?=108 TOOL_MINGW 32_CXXDEFS ?=109 110 TOOL_MINGW 32_ASFLAGS ?= -g -x assembler-with-cpp111 TOOL_MINGW 32_ASOBJSUFF ?= .o112 113 TOOL_MINGW 32_ARFLAGS ?= cr114 TOOL_MINGW 32_ARLIBSUFF ?= .a115 116 TOOL_MINGW 32_LDFLAGS ?=117 TOOL_MINGW 32_LDFLAGS.debug ?= -g118 TOOL_MINGW 32_LDFLAGS.release ?= -s93 TOOL_MINGWW64_COBJSUFF ?= .o 94 TOOL_MINGWW64_CFLAGS ?= -g 95 TOOL_MINGWW64_CFLAGS.debug ?= -O0 96 TOOL_MINGWW64_CFLAGS.release ?= -O2 97 TOOL_MINGWW64_CFLAGS.profile ?= -O2 #-pg 98 TOOL_MINGWW64_CINCS ?= 99 TOOL_MINGWW64_CDEFS ?= 100 101 TOOL_MINGWW64_CXXOBJSUFF ?= .o 102 TOOL_MINGWW64_CXXOBJSUFF ?= .o 103 TOOL_MINGWW64_CXXFLAGS ?= -g 104 TOOL_MINGWW64_CXXFLAGS.debug ?= -O0 105 TOOL_MINGWW64_CXXFLAGS.release ?= -O2 106 TOOL_MINGWW64_CXXFLAGS.profile ?= -O2 #-pg 107 TOOL_MINGWW64_CXXINCS ?= 108 TOOL_MINGWW64_CXXDEFS ?= 109 110 TOOL_MINGWW64_ASFLAGS ?= -g -x assembler-with-cpp 111 TOOL_MINGWW64_ASOBJSUFF ?= .o 112 113 TOOL_MINGWW64_ARFLAGS ?= cr 114 TOOL_MINGWW64_ARLIBSUFF ?= .a 115 116 TOOL_MINGWW64_LDFLAGS ?= 117 TOOL_MINGWW64_LDFLAGS.debug ?= -g 118 TOOL_MINGWW64_LDFLAGS.release ?= -s 119 119 120 120 … … 131 131 # @param $(outbase) Output basename (full). Use this for list files and such. 132 132 # @param $(objsuff) Object suffix. 133 TOOL_MINGW 32_COMPILE_C_OUTPUT =134 TOOL_MINGW 32_COMPILE_C_DEPEND =135 TOOL_MINGW 32_COMPILE_C_DEPORD =136 define TOOL_MINGW 32_COMPILE_C_CMDS137 $(QUIET)$(TOOL_MINGW 32_CC) -c\133 TOOL_MINGWW64_COMPILE_C_OUTPUT = 134 TOOL_MINGWW64_COMPILE_C_DEPEND = 135 TOOL_MINGWW64_COMPILE_C_DEPORD = 136 define TOOL_MINGWW64_COMPILE_C_CMDS 137 $(QUIET)$(TOOL_MINGWW64_CC) -c\ 138 138 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ 139 139 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ … … 155 155 # @param $(outbase) Output basename (full). Use this for list files and such. 156 156 # @param $(objsuff) Object suffix. 157 TOOL_MINGW 32_COMPILE_CXX_OUTPUT =158 TOOL_MINGW 32_COMPILE_CXX_DEPEND =159 TOOL_MINGW 32_COMPILE_CXX_DEPORD =160 define TOOL_MINGW 32_COMPILE_CXX_CMDS161 $(QUIET)$(TOOL_MINGW 32_CXX) -c\157 TOOL_MINGWW64_COMPILE_CXX_OUTPUT = 158 TOOL_MINGWW64_COMPILE_CXX_DEPEND = 159 TOOL_MINGWW64_COMPILE_CXX_DEPORD = 160 define TOOL_MINGWW64_COMPILE_CXX_CMDS 161 $(QUIET)$(TOOL_MINGWW64_CXX) -c\ 162 162 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ 163 163 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ … … 180 180 # @param $(objsuff) Object suffix. 181 181 # 182 TOOL_MINGW 32_COMPILE_AS_OUTPUT =183 TOOL_MINGW 32_COMPILE_AS_DEPEND =184 TOOL_MINGW 32_COMPILE_AS_DEPORD =185 define TOOL_MINGW 32_COMPILE_AS_CMDS186 $(QUIET)$(TOOL_MINGW 32_AS) -c\182 TOOL_MINGWW64_COMPILE_AS_OUTPUT = 183 TOOL_MINGWW64_COMPILE_AS_DEPEND = 184 TOOL_MINGWW64_COMPILE_AS_DEPORD = 185 define TOOL_MINGWW64_COMPILE_AS_CMDS 186 $(QUIET)$(TOOL_MINGWW64_AS) -c\ 187 187 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ 188 188 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ … … 201 201 # 202 202 # @param $(outbase) Output basename (full). Use this for list files and such. 203 TOOL_MINGW 32_LINK_LIBRARY_OUTPUT = $(out).ar-script204 TOOL_MINGW 32_LINK_LIBRARY_DEPEND = $(othersrc)205 TOOL_MINGW 32_LINK_LIBRARY_DEPORD =206 define TOOL_MINGW 32_LINK_LIBRARY_CMDS203 TOOL_MINGWW64_LINK_LIBRARY_OUTPUT = $(out).ar-script 204 TOOL_MINGWW64_LINK_LIBRARY_DEPEND = $(othersrc) 205 TOOL_MINGWW64_LINK_LIBRARY_DEPORD = 206 define TOOL_MINGWW64_LINK_LIBRARY_CMDS 207 207 $(QUIET)$(APPEND) $(out).ar-script 'CREATE $(out)' 208 208 $(QUIET)$(APPEND) -n $(out).ar-script \ … … 211 211 $(QUIET)$(APPEND) $(out).ar-script 'SAVE' 212 212 $(QUIET)$(APPEND) $(out).ar-script 'END' 213 $(QUIET)$(TOOL_MINGW 32_AR) -M < $(out).ar-script213 $(QUIET)$(TOOL_MINGWW64_AR) -M < $(out).ar-script 214 214 endef 215 215 … … 230 230 # 231 231 # @param $(outbase) Output basename (full). Use this for list files and such. 232 TOOL_MINGW 32_LINK_PROGRAM_OUTPUT =233 TOOL_MINGW 32_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))234 TOOL_MINGW 32_LINK_PROGRAM_DEPORD =235 define TOOL_MINGW 32_LINK_PROGRAM_CMDS236 $(QUIET)$(TOOL_MINGW 32_LD) $(flags) -o $(out) $(objs)\232 TOOL_MINGWW64_LINK_PROGRAM_OUTPUT = 233 TOOL_MINGWW64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) 234 TOOL_MINGWW64_LINK_PROGRAM_DEPORD = 235 define TOOL_MINGWW64_LINK_PROGRAM_CMDS 236 $(QUIET)$(TOOL_MINGWW64_LD) $(flags) -o $(out) $(objs)\ 237 237 $(foreach p,$(libpath), -L$(p))\ 238 238 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) … … 253 253 # @param $(custom_post) Custom step invoked after linking. 254 254 # @param $(outbase) Output basename (full). Use this for list files and such. 255 TOOL_MINGW 32_LINK_DLL_OUTPUT =256 TOOL_MINGW 32_LINK_DLL_OUTPUT_MAYBE = $(outbase).a $(outbase).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).a255 TOOL_MINGWW64_LINK_DLL_OUTPUT = 256 TOOL_MINGWW64_LINK_DLL_OUTPUT_MAYBE = $(outbase).a $(outbase).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).a 257 257 ## @todo Find a better solution for installing the extra files (.a, .exp, .pdb, etc). 258 TOOL_MINGW 32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\258 TOOL_MINGWW64_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\ 259 259 $(filter %.def %.res,$(othersrc)) 260 TOOL_MINGW 32_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))261 define TOOL_MINGW 32_LINK_DLL_CMDS262 $(QUIET)$(TOOL_MINGW 32_DLLWRAP) $(flags)\260 TOOL_MINGWW64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) 261 define TOOL_MINGWW64_LINK_DLL_CMDS 262 $(QUIET)$(TOOL_MINGWW64_DLLWRAP) $(flags)\ 263 263 --dllname=$(out)\ 264 264 --output-exp=$(outbase).exp\
Note:
See TracChangeset
for help on using the changeset viewer.