Imported Upstream version 0.1.9998svn2577+dfsg
Felix Geyer
11 years ago
0 | # $Id: Config.kmk 2538 2011-08-02 20:00:46Z bird $ | |
0 | # $Id: Config.kmk 2555 2011-11-30 20:01:57Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # Build Configuration. |
3 | 3 | # |
47 | 47 | KBUILD_SVN_INFO_KMK := $(PATH_ROOT)/SvnInfo.kmk |
48 | 48 | KBUILD_SVN_INFO_DEP := $(KBUILD_SVN_INFO_KMK) |
49 | 49 | |
50 | else ifneq ($(wildcard $(PATH_ROOT)/.svn/entries),) | |
50 | else ifneq ($(wildcard $(PATH_ROOT)/.svn/entries $(PATH_ROOT)/../.svn/entries),) | |
51 | 51 | # Generate from svn info |
52 | 52 | KBUILD_SVN_INFO_KMK := $(PATH_OBJ)/SvnInfo.kmk |
53 | 53 | KBUILD_SVN_INFO_DEP := $(KBUILD_SVN_INFO_KMK) |
98 | 98 | # |
99 | 99 | # Various platform specific hacks. |
100 | 100 | # |
101 | ifn1of ($(KBUILD_TARGET), openbsd) | |
101 | ifn1of ($(KBUILD_TARGET), haiku openbsd) | |
102 | 102 | GCC_Wextra = -Wextra |
103 | 103 | endif |
104 | 104 | if1of ($(KBUILD_TARGET), openbsd) |
335 | 335 | TEMPLATE_BIN-THREADED = Threaded command line binary |
336 | 336 | TEMPLATE_BIN-THREADED_EXTENDS = BIN |
337 | 337 | TEMPLATE_BIN-THREADED_EXTENDS_BY = appending |
338 | if1of ($(KBUILD_TARGET), dragonfly freebsd openbsd) | |
338 | if1of ($(KBUILD_TARGET), dragonfly freebsd linux openbsd) | |
339 | 339 | TEMPLATE_BIN-THREADED_LIBS = pthread |
340 | 340 | endif |
341 | 341 |
0 | /* $Id: kkeys.e 2437 2011-03-28 19:17:08Z bird $ */ | |
0 | /* $Id: kkeys.e 2558 2012-02-13 12:36:03Z bird $ */ | |
1 | 1 | /** @file |
2 | 2 | * Bird's key additions to Visual Slickedit. |
3 | 3 | */ |
136 | 136 | { |
137 | 137 | col=p_col; |
138 | 138 | |
139 | /* virtual space hack*/ | |
139 | /* virtual space hack */ | |
140 | 140 | keyin(" "); |
141 | 141 | left(); |
142 | 142 | _delete_char(); |
144 | 144 | /* are we in a word, delete it? */ |
145 | 145 | ch = get_text(); |
146 | 146 | if (ch != ' ' && ch != "\t" && ch != "\r" && ch != "\n") |
147 | { | |
148 | /* Delete word and any trailing spaces, but stop at new line. */ | |
147 | 149 | delete_word(); |
148 | 150 | |
149 | /* delete spaces and newlines until the next word. */ | |
150 | ch = get_text(); | |
151 | if (ch == ' ' || ch == "\t" || ch == "\r" || ch == "\n") | |
152 | { | |
151 | ch = get_text(); | |
152 | if (ch == ' ' || ch == "\t" || ch == "\r" || ch == "\n") | |
153 | { | |
154 | if (search('[ \t]#','r+') == 0) | |
155 | { | |
156 | _nrseek(match_length('s')); | |
157 | _delete_text(match_length()); | |
158 | } | |
159 | } | |
160 | } | |
161 | else | |
162 | { | |
163 | /* delete spaces and newlines until the next word. */ | |
153 | 164 | if (search('[ \t\n\r]#','r+') == 0) |
154 | 165 | { |
155 | 166 | _nrseek(match_length('s')); |
159 | 170 | |
160 | 171 | p_col=col |
161 | 172 | //retrieve_command_results() |
162 | } | |
163 | ||
164 | _command kkeys_delete_left() | |
165 | { | |
166 | //denne virker ikkje som den skal!!! | |
167 | message "not implemented" | |
168 | /* | |
169 | return; | |
170 | col=p_col | |
171 | search('[ \t]#|?|$|^','r-'); | |
172 | if ( match_length()&& get_text(1,match_length('s'))=='' ) | |
173 | { | |
174 | _nrseek(match_length('s')); | |
175 | _delete_text(match_length()); | |
176 | } | |
177 | else | |
178 | delete_word(); | |
179 | p_col=col | |
180 | */ | |
181 | 173 | } |
182 | 174 | |
183 | 175 | _command kkeys_scroll_up() |
0 | 0 | #!/bin/sh |
1 | # $Id: env.sh 2413 2010-09-11 17:43:04Z bird $ | |
1 | # $Id: env.sh 2546 2011-10-01 19:49:54Z bird $ | |
2 | 2 | ## @file |
3 | 3 | # Environment setup script. |
4 | 4 | # |
263 | 263 | KBUILD_HOST=freebsd |
264 | 264 | ;; |
265 | 265 | |
266 | Haiku) | |
267 | KBUILD_HOST=haiku | |
268 | ;; | |
269 | ||
266 | 270 | linux|Linux|GNU/Linux|LINUX) |
267 | 271 | KBUILD_HOST=linux |
268 | 272 | ;; |
321 | 325 | x86_64|AMD64|amd64|k8|k8l|k9|k10) |
322 | 326 | KBUILD_HOST_ARCH='amd64' |
323 | 327 | ;; |
324 | x86|i86pc|ia32|i[3456789]86) | |
328 | x86|i86pc|ia32|i[3456789]86|BePC) | |
325 | 329 | KBUILD_HOST_ARCH='x86' |
326 | 330 | ;; |
327 | 331 | sparc32|sparc|sparcv8|sparcv7|sparcv8e) |
0 | # $Id: footer-pass1.kmk 2523 2011-07-31 23:45:20Z bird $ | |
0 | # $Id: footer-pass1.kmk 2551 2011-11-09 13:28:02Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild - Footer - Target lists - Pass 1. |
3 | 3 | # |
179 | 179 | $(target)_1_DEBUG_INSTTYPE := $(debug_insttype) |
180 | 180 | |
181 | 181 | if1of ($(debug_insttype), stage both) |
182 | ifn1of ($(insttype), stage both) | |
183 | $(error kBuild: DEBUG_INSTTYPE=$(debug_insttype) and INSTTYPE=$(insttype) for target '$(target)' are not compatible) | |
184 | endif | |
185 | 182 | local debug_stage := $(firstdefined \ |
186 | 183 | $(target)_DEBUG_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ |
187 | 184 | $(target)_DEBUG_STAGE.$(bld_trg).$(bld_trg_arch) \ |
212 | 209 | endif |
213 | 210 | |
214 | 211 | if1of ($(debug_insttype), both) |
215 | ifn1of ($(insttype), both) | |
216 | $(error kBuild: DEBUG_INSTTYPE=$(debug_insttype) and INSTTYPE=$(insttype) for target '$(target)' are not compatible) | |
217 | endif | |
218 | 212 | local debug_inst := $(firstdefined \ |
219 | 213 | $(target)_DEBUG_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ |
220 | 214 | $(target)_DEBUG_INST.$(bld_trg).$(bld_trg_arch) \ |
0 | # $Id: footer-pass2-compiling-targets.kmk 2537 2011-08-02 19:44:43Z bird $ | |
0 | # $Id: footer-pass2-compiling-targets.kmk 2551 2011-11-09 13:28:02Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild - Footer - Target lists - Pass 2 - Compiling Targets. |
3 | 3 | # |
346 | 346 | # @param $(typevar) The name of the variable with all the root targets of its type. |
347 | 347 | # @param $(target_type_mode) The default file mode implied by the target type. |
348 | 348 | define def_target_install_only |
349 | ifneq ($($(target)_1_INSTTYPE),none) | |
349 | if1of ($($(target)_1_INSTTYPE) $($(target)_1_DEBUG_INSTTYPE), both stage) | |
350 | # Determin common variables. | |
350 | 351 | local mode := $(firstword \ |
351 | 352 | $($(target)_MODE.$(bld_trg).$(bld_trg_arch).$(bld_type)) \ |
352 | 353 | $($(target)_MODE.$(bld_trg).$(bld_trg_arch)) \ |
374 | 375 | $($(target)_GID) ) |
375 | 376 | local pre_install_cmds := $(evalcall def_fn_prop_get_first_defined,PRE_INST_CMDS) |
376 | 377 | local post_install_cmds := $(evalcall def_fn_prop_get_first_defined,POST_INST_CMDS) |
377 | ||
378 | endif | |
379 | ||
380 | ifneq ($($(target)_1_INSTTYPE),none) | |
378 | 381 | # Generate the rules |
379 | 382 | ifeq ($($(target)_1_INSTTYPE),both) |
380 | 383 | $(eval $(def_link_install_rule)) |
0 | # $Id: header.kmk 2537 2011-08-02 19:44:43Z bird $ | |
0 | # $Id: header.kmk 2577 2012-06-04 11:01:00Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild - File included at top of a makefile. |
3 | 3 | # |
78 | 78 | # The revision in which this file was last modified. |
79 | 79 | # This can be useful when using development versions of kBuild. |
80 | 80 | # |
81 | KMK_REVISION := $(patsubst %:,, $Rev: 2537 $ ) | |
81 | KMK_REVISION := $(patsubst %:,, $Rev: 2577 $ ) | |
82 | 82 | |
83 | 83 | |
84 | 84 | # |
187 | 187 | # this keyword namespace is shared between OSes, architectures, cpus and |
188 | 188 | # build types. (PORTME) |
189 | 189 | # |
190 | KBUILD_OSES := darwin dos dragonfly freebsd l4 linux netbsd nt openbsd os2 solaris win os-agnostic | |
191 | KBUILD_ARCHES := x86 amd64 sparc32 sparc64 s390 s390x ppc32 ppc64 mips32 mips64 ia64 hppa32 hppa64 arm alpha | |
190 | KBUILD_OSES := darwin dos dragonfly freebsd haiku l4 linux netbsd nt openbsd os2 solaris win os-agnostic | |
191 | KBUILD_ARCHES := x86 amd64 sparc32 sparc64 s390 s390x ppc32 ppc64 mips32 mips64 ia64 hppa32 hppa64 arm alpha | |
192 | KBUILD_ARCHES_64 := amd64 sparc64 s390x ppc64 mips64 ia64 hppa64 alpha | |
193 | KBUILD_ARCHES_32 := x86 sparc32 s390 ppc32 mips32 hppa32 arm | |
192 | 194 | |
193 | 195 | |
194 | 196 | # |
960 | 962 | MODE UID GID LD_DEBUG DEBUG_INSTTYPE DEBUG_INST DEBUG_STAGE |
961 | 963 | ## PROPS_SINGLE_LNK |
962 | 964 | # Subset of PROPS_SINGLE which applies to all linkable targets. |
963 | PROPS_SINGLE_LNK := TOOL TEMPLATE CTOOL CXXTOOL OBJCTOOL OBJCXXTOOL ASTOOL RCTOOL \ | |
964 | INST NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU \ | |
965 | OBJSUFF COBJSUFF CXXOBJSUFF OBJCOBJSUFF OBJCXXOBJSUFF ASOBJSUFF RCOBJSUFF \ | |
966 | MODE UID GID LD_DEBUG DEBUG_INSTTYPE DEBUG_INST DEBUG_STAGE | |
965 | PROPS_SINGLE_LNK := $(filter-out FETCHTOOL UNPACKTOOL PATCHTOOL FETCHDIR, $(PROPS_SINGLE)) | |
967 | 966 | |
968 | 967 | ## PROPS_DEFERRED |
969 | 968 | # This list of non-accumulative target properties which are or may be |
991 | 990 | FETCHFLAGS UNPACKFLAGS PATCHFLAGS |
992 | 991 | ## PROPS_ACCUMULATE_R_LNK |
993 | 992 | # Subset of PROPS_ACCUMULATE_R which applies to all linkable targets. |
994 | PROPS_ACCUMULATE_R_LNK := \ | |
995 | DEPS LNK_DEPS ORDERDEPS LNK_ORDERDEPS DEFS \ | |
996 | CFLAGS CDEFS \ | |
997 | CXXFLAGS CXXDEFS \ | |
998 | OBJCFLAGS OBJCDEFS \ | |
999 | OBJCXXFLAGS OBJCXXDEFS \ | |
1000 | ASFLAGS ASDEFS \ | |
1001 | RCFLAGS RCDEFS \ | |
1002 | IDFLAGS IFFLAGS ISFLAGS | |
993 | PROPS_ACCUMULATE_R_LNK := $(filter-out ARFLAGS LDFLAGS EXEC_IFFLAGS FETCHFLAGS UNPACKFLAGS PATCHFLAGS, $(PROPS_ACCUMULATE_R)) | |
1003 | 994 | |
1004 | 995 | ## PROPS_ACCUMULATE |
1005 | 996 | # The list of accumulative target properties where the left most value/flag |
1013 | 1004 | DIRS BLDDIRS CLEAN |
1014 | 1005 | ## PROPS_ACCUMULATE_L_LNK |
1015 | 1006 | # Subset of PROPS_ACCUMULATE_L which applies to all linkable targets. |
1016 | PROPS_ACCUMULATE_L_LNK := \ | |
1017 | SDKS USES SOURCES SRC_HANDLERS INTERMEDIATES \ | |
1018 | INCS CINCS CXXINCS OBJCINCS OBJCXXINCS ASINCS RCINCS \ | |
1019 | BLDDIRS CLEAN | |
1007 | PROPS_ACCUMULATE_L_LNK := $(filter-out LIBS LIBPATH EXEC_SOURCES DIRS, $(PROPS_ACCUMULATE_L)) | |
1020 | 1008 | |
1021 | 1009 | ## PROPS_ALL |
1022 | 1010 | # List of all the properties. |
1064 | 1052 | |
1065 | 1053 | ## @name Properties valid on installs (INSTALLS) |
1066 | 1054 | ## @{ |
1067 | PROPS_INSTALLS_SINGLE := TOOL TEMPLATE INST NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU MODE UID GID | |
1055 | PROPS_INSTALLS_SINGLE := TOOL TEMPLATE INSTTYPE INST STAGE NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU MODE UID GID | |
1068 | 1056 | PROPS_INSTALLS_DEFERRED := INSTFUN INSTALLER PRE_FILE_CMDS POST_FILE_CMDS PRE_SYMLINK_CMDS POST_SYMLINK_CMDS \ |
1069 | 1057 | PRE_DIRECTORY_CMDS POST_DIRECTORY_CMDS |
1070 | 1058 | PROPS_INSTALLS_ACCUMULATE_R := DEPS ORDERDEPS GOALS INST_ONLY_GOALS STAGE_ONLY_GOALS IFFLAGS EXEC_IFFLAGS |
1264 | 1252 | export KBUILD_USE_KOBJCACHE := $(USE_KOBJCACHE) |
1265 | 1253 | endif |
1266 | 1254 | endif |
1255 | ||
1256 | ||
1257 | # | |
1258 | # Library path searching hints (target OS + arch). | |
1259 | # | |
1260 | # KBUILD_LIB_SEARCH_SUBS - Subdirs typically containing the right libraries. | |
1261 | # KBUILD_LIB_SEARCH_ROOTS - Roots to search for library subdirs. | |
1262 | # KBUILD_LIB_SEARCH_PATHS - ROOTS + SUBS. | |
1263 | # | |
1264 | ifeq ($(KBUILD_TARGET),darwin) | |
1265 | KBUILD_LIB_SEARCH_ROOTS := \ | |
1266 | /usr/ \ | |
1267 | /Developer/usr/ | |
1268 | KBUILD_LIB_SEARCH_SUBS := lib/ | |
1269 | ||
1270 | else if1of ($(KBUILD_TARGET), freebsd netbsd openbsd dragonfly) | |
1271 | KBUILD_LIB_SEARCH_ROOTS := \ | |
1272 | / \ | |
1273 | /usr/ \ | |
1274 | /usr/local/ | |
1275 | KBUILD_LIB_SEARCH_SUBS := lib/ | |
1276 | ||
1277 | else ifeq ($(KBUILD_TARGET),linux) | |
1278 | KBUILD_LIB_SEARCH_ROOTS := \ | |
1279 | / \ | |
1280 | /usr/ \ | |
1281 | /usr/local/ | |
1282 | ifeq ($(KBUILD_TARGET_ARCH),amd64) | |
1283 | KBUILD_LIB_SEARCH_SUBS := \ | |
1284 | lib/x86_64-linux-gnu/ \ | |
1285 | lib64/ \ | |
1286 | lib/ | |
1287 | else ifeq ($(KBUILD_TARGET_ARCH),x86) | |
1288 | KBUILD_LIB_SEARCH_SUBS := \ | |
1289 | lib/i686-linux-gnu/ \ | |
1290 | lib/i386-linux-gnu/ \ | |
1291 | lib32/ \ | |
1292 | lib/ | |
1293 | else | |
1294 | KBUILD_LIB_SEARCH_SUBS := lib/ | |
1295 | endif | |
1296 | ||
1297 | else ifeq ($(KBUILD_TARGET),solaris) | |
1298 | KBUILD_LIB_SEARCH_ROOTS := \ | |
1299 | / \ | |
1300 | /usr/ \ | |
1301 | /usr/sfw/ \ | |
1302 | /usr/local/ \ | |
1303 | /sw/ | |
1304 | ifeq ($(KBUILD_TARGET_ARCH),amd64) | |
1305 | KBUILD_LIB_SEARCH_SUBS := lib/amd64/ lib/ | |
1306 | else ifeq ($(KBUILD_TARGET_ARCH),sparc64) | |
1307 | KBUILD_LIB_SEARCH_SUBS := lib/sparcv9/ lib/ | |
1308 | else | |
1309 | KBUILD_LIB_SEARCH_SUBS := lib/ | |
1310 | endif | |
1311 | ||
1312 | else | |
1313 | KBUILD_LIB_SEARCH_SUBS := | |
1314 | KBUILD_LIB_SEARCH_ROOTS := | |
1315 | endif | |
1316 | KBUILD_LIB_SEARCH_PATHS := $(foreach root, $(KBUILD_LIB_SEARCH_ROOTS), $(addprefix $(root),$(KBUILD_LIB_SEARCH_SUBS))) | |
1267 | 1317 | |
1268 | 1318 | |
1269 | 1319 | # |
0 | # $Id: LIBSDL.kmk 2413 2010-09-11 17:43:04Z bird $ | |
0 | # $Id: LIBSDL.kmk 2566 2012-03-02 12:58:25Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild SDK - Simple DirectMedia Layer, targeting $(KBUILD_TARGET). |
3 | 3 | # |
56 | 56 | endif |
57 | 57 | |
58 | 58 | ifeq ($(PATH_SDK_LIBSDL),) |
59 | # Search in the typical unix places. | |
60 | ifeq ($(filter-out %64,$(KBUILD_TARGET_ARCH)),) | |
61 | PATH_SDK_LIBSDL := $(firstword $(wildcard \ | |
62 | /lib64/libSDL.* \ | |
63 | /lib/libSDL.* \ | |
64 | /usr/lib64/libSDL.* \ | |
65 | /usr/lib/libSDL.* \ | |
66 | /usr/local/lib64/libSDL.* \ | |
67 | /usr/local/lib/libSDL.* \ | |
68 | /opt/lib64/libSDL.* \ | |
69 | /opt/lib/libSDL.* \ | |
70 | /opt/local/lib64/libSDL.* \ | |
71 | /opt/local/lib/libSDL.* \ | |
72 | /sw/lib64/libSDL.* \ | |
73 | /sw/lib/libSDL.* \ | |
74 | ) ) | |
75 | else | |
76 | PATH_SDK_LIBSDL := $(firstword $(wildcard \ | |
77 | /lib32/libSDL.* \ | |
78 | /lib/libSDL.* \ | |
79 | /usr/lib32/libSDL.* \ | |
80 | /usr/lib/libSDL.* \ | |
81 | /usr/local/lib32/libSDL.* \ | |
82 | /usr/local/lib/libSDL.* \ | |
83 | /opt/lib32/libSDL.* \ | |
84 | /opt/lib/libSDL.* \ | |
85 | /opt/local/lib32/libSDL.* \ | |
86 | /opt/local/lib/libSDL.* \ | |
87 | /sw/lib32/libSDL.* \ | |
88 | /sw/lib/libSDL.* \ | |
89 | ) ) | |
90 | endif | |
91 | ifneq ($(PATH_SDK_LIBSDL),) | |
92 | PATH_SDK_LIBSDL := $(patsubst %/,%,$(dir $(patsubst %/,%,$(dir $(PATH_SDK_LIBSDL))))) | |
59 | PATH_SDK_LIBSDL := $(firstword $(foreach root,$(KBUILD_LIB_SEARCH_ROOTS) \ | |
60 | ,$(if $(wildcard $(addsuffix libSDL.*,$(addprefix $(root),$(KBUILD_LIB_SEARCH_SUBS)))),$(root),) )) | |
61 | ifeq ($(PATH_SDK_LIBSDL),/) | |
62 | PATH_SDK_LIBSDL := /. | |
63 | else ifneq ($(PATH_SDK_LIBSDL),) | |
64 | PATH_SDK_LIBSDL := $(patsubst %/,%,$(PATH_SDK_LIBSDL)) | |
93 | 65 | else |
94 | 66 | $(warning kBuild: PATH_SDK_LIBSDL couldn't be determined!) |
95 | 67 | PATH_SDK_LIBSDL := $(PATH_DEVTOOLS_TRG)/libsdl/not/found |
0 | # $Id: GCC.kmk 2541 2011-08-03 09:51:30Z bird $ | |
0 | # $Id: GCC.kmk 2545 2011-09-13 19:09:05Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Generic GCC Using The System GCC. |
3 | 3 | # |
204 | 204 | define TOOL_GCC_LINK_PROGRAM_CMDS |
205 | 205 | $(QUIET)$(TOOL_GCC_LD) $(flags) -o $(out) $(objs) \ |
206 | 206 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
207 | if1of ($(ld_debug), split) | |
208 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC.) | |
209 | endif | |
210 | 207 | endef |
211 | 208 | |
212 | 209 | |
229 | 226 | define TOOL_GCC_LINK_DLL_CMDS |
230 | 227 | $(QUIET)$(TOOL_GCC_LD) $(TOOL_GCC_LDFLAGS.dll) $(flags) -o $(out) $(objs) \ |
231 | 228 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
232 | if1of ($(ld_debug), split) | |
233 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC.) | |
234 | endif | |
235 | endef | |
236 | ||
229 | endef | |
230 |
0 | # $Id: GCC3OMF.kmk 2534 2011-08-02 14:13:06Z bird $ | |
0 | # $Id: GCC3OMF.kmk 2545 2011-09-13 19:09:05Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - GCC v3 targeting OS/2 OMF. |
3 | 3 | # |
251 | 251 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
252 | 252 | -Zmap=$(outbase).map |
253 | 253 | $(QUIET)$(TOOL_GCC3OMF_LD) @$(outbase).rsp |
254 | if1of ($(ld_debug), split) | |
255 | $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GCC3OMF.) | |
256 | endif | |
257 | 254 | endef |
258 | 255 | |
259 | 256 | |
285 | 282 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
286 | 283 | -Zmap=$(outbase).map |
287 | 284 | $(TOOL_GCC3OMF_LD) @$(outbase).rsp |
288 | if1of ($(ld_debug), split) | |
289 | $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GCC3OMF.) | |
290 | endif | |
291 | 285 | endef |
292 | 286 | |
293 | 287 | |
319 | 313 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
320 | 314 | -Zmap=$(outbase).map |
321 | 315 | $(QUIET)$(TOOL_GCC3OMF_LD_SYSMOD) @$(outbase).rsp |
322 | if1of ($(ld_debug), split) | |
323 | $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GCC3OMF.) | |
324 | endif | |
325 | endef | |
326 | ||
316 | endef | |
317 |
0 | # $Id: GCC3PLAIN.kmk 2541 2011-08-03 09:51:30Z bird $ | |
0 | # $Id: GCC3PLAIN.kmk 2545 2011-09-13 19:09:05Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Generic GCC v3.2.x or later Using The System GCC, any Unix Linker and Unix Archiver. |
3 | 3 | # |
256 | 256 | $(filter %.def, $(othersrc))\ |
257 | 257 | $(foreach p,$(libpath), -L$(p))\ |
258 | 258 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
259 | if1of ($(ld_debug), split) | |
260 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC3PLAIN.) | |
261 | endif | |
262 | 259 | endef |
263 | 260 | |
264 | 261 | |
287 | 284 | $(filter %.def, $(othersrc))\ |
288 | 285 | $(foreach p,$(libpath), -L$(p))\ |
289 | 286 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
290 | if1of ($(ld_debug), split) | |
291 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC3PLAIN.) | |
292 | endif | |
293 | 287 | endef |
294 | 288 | |
295 | 289 | |
321 | 315 | $(filter %.def, $(othersrc))\ |
322 | 316 | $(foreach p,$(libpath), -L$(p))\ |
323 | 317 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
324 | if1of ($(ld_debug), split) | |
325 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GCC3PLAIN.) | |
326 | endif | |
327 | endef | |
328 | ||
318 | endef | |
319 |
0 | # $Id: GCC42MACHO.kmk 2547 2011-11-04 21:58:53Z bird $ | |
1 | ## @file | |
2 | # kBuild Tool Config - GCC v4.2.x targeting Darwin (Mac OS X) Mach-O. | |
3 | # | |
4 | ||
5 | # | |
6 | # Copyright (c) 2004-2011 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | # | |
8 | # This file is part of kBuild. | |
9 | # | |
10 | # kBuild is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 2 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # kBuild is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with kBuild; if not, write to the Free Software | |
22 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 | # | |
24 | # | |
25 | # As a special exception you are granted permission to include this file, via | |
26 | # the kmk include directive, as you wish without this in itself causing the | |
27 | # resulting makefile, program or whatever to be covered by the GPL license. | |
28 | # This exception does not however invalidate any other reasons why the makefile, | |
29 | # program, whatever should not be covered the GPL. | |
30 | # | |
31 | # | |
32 | ||
33 | TOOL_GCC42MACHO := GCC v4.2.x targeting Darwin (Mac OS X) Mach-O. | |
34 | ||
35 | # Tool Specific Properties | |
36 | TOOL_GCC42MACHO_PREFIX ?= | |
37 | TOOL_GCC42MACHO_SUFFIX ?= -4.2$(HOSTSUFF_EXE) | |
38 | TOOL_GCC42MACHO_CC ?= $(TOOL_GCC42MACHO_PREFIX)gcc$(TOOL_GCC42MACHO_SUFFIX) | |
39 | TOOL_GCC42MACHO_CXX ?= $(TOOL_GCC42MACHO_PREFIX)g++$(TOOL_GCC42MACHO_SUFFIX) | |
40 | TOOL_GCC42MACHO_OBJC ?= $(TOOL_GCC42MACHO_PREFIX)gcc$(TOOL_GCC42MACHO_SUFFIX) | |
41 | TOOL_GCC42MACHO_OBJCXX ?= $(TOOL_GCC42MACHO_PREFIX)gcc$(TOOL_GCC42MACHO_SUFFIX) | |
42 | TOOL_GCC42MACHO_AS ?= $(TOOL_GCC42MACHO_PREFIX)gcc$(TOOL_GCC42MACHO_SUFFIX) | |
43 | TOOL_GCC42MACHO_LD ?= $(TOOL_GCC42MACHO_PREFIX)gcc$(TOOL_GCC42MACHO_SUFFIX) | |
44 | TOOL_GCC42MACHO_LD_SYSMOD ?= $(TOOL_GCC42MACHO_PREFIX)gcc$(TOOL_GCC42MACHO_SUFFIX) | |
45 | ifndef TOOL_GCC42MACHO_LDFLAGS.$(KBUILD_TARGET) | |
46 | TOOL_GCC42MACHO_LDFLAGS.dll ?= -dynamiclib | |
47 | else | |
48 | TOOL_GCC42MACHO_LDFLAGS.dll ?= $(TOOL_GCC42MACHO_LDFLAGS.$(KBUILD_TARGET)) | |
49 | endif | |
50 | TOOL_GCC42MACHO_LDFLAGS.sysmod ?= -r | |
51 | #TOOL_GCC42MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) | |
52 | TOOL_GCC42MACHO_DSYMUTIL ?= dsymutil | |
53 | ||
54 | ifdef SLKRUNS | |
55 | TOOL_GCC42MACHO_CC += -fmessage-length=0 | |
56 | TOOL_GCC42MACHO_CXX += -fmessage-length=0 | |
57 | TOOL_GCC42MACHO_OBJC += -fmessage-length=0 | |
58 | TOOL_GCC42MACHO_OBJCXX += -fmessage-length=0 | |
59 | endif | |
60 | ||
61 | # General Properties used by kBuild | |
62 | TOOL_GCC42MACHO_COBJSUFF ?= .o | |
63 | TOOL_GCC42MACHO_CFLAGS ?= | |
64 | TOOL_GCC42MACHO_CFLAGS.debug ?= -g | |
65 | TOOL_GCC42MACHO_CFLAGS.profile ?= -g -O2 #-pg | |
66 | TOOL_GCC42MACHO_CFLAGS.release ?= -O2 | |
67 | TOOL_GCC42MACHO_CINCS ?= | |
68 | TOOL_GCC42MACHO_CDEFS ?= | |
69 | ||
70 | TOOL_GCC42MACHO_CXXOBJSUFF ?= .o | |
71 | TOOL_GCC42MACHO_CXXFLAGS ?= | |
72 | TOOL_GCC42MACHO_CXXFLAGS.debug ?= -g | |
73 | TOOL_GCC42MACHO_CXXFLAGS.profile ?= -g -O2 #-pg | |
74 | TOOL_GCC42MACHO_CXXFLAGS.release ?= -O2 | |
75 | TOOL_GCC42MACHO_CXXINCS ?= | |
76 | TOOL_GCC42MACHO_CXXDEFS ?= | |
77 | ||
78 | TOOL_GCC42MACHO_OBJCOBJSUFF ?= .o | |
79 | TOOL_GCC42MACHO_OBJCFLAGS ?= | |
80 | TOOL_GCC42MACHO_OBJCFLAGS.debug ?= -g | |
81 | TOOL_GCC42MACHO_OBJCFLAGS.profile?= -O2 #-g -pg | |
82 | TOOL_GCC42MACHO_OBJCFLAGS.release?= -O2 | |
83 | TOOL_GCC42MACHO_OBJCINCS ?= | |
84 | TOOL_GCC42MACHO_OBJCDEFS ?= | |
85 | ||
86 | TOOL_GCC42MACHO_OBJCXXOBJSUFF ?= .o | |
87 | TOOL_GCC42MACHO_OBJCXXFLAGS ?= | |
88 | TOOL_GCC42MACHO_OBJCXXFLAGS.debug ?= -g | |
89 | TOOL_GCC42MACHO_OBJCXXFLAGS.profile ?= -O2 #-g -pg | |
90 | TOOL_GCC42MACHO_OBJCXXFLAGS.release ?= -O2 | |
91 | TOOL_GCC42MACHO_OBJCXXINCS ?= | |
92 | TOOL_GCC42MACHO_OBJCXXDEFS ?= | |
93 | ||
94 | TOOL_GCC42MACHO_ASFLAGS ?= -x assembler-with-cpp | |
95 | TOOL_GCC42MACHO_ASFLAGS.debug ?= -g | |
96 | TOOL_GCC42MACHO_ASFLAGS.profile ?= -g | |
97 | TOOL_GCC42MACHO_ASOBJSUFF ?= .o | |
98 | ||
99 | TOOL_GCC42MACHO_AR ?= ar$(HOSTSUFF_EXE) | |
100 | TOOL_GCC42MACHO_ARFLAGS ?= -c -rs | |
101 | TOOL_GCC42MACHO_ARLIBSUFF ?= .a | |
102 | ||
103 | TOOL_GCC42MACHO_LDFLAGS ?= | |
104 | TOOL_GCC42MACHO_LDFLAGS.debug ?= -g | |
105 | TOOL_GCC42MACHO_LDFLAGS.profile ?= -g | |
106 | ||
107 | TOOL_GCC42MACHO_STRIP_PROGRAM ?= strip -SXxru | |
108 | TOOL_GCC42MACHO_STRIP_DLL ?= strip -Sxru | |
109 | TOOL_GCC42MACHO_STRIP_SYSMOD ?= strip -Sru | |
110 | ||
111 | ||
112 | ## | |
113 | # Calculate the files in the debug bundle. | |
114 | # @param 1 The whole output filename. | |
115 | # @param 2 The output filename sans suffix. | |
116 | TOOL_GCC42MACHO_DEBUG_BUNDLE_FN = \ | |
117 | $(1).dSYM/ \ | |
118 | $(1).dSYM/Contents/ \ | |
119 | $(1).dSYM/Contents/Resources/ \ | |
120 | $(1).dSYM/Contents/Resources/DWARF/ \ | |
121 | $(1).dSYM/Contents/Info.plist \ | |
122 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1)) | |
123 | ||
124 | ## | |
125 | # Calculate the files in the debug bundle. | |
126 | # @param 1 The whole linker output filename. | |
127 | # @param 2 The linker output filename sans suffix. | |
128 | # @param 3 The desired install name (no dir slash). | |
129 | # @remarks The Info.plist has some reference to the original name, but gdb | |
130 | # does not care and only check for a symbol file in the DWARF | |
131 | # directory with the same name as the debugged module. | |
132 | TOOL_GCC42MACHO_DEBUG_INSTALL_FN= \ | |
133 | $(3).dSYM/ \ | |
134 | $(3).dSYM/Contents/ \ | |
135 | $(3).dSYM/Contents/Resources/ \ | |
136 | $(3).dSYM/Contents/Resources/DWARF/ \ | |
137 | $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \ | |
138 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(3)) | |
139 | ||
140 | ||
141 | ## Compile C source. | |
142 | # @param $(target) Normalized main target name. | |
143 | # @param $(source) Source filename (relative). | |
144 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
145 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
146 | # @param $(flags) Flags. | |
147 | # @param $(defs) Definitions. No -D or something. | |
148 | # @param $(incs) Includes. No -I or something. | |
149 | # @param $(dirdep) Directory creation dependency. | |
150 | # @param $(deps) Other dependencies. | |
151 | # | |
152 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
153 | # @param $(objsuff) Object suffix. | |
154 | TOOL_GCC42MACHO_COMPILE_C_DEPEND = | |
155 | TOOL_GCC42MACHO_COMPILE_C_DEPORD = | |
156 | ifdef KBUILD_USE_KOBJCACHE | |
157 | TOOL_GCC42MACHO_COMPILE_C_USES_KOBJCACHE = 1 | |
158 | TOOL_GCC42MACHO_COMPILE_C_OUTPUT = $(outbase).i | |
159 | define TOOL_GCC42MACHO_COMPILE_C_CMDS | |
160 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
161 | --kObjCache-cpp $(outbase).i\ | |
162 | $(TOOL_GCC42MACHO_CC) -E -o -\ | |
163 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
164 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
165 | $(abspath $(source))\ | |
166 | --kObjCache-cc $(obj)\ | |
167 | $(TOOL_GCC42MACHO_CC) -c\ | |
168 | $(flags) -fpreprocessed -x c\ | |
169 | -o $(obj)\ | |
170 | - | |
171 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
172 | endef | |
173 | else # !KBUILD_USE_KOBJCACHE | |
174 | TOOL_GCC42MACHO_COMPILE_C_OUTPUT = | |
175 | define TOOL_GCC42MACHO_COMPILE_C_CMDS | |
176 | $(QUIET)$(TOOL_GCC42MACHO_CC) -c\ | |
177 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
178 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
179 | -o $(obj)\ | |
180 | $(abspath $(source)) | |
181 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
182 | endef | |
183 | endif # !KUSE_OBJCACHE | |
184 | ||
185 | ||
186 | ## Compile C++ source. | |
187 | # @param $(target) Normalized main target name. | |
188 | # @param $(source) Source filename (relative). | |
189 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
190 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
191 | # @param $(flags) Flags. | |
192 | # @param $(defs) Definitions. No -D or something. | |
193 | # @param $(incs) Includes. No -I or something. | |
194 | # @param $(dirdep) Directory creation dependency. | |
195 | # @param $(deps) Other dependencies. | |
196 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
197 | # @param $(objsuff) Object suffix. | |
198 | TOOL_GCC42MACHO_COMPILE_CXX_DEPEND = | |
199 | TOOL_GCC42MACHO_COMPILE_CXX_DEPORD = | |
200 | ifdef KBUILD_USE_KOBJCACHE | |
201 | TOOL_GCC42MACHO_COMPILE_CXX_USES_KOBJCACHE = 1 | |
202 | TOOL_GCC42MACHO_COMPILE_CXX_OUTPUT = $(outbase).ii | |
203 | define TOOL_GCC42MACHO_COMPILE_CXX_CMDS | |
204 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
205 | --kObjCache-cpp $(outbase).ii\ | |
206 | $(TOOL_GCC42MACHO_CXX) -E -o -\ | |
207 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
208 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
209 | $(abspath $(source))\ | |
210 | --kObjCache-cc $(obj)\ | |
211 | $(TOOL_GCC42MACHO_CXX) -c\ | |
212 | $(flags) -fpreprocessed -x c++\ | |
213 | -o $(obj)\ | |
214 | - | |
215 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
216 | endef | |
217 | else # !KBUILD_USE_KOBJCACHE | |
218 | TOOL_GCC42MACHO_COMPILE_CXX_OUTPUT = | |
219 | define TOOL_GCC42MACHO_COMPILE_CXX_CMDS | |
220 | $(QUIET)$(TOOL_GCC42MACHO_CXX) -c\ | |
221 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
222 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
223 | -o $(obj)\ | |
224 | $(abspath $(source)) | |
225 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
226 | endef | |
227 | endif # !KBUILD_USE_KOBJCACHE | |
228 | ||
229 | ||
230 | ## Compile Objective-C source. | |
231 | # @param $(target) Normalized main target name. | |
232 | # @param $(source) Source filename (relative). | |
233 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
234 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
235 | # @param $(flags) Flags. | |
236 | # @param $(defs) Definitions. No -D or something. | |
237 | # @param $(incs) Includes. No -I or something. | |
238 | # @param $(dirdep) Directory creation dependency. | |
239 | # @param $(deps) Other dependencies. | |
240 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
241 | # @param $(objsuff) Object suffix. | |
242 | TOOL_GCC42MACHO_COMPILE_OBJC_DEPEND = | |
243 | TOOL_GCC42MACHO_COMPILE_OBJC_DEPORD = | |
244 | ifdef KBUILD_USE_KOBJCACHE | |
245 | TOOL_GCC42MACHO_COMPILE_OBJC_USES_KOBJCACHE = 1 | |
246 | TOOL_GCC42MACHO_COMPILE_OBJC_OUTPUT = $(outbase).mi | |
247 | define TOOL_GCC42MACHO_COMPILE_OBJC_CMDS | |
248 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
249 | --kObjCache-cpp $(outbase).ii\ | |
250 | $(TOOL_GCC42MACHO_OBJC) -E -o -\ | |
251 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
252 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
253 | $(abspath $(source))\ | |
254 | --kObjCache-cc $(obj)\ | |
255 | $(TOOL_GCC42MACHO_OBJC) -c\ | |
256 | $(flags) -fpreprocessed -x cbjective-c\ | |
257 | -o $(obj)\ | |
258 | - | |
259 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
260 | endef | |
261 | else # !KBUILD_USE_KOBJCACHE | |
262 | TOOL_GCC42MACHO_COMPILE_OBJC_OUTPUT = | |
263 | define TOOL_GCC42MACHO_COMPILE_OBJC_CMDS | |
264 | $(QUIET)$(TOOL_GCC42MACHO_OBJC) -c\ | |
265 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
266 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
267 | -o $(obj)\ | |
268 | $(abspath $(source)) | |
269 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
270 | endef | |
271 | endif # !KBUILD_USE_KOBJCACHE | |
272 | ||
273 | ||
274 | ## Compile Objective-C++ source. | |
275 | # @param $(target) Normalized main target name. | |
276 | # @param $(source) Source filename (relative). | |
277 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
278 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
279 | # @param $(flags) Flags. | |
280 | # @param $(defs) Definitions. No -D or something. | |
281 | # @param $(incs) Includes. No -I or something. | |
282 | # @param $(dirdep) Directory creation dependency. | |
283 | # @param $(deps) Other dependencies. | |
284 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
285 | # @param $(objsuff) Object suffix. | |
286 | TOOL_GCC42MACHO_COMPILE_OBJCXX_DEPEND = | |
287 | TOOL_GCC42MACHO_COMPILE_OBJCXX_DEPORD = | |
288 | ifdef KBUILD_USE_KOBJCACHE | |
289 | TOOL_GCC42MACHO_COMPILE_OBJCXX_USES_KOBJCACHE = 1 | |
290 | TOOL_GCC42MACHO_COMPILE_OBJCXX_OUTPUT = $(outbase).mii | |
291 | define TOOL_GCC42MACHO_COMPILE_OBJCXX_CMDS | |
292 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
293 | --kObjCache-cpp $(outbase).mii\ | |
294 | $(TOOL_GCC42MACHO_OBJCXX) -E -o -\ | |
295 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
296 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
297 | $(abspath $(source))\ | |
298 | --kObjCache-cc $(obj)\ | |
299 | $(TOOL_GCC42MACHO_OBJCXX) -c\ | |
300 | $(flags) -fpreprocessed -x objective-c++\ | |
301 | -o $(obj)\ | |
302 | - | |
303 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
304 | endef | |
305 | else # !KBUILD_USE_KOBJCACHE | |
306 | TOOL_GCC42MACHO_COMPILE_OBJCXX_OUTPUT = | |
307 | define TOOL_GCC42MACHO_COMPILE_OBJCXX_CMDS | |
308 | $(QUIET)$(TOOL_GCC42MACHO_OBJCXX) -c\ | |
309 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
310 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
311 | -o $(obj)\ | |
312 | $(abspath $(source)) | |
313 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
314 | endef | |
315 | endif # !KBUILD_USE_KOBJCACHE | |
316 | ||
317 | ||
318 | ## Compile Assembly source. | |
319 | # @param $(target) Normalized main target name. | |
320 | # @param $(source) Source filename (relative). | |
321 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
322 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
323 | # @param $(flags) Flags. | |
324 | # @param $(defs) Definitions. No -D or something. | |
325 | # @param $(incs) Includes. No -I or something. | |
326 | # @param $(dirdep) Directory creation dependency. | |
327 | # @param $(deps) Other dependencies. | |
328 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
329 | # @param $(objsuff) Object suffix. | |
330 | # | |
331 | TOOL_GCC42MACHO_COMPILE_AS_OUTPUT = | |
332 | TOOL_GCC42MACHO_COMPILE_AS_DEPEND = | |
333 | TOOL_GCC42MACHO_COMPILE_AS_DEPORD = | |
334 | define TOOL_GCC42MACHO_COMPILE_AS_CMDS | |
335 | $(QUIET)$(TOOL_GCC42MACHO_AS) -c\ | |
336 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
337 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
338 | -o $(obj)\ | |
339 | $(abspath $(source)) | |
340 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
341 | endef | |
342 | ||
343 | ||
344 | ## Link library | |
345 | # @param $(target) Normalized main target name. | |
346 | # @param $(out) Library name. | |
347 | # @param $(objs) Object files to put in the library. | |
348 | # @param $(flags) Flags. | |
349 | # @param $(dirdep) Directory creation dependency. | |
350 | # @param $(deps) Other dependencies. | |
351 | # @param $(othersrc) Unhandled sources. | |
352 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
353 | TOOL_GCC42MACHO_LINK_LIBRARY_OUTPUT = | |
354 | TOOL_GCC42MACHO_LINK_LIBRARY_DEPEND = $(othersrc) | |
355 | TOOL_GCC42MACHO_LINK_LIBRARY_DEPORD = | |
356 | define TOOL_GCC42MACHO_LINK_LIBRARY_CMDS | |
357 | $(if $(strip $(objs)),$(call xargs,$(QUIET)$(TOOL_GCC42MACHO_AR) $(flags) $(out),$(objs))) | |
358 | $(foreach lib,$(othersrc)\ | |
359 | ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \ | |
360 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \ | |
361 | $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \ | |
362 | $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \ | |
363 | && $(TOOL_GCC42MACHO_AR) -x $(abspath $(lib)) \ | |
364 | && $(RM_EXT) -f ./__.SYMDEF* \ | |
365 | && $(TOOL_GCC42MACHO_AR) $(flags) $(out) *) \ | |
366 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \ | |
367 | $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/) | |
368 | endef | |
369 | ||
370 | ||
371 | ## Link program | |
372 | # @param $(target) Normalized main target name. | |
373 | # @param $(out) Program name. | |
374 | # @param $(objs) Object files to link together. | |
375 | # @param $(libs) Libraries to search. | |
376 | # @param $(libpath) Library search paths. | |
377 | # @param $(flags) Flags. | |
378 | # @param $(dirdep) Directory creation dependency. | |
379 | # @param $(deps) Other dependencies. | |
380 | # @param $(othersrc) Unhandled sources. | |
381 | # @param $(custom_pre) Custom step invoked before linking. | |
382 | # @param $(custom_post) Custom step invoked after linking. | |
383 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
384 | TOOL_GCC42MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp | |
385 | TOOL_GCC42MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_GCC42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
386 | TOOL_GCC42MACHO_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_GCC42MACHO_DEBUG_INSTALL_FN) | |
387 | TOOL_GCC42MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
388 | TOOL_GCC42MACHO_LINK_PROGRAM_DEPORD = | |
389 | define TOOL_GCC42MACHO_LINK_PROGRAM_CMDS | |
390 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
391 | $(QUIET)$(TOOL_GCC42MACHO_LD) $(flags) -o $(out)\ | |
392 | -filelist $(outbase).rsp\ | |
393 | $(foreach p,$(libpath), -L$(p))\ | |
394 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
395 | ifeq ($(ld_debug),split) | |
396 | $(QUIET)$(TOOL_GCC42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
397 | $(QUIET)$(TOOL_GCC42MACHO_STRIP_PROGRAM) $(out) | |
398 | endif | |
399 | endef | |
400 | ||
401 | ||
402 | ||
403 | ## Link DLL | |
404 | # @param $(target) Normalized main target name. | |
405 | # @param $(out) Program name. | |
406 | # @param $(objs) Object files to link together. | |
407 | # @param $(libs) Libraries to search. | |
408 | # @param $(libpath) Library search paths. | |
409 | # @param $(flags) Flags. | |
410 | # @param $(dirdep) Directory creation dependency. | |
411 | # @param $(deps) Other dependencies. | |
412 | # @param $(othersrc) Unhandled sources. | |
413 | # @param $(custom_pre) Custom step invoked before linking. | |
414 | # @param $(custom_post) Custom step invoked after linking. | |
415 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
416 | TOOL_GCC42MACHO_LINK_DLL_OUTPUT = $(outbase).rsp | |
417 | TOOL_GCC42MACHO_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_GCC42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
418 | TOOL_GCC42MACHO_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_GCC42MACHO_DEBUG_INSTALL_FN) | |
419 | TOOL_GCC42MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
420 | TOOL_GCC42MACHO_LINK_DLL_DEPORD = | |
421 | define TOOL_GCC42MACHO_LINK_DLL_CMDS | |
422 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
423 | $(QUIET)$(TOOL_GCC42MACHO_LD) $(TOOL_GCC42MACHO_LDFLAGS.dll) $(flags) -o $(out)\ | |
424 | $(call TOOL_GCC42MACHO_LD_SONAME,$(target),$(out))\ | |
425 | -filelist $(outbase).rsp\ | |
426 | $(foreach p,$(libpath), -L$(p))\ | |
427 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
428 | ifeq ($(ld_debug),split) | |
429 | $(QUIET)$(TOOL_GCC42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
430 | $(QUIET)$(TOOL_GCC42MACHO_STRIP_DLL) $(out) | |
431 | endif | |
432 | endef | |
433 | ||
434 | ||
435 | ## Link system module (windows aka driver, linux aka kernel module) | |
436 | # @param $(target) Normalized main target name. | |
437 | # @param $(out) System module name. | |
438 | # @param $(objs) Object files to link together. | |
439 | # @param $(libs) Libraries to search. | |
440 | # @param $(libpath) Library search paths. | |
441 | # @param $(flags) Flags. | |
442 | # @param $(dirdep) Directory creation dependency. | |
443 | # @param $(deps) Other dependencies. | |
444 | # @param $(othersrc) Unhandled sources. | |
445 | # @param $(custom_pre) Custom step invoked before linking. | |
446 | # @param $(custom_post) Custom step invoked after linking. | |
447 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
448 | TOOL_GCC42MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp | |
449 | TOOL_GCC42MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_GCC42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
450 | TOOL_GCC42MACHO_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_GCC42MACHO_DEBUG_INSTALL_FN) | |
451 | TOOL_GCC42MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
452 | TOOL_GCC42MACHO_LINK_SYSMOD_DEPORD = | |
453 | define TOOL_GCC42MACHO_LINK_SYSMOD_CMDS | |
454 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
455 | $(QUIET)$(TOOL_GCC42MACHO_LD_SYSMOD) $(TOOL_GCC42MACHO_LDFLAGS.sysmod) $(flags) -o $(out)\ | |
456 | -filelist $(outbase).rsp\ | |
457 | $(foreach p,$(libpath), -L$(p))\ | |
458 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
459 | ifeq ($(ld_debug),split) | |
460 | $(QUIET)$(TOOL_GCC42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
461 | $(QUIET)$(TOOL_GCC42MACHO_STRIP_SYSMOD) $(out) | |
462 | endif | |
463 | endef | |
464 |
0 | # $Id: GCC4MACHO.kmk 2535 2011-08-02 19:05:34Z bird $ | |
0 | # $Id: GCC4MACHO.kmk 2547 2011-11-04 21:58:53Z bird $ | |
1 | 1 | ## @file |
2 | # kBuild Tool Config - GCC v4 targeting Darwin (Mac OS X) Mach-o. | |
2 | # kBuild Tool Config - GCC v4 targeting Darwin (Mac OS X) Mach-O. | |
3 | 3 | # |
4 | 4 | |
5 | 5 | # |
30 | 30 | # |
31 | 31 | # |
32 | 32 | |
33 | TOOL_GCC4MACHO := GCC v4 targeting Darwin (Mac OS X) Mach-o. | |
33 | TOOL_GCC4MACHO := GCC v4 targeting Darwin (Mac OS X) Mach-O. | |
34 | 34 | |
35 | 35 | # Tool Specific Properties |
36 | 36 | TOOL_GCC4MACHO_PREFIX ?= |
0 | # $Id: GXX.kmk 2541 2011-08-03 09:51:30Z bird $ | |
0 | # $Id: GXX.kmk 2545 2011-09-13 19:09:05Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Generic GCC using the system GCC, for building C++ code. |
3 | 3 | # |
204 | 204 | define TOOL_GXX_LINK_PROGRAM_CMDS |
205 | 205 | $(QUIET)$(TOOL_GXX_LD) $(flags) -o $(out) $(objs) \ |
206 | 206 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
207 | if1of ($(ld_debug), split) | |
208 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX.) | |
209 | endif | |
210 | 207 | endef |
211 | 208 | |
212 | 209 | |
229 | 226 | define TOOL_GXX_LINK_DLL_CMDS |
230 | 227 | $(QUIET)$(TOOL_GXX_LD) $(TOOL_GXX_LDFLAGS.dll) $(flags) -o $(out) $(objs) \ |
231 | 228 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
232 | if1of ($(ld_debug), split) | |
233 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX.) | |
234 | endif | |
235 | endef | |
236 | ||
229 | endef | |
230 |
0 | # $Id: GXX3OMF.kmk 2534 2011-08-02 14:13:06Z bird $ | |
0 | # $Id: GXX3OMF.kmk 2545 2011-09-13 19:09:05Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - GCC v3 targeting OS/2 OMF, for building C++ code. |
3 | 3 | # |
251 | 251 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
252 | 252 | -Zmap=$(outbase).map |
253 | 253 | $(QUIET)$(TOOL_GXX3OMF_LD) @$(outbase).rsp |
254 | if1of ($(ld_debug), split) | |
255 | $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GXX3OMF.) | |
256 | endif | |
257 | 254 | endef |
258 | 255 | |
259 | 256 | |
285 | 282 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
286 | 283 | -Zmap=$(outbase).map |
287 | 284 | $(TOOL_GXX3OMF_LD) @$(outbase).rsp |
288 | if1of ($(ld_debug), split) | |
289 | $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GXX3OMF.) | |
290 | endif | |
291 | 285 | endef |
292 | 286 | |
293 | 287 | |
319 | 313 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\ |
320 | 314 | -Zmap=$(outbase).map |
321 | 315 | $(QUIET)$(TOOL_GXX3OMF_LD_SYSMOD) @$(outbase).rsp |
322 | if1of ($(ld_debug), split) | |
323 | $(warning kBuild: Debug splitting is requrested for $(target), but this feature is not supported by GXX3OMF.) | |
324 | endif | |
325 | endef | |
326 | ||
316 | endef | |
317 |
0 | # $Id: GXX3PLAIN.kmk 2541 2011-08-03 09:51:30Z bird $ | |
0 | # $Id: GXX3PLAIN.kmk 2545 2011-09-13 19:09:05Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Generic GCC v3.2.x or later using the system GCC, any Unix linker and Unix archiver to build C++ code. |
3 | 3 | # |
256 | 256 | $(filter %.def, $(othersrc))\ |
257 | 257 | $(foreach p,$(libpath), -L$(p))\ |
258 | 258 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
259 | if1of ($(ld_debug), split) | |
260 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX3PLAIN.) | |
261 | endif | |
262 | 259 | endef |
263 | 260 | |
264 | 261 | |
287 | 284 | $(filter %.def, $(othersrc))\ |
288 | 285 | $(foreach p,$(libpath), -L$(p))\ |
289 | 286 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
290 | if1of ($(ld_debug), split) | |
291 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX3PLAIN.) | |
292 | endif | |
293 | 287 | endef |
294 | 288 | |
295 | 289 | |
321 | 315 | $(filter %.def, $(othersrc))\ |
322 | 316 | $(foreach p,$(libpath), -L$(p))\ |
323 | 317 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) |
324 | if1of ($(ld_debug), split) | |
325 | $(warning kBuild: Debug splitting is requested for $(target), but this feature is not supported by GXX3PLAIN.) | |
326 | endif | |
327 | endef | |
328 | ||
318 | endef | |
319 |
0 | # $Id: GXX42MACHO.kmk 2547 2011-11-04 21:58:53Z bird $ | |
1 | ## @file | |
2 | # kBuild Tool Config - GCC v4.2.x targeting Darwin (Mac OS X) Mach-O, for building C++ code. | |
3 | # | |
4 | ||
5 | # | |
6 | # Copyright (c) 2004-2011 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | # | |
8 | # This file is part of kBuild. | |
9 | # | |
10 | # kBuild is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 2 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # kBuild is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with kBuild; if not, write to the Free Software | |
22 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 | # | |
24 | # | |
25 | # As a special exception you are granted permission to include this file, via | |
26 | # the kmk include directive, as you wish without this in itself causing the | |
27 | # resulting makefile, program or whatever to be covered by the GPL license. | |
28 | # This exception does not however invalidate any other reasons why the makefile, | |
29 | # program, whatever should not be covered the GPL. | |
30 | # | |
31 | # | |
32 | ||
33 | TOOL_GXX42MACHO := GCC v4.2.x targeting Darwin (Mac OS X) Mach-O, for building C++ code. | |
34 | ||
35 | # Tool Specific Properties | |
36 | TOOL_GXX42MACHO_PREFIX ?= | |
37 | TOOL_GXX42MACHO_SUFFIX ?= -4.2$(HOSTSUFF_EXE) | |
38 | TOOL_GXX42MACHO_CC ?= $(TOOL_GXX42MACHO_PREFIX)gcc$(TOOL_GXX42MACHO_SUFFIX) | |
39 | TOOL_GXX42MACHO_CXX ?= $(TOOL_GXX42MACHO_PREFIX)g++$(TOOL_GXX42MACHO_SUFFIX) | |
40 | TOOL_GXX42MACHO_OBJC ?= $(TOOL_GXX42MACHO_PREFIX)gcc$(TOOL_GXX42MACHO_SUFFIX) | |
41 | TOOL_GXX42MACHO_OBJCXX ?= $(TOOL_GXX42MACHO_PREFIX)gcc$(TOOL_GXX42MACHO_SUFFIX) | |
42 | TOOL_GXX42MACHO_AS ?= $(TOOL_GXX42MACHO_PREFIX)gcc$(TOOL_GXX42MACHO_SUFFIX) | |
43 | TOOL_GXX42MACHO_LD ?= $(TOOL_GXX42MACHO_PREFIX)g++$(TOOL_GXX42MACHO_SUFFIX) | |
44 | TOOL_GXX42MACHO_LD_SYSMOD ?= $(TOOL_GXX42MACHO_PREFIX)g++$(TOOL_GXX42MACHO_SUFFIX) | |
45 | ifndef TOOL_GXX42MACHO_LDFLAGS.$(KBUILD_TARGET) | |
46 | TOOL_GXX42MACHO_LDFLAGS.dll ?= -dynamiclib | |
47 | else | |
48 | TOOL_GXX42MACHO_LDFLAGS.dll ?= $(TOOL_GXX42MACHO_LDFLAGS.$(KBUILD_TARGET)) | |
49 | endif | |
50 | TOOL_GXX42MACHO_LDFLAGS.sysmod ?= -r | |
51 | #TOOL_GXX42MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) | |
52 | TOOL_GXX42MACHO_DSYMUTIL ?= dsymutil | |
53 | ||
54 | ifdef SLKRUNS | |
55 | TOOL_GXX42MACHO_CC += -fmessage-length=0 | |
56 | TOOL_GXX42MACHO_CXX += -fmessage-length=0 | |
57 | TOOL_GXX42MACHO_OBJC += -fmessage-length=0 | |
58 | TOOL_GXX42MACHO_OBJCXX += -fmessage-length=0 | |
59 | endif | |
60 | ||
61 | # General Properties used by kBuild | |
62 | TOOL_GXX42MACHO_COBJSUFF ?= .o | |
63 | TOOL_GXX42MACHO_CFLAGS ?= | |
64 | TOOL_GXX42MACHO_CFLAGS.debug ?= -g | |
65 | TOOL_GXX42MACHO_CFLAGS.profile ?= -O2 #-g -pg | |
66 | TOOL_GXX42MACHO_CFLAGS.release ?= -O2 | |
67 | TOOL_GXX42MACHO_CINCS ?= | |
68 | TOOL_GXX42MACHO_CDEFS ?= | |
69 | ||
70 | TOOL_GXX42MACHO_CXXOBJSUFF ?= .o | |
71 | TOOL_GXX42MACHO_CXXFLAGS ?= | |
72 | TOOL_GXX42MACHO_CXXFLAGS.debug ?= -g | |
73 | TOOL_GXX42MACHO_CXXFLAGS.profile ?= -O2 #-g -pg | |
74 | TOOL_GXX42MACHO_CXXFLAGS.release ?= -O2 | |
75 | TOOL_GXX42MACHO_CXXINCS ?= | |
76 | TOOL_GXX42MACHO_CXXDEFS ?= | |
77 | ||
78 | TOOL_GXX42MACHO_OBJCOBJSUFF ?= .o | |
79 | TOOL_GXX42MACHO_OBJCFLAGS ?= | |
80 | TOOL_GXX42MACHO_OBJCFLAGS.debug ?= -g | |
81 | TOOL_GXX42MACHO_OBJCFLAGS.profile?= -O2 #-g -pg | |
82 | TOOL_GXX42MACHO_OBJCFLAGS.release?= -O2 | |
83 | TOOL_GXX42MACHO_OBJCINCS ?= | |
84 | TOOL_GXX42MACHO_OBJCDEFS ?= | |
85 | ||
86 | TOOL_GXX42MACHO_OBJCXXOBJSUFF ?= .o | |
87 | TOOL_GXX42MACHO_OBJCXXFLAGS ?= | |
88 | TOOL_GXX42MACHO_OBJCXXFLAGS.debug ?= -g | |
89 | TOOL_GXX42MACHO_OBJCXXFLAGS.profile ?= -O2 #-g -pg | |
90 | TOOL_GXX42MACHO_OBJCXXFLAGS.release ?= -O2 | |
91 | TOOL_GXX42MACHO_OBJCXXINCS ?= | |
92 | TOOL_GXX42MACHO_OBJCXXDEFS ?= | |
93 | ||
94 | TOOL_GXX42MACHO_ASFLAGS ?= -x assembler-with-cpp | |
95 | TOOL_GXX42MACHO_ASFLAGS.debug ?= -g | |
96 | TOOL_GXX42MACHO_ASFLAGS.profile ?= -g | |
97 | TOOL_GXX42MACHO_ASOBJSUFF ?= .o | |
98 | ||
99 | TOOL_GXX42MACHO_AR ?= ar$(HOSTSUFF_EXE) | |
100 | TOOL_GXX42MACHO_ARFLAGS ?= -c -rs | |
101 | TOOL_GXX42MACHO_ARLIBSUFF ?= .a | |
102 | ||
103 | TOOL_GXX42MACHO_LDFLAGS ?= | |
104 | TOOL_GXX42MACHO_LDFLAGS.debug ?= -g | |
105 | TOOL_GXX42MACHO_LDFLAGS.profile ?= -g | |
106 | ||
107 | TOOL_GXX42MACHO_STRIP_PROGRAM ?= strip -SXxru | |
108 | TOOL_GXX42MACHO_STRIP_DLL ?= strip -Sxru | |
109 | TOOL_GXX42MACHO_STRIP_SYSMOD ?= strip -Sru | |
110 | ||
111 | ||
112 | ## | |
113 | # Calculate the files in the debug bundle. | |
114 | # @param 1 The whole output filename. | |
115 | # @param 2 The output filename sans suffix. | |
116 | TOOL_GXX42MACHO_DEBUG_BUNDLE_FN = \ | |
117 | $(1).dSYM/ \ | |
118 | $(1).dSYM/Contents/ \ | |
119 | $(1).dSYM/Contents/Resources/ \ | |
120 | $(1).dSYM/Contents/Resources/DWARF/ \ | |
121 | $(1).dSYM/Contents/Info.plist \ | |
122 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1)) | |
123 | ||
124 | ## | |
125 | # Calculate the files in the debug bundle. | |
126 | # @param 1 The whole linker output filename. | |
127 | # @param 2 The linker output filename sans suffix. | |
128 | # @param 3 The desired install name (no dir slash). | |
129 | # @remarks The Info.plist has some reference to the original name, but gdb | |
130 | # does not care and only check for a symbol file in the DWARF | |
131 | # directory with the same name as the debugged module. | |
132 | TOOL_GXX42MACHO_DEBUG_INSTALL_FN= \ | |
133 | $(3).dSYM/ \ | |
134 | $(3).dSYM/Contents/ \ | |
135 | $(3).dSYM/Contents/Resources/ \ | |
136 | $(3).dSYM/Contents/Resources/DWARF/ \ | |
137 | $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \ | |
138 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(3)) | |
139 | ||
140 | ||
141 | ## Compile C source. | |
142 | # @param $(target) Normalized main target name. | |
143 | # @param $(source) Source filename (relative). | |
144 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
145 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
146 | # @param $(flags) Flags. | |
147 | # @param $(defs) Definitions. No -D or something. | |
148 | # @param $(incs) Includes. No -I or something. | |
149 | # @param $(dirdep) Directory creation dependency. | |
150 | # @param $(deps) Other dependencies. | |
151 | # | |
152 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
153 | # @param $(objsuff) Object suffix. | |
154 | TOOL_GXX42MACHO_COMPILE_C_DEPEND = | |
155 | TOOL_GXX42MACHO_COMPILE_C_DEPORD = | |
156 | ifdef KBUILD_USE_KOBJCACHE | |
157 | TOOL_GXX42MACHO_COMPILE_C_USES_KOBJCACHE = 1 | |
158 | TOOL_GXX42MACHO_COMPILE_C_OUTPUT = $(outbase).i | |
159 | define TOOL_GXX42MACHO_COMPILE_C_CMDS | |
160 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
161 | --kObjCache-cpp $(outbase).i\ | |
162 | $(TOOL_GXX42MACHO_CC) -E -o -\ | |
163 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
164 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
165 | $(abspath $(source))\ | |
166 | --kObjCache-cc $(obj)\ | |
167 | $(TOOL_GXX42MACHO_CC) -c\ | |
168 | $(flags) -fpreprocessed -x c\ | |
169 | -o $(obj)\ | |
170 | - | |
171 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
172 | endef | |
173 | else # !KBUILD_USE_KOBJCACHE | |
174 | TOOL_GXX42MACHO_COMPILE_C_OUTPUT = | |
175 | define TOOL_GXX42MACHO_COMPILE_C_CMDS | |
176 | $(QUIET)$(TOOL_GXX42MACHO_CC) -c\ | |
177 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
178 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
179 | -o $(obj)\ | |
180 | $(abspath $(source)) | |
181 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
182 | endef | |
183 | endif # !KUSE_OBJCACHE | |
184 | ||
185 | ||
186 | ## Compile C++ source. | |
187 | # @param $(target) Normalized main target name. | |
188 | # @param $(source) Source filename (relative). | |
189 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
190 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
191 | # @param $(flags) Flags. | |
192 | # @param $(defs) Definitions. No -D or something. | |
193 | # @param $(incs) Includes. No -I or something. | |
194 | # @param $(dirdep) Directory creation dependency. | |
195 | # @param $(deps) Other dependencies. | |
196 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
197 | # @param $(objsuff) Object suffix. | |
198 | TOOL_GXX42MACHO_COMPILE_CXX_DEPEND = | |
199 | TOOL_GXX42MACHO_COMPILE_CXX_DEPORD = | |
200 | ifdef KBUILD_USE_KOBJCACHE | |
201 | TOOL_GXX42MACHO_COMPILE_CXX_USES_KOBJCACHE = 1 | |
202 | TOOL_GXX42MACHO_COMPILE_CXX_OUTPUT = $(outbase).ii | |
203 | define TOOL_GXX42MACHO_COMPILE_CXX_CMDS | |
204 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
205 | --kObjCache-cpp $(outbase).ii\ | |
206 | $(TOOL_GXX42MACHO_CXX) -E -o -\ | |
207 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
208 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
209 | $(abspath $(source))\ | |
210 | --kObjCache-cc $(obj)\ | |
211 | $(TOOL_GXX42MACHO_CXX) -c\ | |
212 | $(flags) -fpreprocessed -x c++\ | |
213 | -o $(obj)\ | |
214 | - | |
215 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
216 | endef | |
217 | else # !KBUILD_USE_KOBJCACHE | |
218 | TOOL_GXX42MACHO_COMPILE_CXX_OUTPUT = | |
219 | define TOOL_GXX42MACHO_COMPILE_CXX_CMDS | |
220 | $(QUIET)$(TOOL_GXX42MACHO_CXX) -c\ | |
221 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
222 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
223 | -o $(obj)\ | |
224 | $(abspath $(source)) | |
225 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
226 | endef | |
227 | endif # !KBUILD_USE_KOBJCACHE | |
228 | ||
229 | ||
230 | ## Compile Objective-C source. | |
231 | # @param $(target) Normalized main target name. | |
232 | # @param $(source) Source filename (relative). | |
233 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
234 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
235 | # @param $(flags) Flags. | |
236 | # @param $(defs) Definitions. No -D or something. | |
237 | # @param $(incs) Includes. No -I or something. | |
238 | # @param $(dirdep) Directory creation dependency. | |
239 | # @param $(deps) Other dependencies. | |
240 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
241 | # @param $(objsuff) Object suffix. | |
242 | TOOL_GXX42MACHO_COMPILE_OBJC_DEPEND = | |
243 | TOOL_GXX42MACHO_COMPILE_OBJC_DEPORD = | |
244 | ifdef KBUILD_USE_KOBJCACHE | |
245 | TOOL_GXX42MACHO_COMPILE_OBJC_USES_KOBJCACHE = 1 | |
246 | TOOL_GXX42MACHO_COMPILE_OBJC_OUTPUT = $(outbase).mi | |
247 | define TOOL_GXX42MACHO_COMPILE_OBJC_CMDS | |
248 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
249 | --kObjCache-cpp $(outbase).ii\ | |
250 | $(TOOL_GXX42MACHO_OBJC) -E -o -\ | |
251 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
252 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
253 | $(abspath $(source))\ | |
254 | --kObjCache-cc $(obj)\ | |
255 | $(TOOL_GXX42MACHO_OBJC) -c\ | |
256 | $(flags) -fpreprocessed -x objective-c \ | |
257 | -o $(obj)\ | |
258 | - | |
259 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
260 | endef | |
261 | else # !KBUILD_USE_KOBJCACHE | |
262 | TOOL_GXX42MACHO_COMPILE_OBJC_OUTPUT = | |
263 | define TOOL_GXX42MACHO_COMPILE_OBJC_CMDS | |
264 | $(QUIET)$(TOOL_GXX42MACHO_OBJC) -c\ | |
265 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
266 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
267 | -o $(obj)\ | |
268 | $(abspath $(source)) | |
269 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
270 | endef | |
271 | endif # !KBUILD_USE_KOBJCACHE | |
272 | ||
273 | ||
274 | ## Compile Objective-C++ source. | |
275 | # @param $(target) Normalized main target name. | |
276 | # @param $(source) Source filename (relative). | |
277 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
278 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
279 | # @param $(flags) Flags. | |
280 | # @param $(defs) Definitions. No -D or something. | |
281 | # @param $(incs) Includes. No -I or something. | |
282 | # @param $(dirdep) Directory creation dependency. | |
283 | # @param $(deps) Other dependencies. | |
284 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
285 | # @param $(objsuff) Object suffix. | |
286 | TOOL_GXX42MACHO_COMPILE_OBJCXX_DEPEND = | |
287 | TOOL_GXX42MACHO_COMPILE_OBJCXX_DEPORD = | |
288 | ifdef KBUILD_USE_KOBJCACHE | |
289 | TOOL_GXX42MACHO_COMPILE_OBJCXX_USES_KOBJCACHE = 1 | |
290 | TOOL_GXX42MACHO_COMPILE_OBJCXX_OUTPUT = $(outbase).mii | |
291 | define TOOL_GXX42MACHO_COMPILE_OBJCXX_CMDS | |
292 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
293 | --kObjCache-cpp $(outbase).mii\ | |
294 | $(TOOL_GXX42MACHO_OBJCXX) -E -o -\ | |
295 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
296 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
297 | $(abspath $(source))\ | |
298 | --kObjCache-cc $(obj)\ | |
299 | $(TOOL_GXX42MACHO_OBJCXX) -c\ | |
300 | $(flags) -fpreprocessed -x objective-c++ \ | |
301 | -o $(obj)\ | |
302 | - | |
303 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
304 | endef | |
305 | else # !KBUILD_USE_KOBJCACHE | |
306 | TOOL_GXX42MACHO_COMPILE_OBJCXX_OUTPUT = | |
307 | define TOOL_GXX42MACHO_COMPILE_OBJCXX_CMDS | |
308 | $(QUIET)$(TOOL_GXX42MACHO_OBJCXX) -c\ | |
309 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
310 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
311 | -o $(obj)\ | |
312 | $(abspath $(source)) | |
313 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
314 | endef | |
315 | endif # !KBUILD_USE_KOBJCACHE | |
316 | ||
317 | ||
318 | ## Compile Assembly source. | |
319 | # @param $(target) Normalized main target name. | |
320 | # @param $(source) Source filename (relative). | |
321 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
322 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
323 | # @param $(flags) Flags. | |
324 | # @param $(defs) Definitions. No -D or something. | |
325 | # @param $(incs) Includes. No -I or something. | |
326 | # @param $(dirdep) Directory creation dependency. | |
327 | # @param $(deps) Other dependencies. | |
328 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
329 | # @param $(objsuff) Object suffix. | |
330 | # | |
331 | TOOL_GXX42MACHO_COMPILE_AS_OUTPUT = | |
332 | TOOL_GXX42MACHO_COMPILE_AS_DEPEND = | |
333 | TOOL_GXX42MACHO_COMPILE_AS_DEPORD = | |
334 | define TOOL_GXX42MACHO_COMPILE_AS_CMDS | |
335 | $(QUIET)$(TOOL_GXX42MACHO_AS) -c\ | |
336 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
337 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
338 | -o $(obj)\ | |
339 | $(abspath $(source)) | |
340 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
341 | endef | |
342 | ||
343 | ||
344 | ## Link library | |
345 | # @param $(target) Normalized main target name. | |
346 | # @param $(out) Library name. | |
347 | # @param $(objs) Object files to put in the library. | |
348 | # @param $(flags) Flags. | |
349 | # @param $(dirdep) Directory creation dependency. | |
350 | # @param $(deps) Other dependencies. | |
351 | # @param $(othersrc) Unhandled sources. | |
352 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
353 | TOOL_GXX42MACHO_LINK_LIBRARY_OUTPUT = | |
354 | TOOL_GXX42MACHO_LINK_LIBRARY_DEPEND = $(othersrc) | |
355 | TOOL_GXX42MACHO_LINK_LIBRARY_DEPORD = | |
356 | define TOOL_GXX42MACHO_LINK_LIBRARY_CMDS | |
357 | $(if $(strip $(objs)),$(call xargs,$(QUIET)$(TOOL_GXX42MACHO_AR) $(flags) $(out),$(objs))) | |
358 | $(foreach lib,$(othersrc)\ | |
359 | ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \ | |
360 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \ | |
361 | $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \ | |
362 | $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \ | |
363 | && $(TOOL_GXX42MACHO_AR) -x $(abspath $(lib)) \ | |
364 | && $(RM_EXT) -f ./__.SYMDEF* \ | |
365 | && $(TOOL_GXX42MACHO_AR) $(flags) $(out) *) \ | |
366 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \ | |
367 | $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/) | |
368 | endef | |
369 | ||
370 | ||
371 | ## Link program | |
372 | # @param $(target) Normalized main target name. | |
373 | # @param $(out) Program name. | |
374 | # @param $(objs) Object files to link together. | |
375 | # @param $(libs) Libraries to search. | |
376 | # @param $(libpath) Library search paths. | |
377 | # @param $(flags) Flags. | |
378 | # @param $(dirdep) Directory creation dependency. | |
379 | # @param $(deps) Other dependencies. | |
380 | # @param $(othersrc) Unhandled sources. | |
381 | # @param $(custom_pre) Custom step invoked before linking. | |
382 | # @param $(custom_post) Custom step invoked after linking. | |
383 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
384 | TOOL_GXX42MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp | |
385 | TOOL_GXX42MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_GXX42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
386 | TOOL_GXX42MACHO_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_GXX42MACHO_DEBUG_INSTALL_FN) | |
387 | TOOL_GXX42MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
388 | TOOL_GXX42MACHO_LINK_PROGRAM_DEPORD = | |
389 | define TOOL_GXX42MACHO_LINK_PROGRAM_CMDS | |
390 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
391 | $(QUIET)$(TOOL_GXX42MACHO_LD) $(flags) -o $(out)\ | |
392 | -filelist $(outbase).rsp\ | |
393 | $(foreach p,$(libpath), -L$(p))\ | |
394 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
395 | ifeq ($(ld_debug),split) | |
396 | $(QUIET)$(TOOL_GXX42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
397 | $(QUIET)$(TOOL_GXX42MACHO_STRIP_PROGRAM) $(out) | |
398 | endif | |
399 | endef | |
400 | ||
401 | ||
402 | ## Link DLL | |
403 | # @param $(target) Normalized main target name. | |
404 | # @param $(out) Program name. | |
405 | # @param $(objs) Object files to link together. | |
406 | # @param $(libs) Libraries to search. | |
407 | # @param $(libpath) Library search paths. | |
408 | # @param $(flags) Flags. | |
409 | # @param $(dirdep) Directory creation dependency. | |
410 | # @param $(deps) Other dependencies. | |
411 | # @param $(othersrc) Unhandled sources. | |
412 | # @param $(custom_pre) Custom step invoked before linking. | |
413 | # @param $(custom_post) Custom step invoked after linking. | |
414 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
415 | TOOL_GXX42MACHO_LINK_DLL_OUTPUT = $(outbase).rsp | |
416 | TOOL_GXX42MACHO_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_GXX42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
417 | TOOL_GXX42MACHO_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_GXX42MACHO_DEBUG_INSTALL_FN) | |
418 | TOOL_GXX42MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
419 | TOOL_GXX42MACHO_LINK_DLL_DEPORD = | |
420 | define TOOL_GXX42MACHO_LINK_DLL_CMDS | |
421 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
422 | $(QUIET)$(TOOL_GXX42MACHO_LD) $(TOOL_GXX42MACHO_LDFLAGS.dll) $(flags) -o $(out)\ | |
423 | $(call TOOL_GXX42MACHO_LD_SONAME,$(target),$(out))\ | |
424 | -filelist $(outbase).rsp\ | |
425 | $(foreach p,$(libpath), -L$(p))\ | |
426 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
427 | ifeq ($(ld_debug),split) | |
428 | $(QUIET)$(TOOL_GXX42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
429 | $(QUIET)$(TOOL_GXX42MACHO_STRIP_DLL) $(out) | |
430 | endif | |
431 | endef | |
432 | ||
433 | ||
434 | ## Link system module (windows aka driver, linux aka kernel module) | |
435 | # @param $(target) Normalized main target name. | |
436 | # @param $(out) System module name. | |
437 | # @param $(objs) Object files to link together. | |
438 | # @param $(libs) Libraries to search. | |
439 | # @param $(libpath) Library search paths. | |
440 | # @param $(flags) Flags. | |
441 | # @param $(dirdep) Directory creation dependency. | |
442 | # @param $(deps) Other dependencies. | |
443 | # @param $(othersrc) Unhandled sources. | |
444 | # @param $(custom_pre) Custom step invoked before linking. | |
445 | # @param $(custom_post) Custom step invoked after linking. | |
446 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
447 | TOOL_GXX42MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp | |
448 | TOOL_GXX42MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_GXX42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
449 | TOOL_GXX42MACHO_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_GXX42MACHO_DEBUG_INSTALL_FN) | |
450 | TOOL_GXX42MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
451 | TOOL_GXX42MACHO_LINK_SYSMOD_DEPORD = | |
452 | define TOOL_GXX42MACHO_LINK_SYSMOD_CMDS | |
453 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
454 | $(QUIET)$(TOOL_GXX42MACHO_LD_SYSMOD) $(TOOL_GXX42MACHO_LDFLAGS.sysmod) $(flags) -o $(out)\ | |
455 | -filelist $(outbase).rsp\ | |
456 | $(foreach p,$(libpath), -L$(p))\ | |
457 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
458 | ifeq ($(ld_debug),split) | |
459 | $(QUIET)$(TOOL_GXX42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
460 | $(QUIET)$(TOOL_GXX42MACHO_STRIP_SYSMOD) $(out) | |
461 | endif | |
462 | endef | |
463 |
0 | # $Id: GXX4MACHO.kmk 2535 2011-08-02 19:05:34Z bird $ | |
0 | # $Id: GXX4MACHO.kmk 2547 2011-11-04 21:58:53Z bird $ | |
1 | 1 | ## @file |
2 | # kBuild Tool Config - GCC v4 targeting Darwin (Mac OS X) Mach-o, for building C++ code. | |
2 | # kBuild Tool Config - GCC v4 targeting Darwin (Mac OS X) Mach-O, for building C++ code. | |
3 | 3 | # |
4 | 4 | |
5 | 5 | # |
30 | 30 | # |
31 | 31 | # |
32 | 32 | |
33 | TOOL_GXX4MACHO := GCC v4 targeting Darwin (Mac OS X) Mach-o, for building C++ code. | |
33 | TOOL_GXX4MACHO := GCC v4 targeting Darwin (Mac OS X) Mach-O, for building C++ code. | |
34 | 34 | |
35 | 35 | # Tool Specific Properties |
36 | 36 | TOOL_GXX4MACHO_PREFIX ?= |
0 | # $Id: LLVMGCC42MACHO.kmk 2547 2011-11-04 21:58:53Z bird $ | |
1 | ## @file | |
2 | # kBuild Tool Config - LLVM GCC v4.2.x targeting Darwin (Mac OS X) Mach-O. | |
3 | # | |
4 | ||
5 | # | |
6 | # Copyright (c) 2004-2011 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | # | |
8 | # This file is part of kBuild. | |
9 | # | |
10 | # kBuild is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 2 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # kBuild is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with kBuild; if not, write to the Free Software | |
22 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 | # | |
24 | # | |
25 | # As a special exception you are granted permission to include this file, via | |
26 | # the kmk include directive, as you wish without this in itself causing the | |
27 | # resulting makefile, program or whatever to be covered by the GPL license. | |
28 | # This exception does not however invalidate any other reasons why the makefile, | |
29 | # program, whatever should not be covered the GPL. | |
30 | # | |
31 | # | |
32 | ||
33 | TOOL_LLVMGCC42MACHO := LLVM GCC v4.2.x targeting Darwin (Mac OS X) Mach-O. | |
34 | ||
35 | # Tool Specific Properties | |
36 | TOOL_LLVMGCC42MACHO_PREFIX ?= llvm- | |
37 | TOOL_LLVMGCC42MACHO_SUFFIX ?= -4.2$(HOSTSUFF_EXE) | |
38 | TOOL_LLVMGCC42MACHO_CC ?= $(TOOL_LLVMGCC42MACHO_PREFIX)gcc$(TOOL_LLVMGCC42MACHO_SUFFIX) | |
39 | TOOL_LLVMGCC42MACHO_CXX ?= $(TOOL_LLVMGCC42MACHO_PREFIX)g++$(TOOL_LLVMGCC42MACHO_SUFFIX) | |
40 | TOOL_LLVMGCC42MACHO_OBJC ?= $(TOOL_LLVMGCC42MACHO_PREFIX)gcc$(TOOL_LLVMGCC42MACHO_SUFFIX) | |
41 | TOOL_LLVMGCC42MACHO_OBJCXX ?= $(TOOL_LLVMGCC42MACHO_PREFIX)gcc$(TOOL_LLVMGCC42MACHO_SUFFIX) | |
42 | TOOL_LLVMGCC42MACHO_AS ?= $(TOOL_LLVMGCC42MACHO_PREFIX)gcc$(TOOL_LLVMGCC42MACHO_SUFFIX) | |
43 | TOOL_LLVMGCC42MACHO_LD ?= $(TOOL_LLVMGCC42MACHO_PREFIX)gcc$(TOOL_LLVMGCC42MACHO_SUFFIX) | |
44 | TOOL_LLVMGCC42MACHO_LD_SYSMOD ?= $(TOOL_LLVMGCC42MACHO_PREFIX)gcc$(TOOL_LLVMGCC42MACHO_SUFFIX) | |
45 | ifndef TOOL_LLVMGCC42MACHO_LDFLAGS.$(KBUILD_TARGET) | |
46 | TOOL_LLVMGCC42MACHO_LDFLAGS.dll ?= -dynamiclib | |
47 | else | |
48 | TOOL_LLVMGCC42MACHO_LDFLAGS.dll ?= $(TOOL_LLVMGCC42MACHO_LDFLAGS.$(KBUILD_TARGET)) | |
49 | endif | |
50 | TOOL_LLVMGCC42MACHO_LDFLAGS.sysmod ?= -r | |
51 | #TOOL_LLVMGCC42MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) | |
52 | TOOL_LLVMGCC42MACHO_DSYMUTIL ?= dsymutil | |
53 | ||
54 | ifdef SLKRUNS | |
55 | TOOL_LLVMGCC42MACHO_CC += -fmessage-length=0 | |
56 | TOOL_LLVMGCC42MACHO_CXX += -fmessage-length=0 | |
57 | TOOL_LLVMGCC42MACHO_OBJC += -fmessage-length=0 | |
58 | TOOL_LLVMGCC42MACHO_OBJCXX += -fmessage-length=0 | |
59 | endif | |
60 | ||
61 | # General Properties used by kBuild | |
62 | TOOL_LLVMGCC42MACHO_COBJSUFF ?= .o | |
63 | TOOL_LLVMGCC42MACHO_CFLAGS ?= | |
64 | TOOL_LLVMGCC42MACHO_CFLAGS.debug ?= -g | |
65 | TOOL_LLVMGCC42MACHO_CFLAGS.profile ?= -g -O2 #-pg | |
66 | TOOL_LLVMGCC42MACHO_CFLAGS.release ?= -O2 | |
67 | TOOL_LLVMGCC42MACHO_CINCS ?= | |
68 | TOOL_LLVMGCC42MACHO_CDEFS ?= | |
69 | ||
70 | TOOL_LLVMGCC42MACHO_CXXOBJSUFF ?= .o | |
71 | TOOL_LLVMGCC42MACHO_CXXFLAGS ?= | |
72 | TOOL_LLVMGCC42MACHO_CXXFLAGS.debug ?= -g | |
73 | TOOL_LLVMGCC42MACHO_CXXFLAGS.profile ?= -g -O2 #-pg | |
74 | TOOL_LLVMGCC42MACHO_CXXFLAGS.release ?= -O2 | |
75 | TOOL_LLVMGCC42MACHO_CXXINCS ?= | |
76 | TOOL_LLVMGCC42MACHO_CXXDEFS ?= | |
77 | ||
78 | TOOL_LLVMGCC42MACHO_OBJCOBJSUFF ?= .o | |
79 | TOOL_LLVMGCC42MACHO_OBJCFLAGS ?= | |
80 | TOOL_LLVMGCC42MACHO_OBJCFLAGS.debug ?= -g | |
81 | TOOL_LLVMGCC42MACHO_OBJCFLAGS.profile?= -O2 #-g -pg | |
82 | TOOL_LLVMGCC42MACHO_OBJCFLAGS.release?= -O2 | |
83 | TOOL_LLVMGCC42MACHO_OBJCINCS ?= | |
84 | TOOL_LLVMGCC42MACHO_OBJCDEFS ?= | |
85 | ||
86 | TOOL_LLVMGCC42MACHO_OBJCXXOBJSUFF ?= .o | |
87 | TOOL_LLVMGCC42MACHO_OBJCXXFLAGS ?= | |
88 | TOOL_LLVMGCC42MACHO_OBJCXXFLAGS.debug ?= -g | |
89 | TOOL_LLVMGCC42MACHO_OBJCXXFLAGS.profile ?= -O2 #-g -pg | |
90 | TOOL_LLVMGCC42MACHO_OBJCXXFLAGS.release ?= -O2 | |
91 | TOOL_LLVMGCC42MACHO_OBJCXXINCS ?= | |
92 | TOOL_LLVMGCC42MACHO_OBJCXXDEFS ?= | |
93 | ||
94 | TOOL_LLVMGCC42MACHO_ASFLAGS ?= -x assembler-with-cpp | |
95 | TOOL_LLVMGCC42MACHO_ASFLAGS.debug ?= -g | |
96 | TOOL_LLVMGCC42MACHO_ASFLAGS.profile ?= -g | |
97 | TOOL_LLVMGCC42MACHO_ASOBJSUFF ?= .o | |
98 | ||
99 | TOOL_LLVMGCC42MACHO_AR ?= ar$(HOSTSUFF_EXE) | |
100 | TOOL_LLVMGCC42MACHO_ARFLAGS ?= -c -rs | |
101 | TOOL_LLVMGCC42MACHO_ARLIBSUFF ?= .a | |
102 | ||
103 | TOOL_LLVMGCC42MACHO_LDFLAGS ?= | |
104 | TOOL_LLVMGCC42MACHO_LDFLAGS.debug ?= -g | |
105 | TOOL_LLVMGCC42MACHO_LDFLAGS.profile ?= -g | |
106 | ||
107 | TOOL_LLVMGCC42MACHO_STRIP_PROGRAM ?= strip -SXxru | |
108 | TOOL_LLVMGCC42MACHO_STRIP_DLL ?= strip -Sxru | |
109 | TOOL_LLVMGCC42MACHO_STRIP_SYSMOD ?= strip -Sru | |
110 | ||
111 | ||
112 | ## | |
113 | # Calculate the files in the debug bundle. | |
114 | # @param 1 The whole output filename. | |
115 | # @param 2 The output filename sans suffix. | |
116 | TOOL_LLVMGCC42MACHO_DEBUG_BUNDLE_FN = \ | |
117 | $(1).dSYM/ \ | |
118 | $(1).dSYM/Contents/ \ | |
119 | $(1).dSYM/Contents/Resources/ \ | |
120 | $(1).dSYM/Contents/Resources/DWARF/ \ | |
121 | $(1).dSYM/Contents/Info.plist \ | |
122 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1)) | |
123 | ||
124 | ## | |
125 | # Calculate the files in the debug bundle. | |
126 | # @param 1 The whole linker output filename. | |
127 | # @param 2 The linker output filename sans suffix. | |
128 | # @param 3 The desired install name (no dir slash). | |
129 | # @remarks The Info.plist has some reference to the original name, but gdb | |
130 | # does not care and only check for a symbol file in the DWARF | |
131 | # directory with the same name as the debugged module. | |
132 | TOOL_LLVMGCC42MACHO_DEBUG_INSTALL_FN= \ | |
133 | $(3).dSYM/ \ | |
134 | $(3).dSYM/Contents/ \ | |
135 | $(3).dSYM/Contents/Resources/ \ | |
136 | $(3).dSYM/Contents/Resources/DWARF/ \ | |
137 | $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \ | |
138 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(3)) | |
139 | ||
140 | ||
141 | ## Compile C source. | |
142 | # @param $(target) Normalized main target name. | |
143 | # @param $(source) Source filename (relative). | |
144 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
145 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
146 | # @param $(flags) Flags. | |
147 | # @param $(defs) Definitions. No -D or something. | |
148 | # @param $(incs) Includes. No -I or something. | |
149 | # @param $(dirdep) Directory creation dependency. | |
150 | # @param $(deps) Other dependencies. | |
151 | # | |
152 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
153 | # @param $(objsuff) Object suffix. | |
154 | TOOL_LLVMGCC42MACHO_COMPILE_C_DEPEND = | |
155 | TOOL_LLVMGCC42MACHO_COMPILE_C_DEPORD = | |
156 | ifdef KBUILD_USE_KOBJCACHE | |
157 | TOOL_LLVMGCC42MACHO_COMPILE_C_USES_KOBJCACHE = 1 | |
158 | TOOL_LLVMGCC42MACHO_COMPILE_C_OUTPUT = $(outbase).i | |
159 | define TOOL_LLVMGCC42MACHO_COMPILE_C_CMDS | |
160 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
161 | --kObjCache-cpp $(outbase).i\ | |
162 | $(TOOL_LLVMGCC42MACHO_CC) -E -o -\ | |
163 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
164 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
165 | $(abspath $(source))\ | |
166 | --kObjCache-cc $(obj)\ | |
167 | $(TOOL_LLVMGCC42MACHO_CC) -c\ | |
168 | $(flags) -fpreprocessed -x c\ | |
169 | -o $(obj)\ | |
170 | - | |
171 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
172 | endef | |
173 | else # !KBUILD_USE_KOBJCACHE | |
174 | TOOL_LLVMGCC42MACHO_COMPILE_C_OUTPUT = | |
175 | define TOOL_LLVMGCC42MACHO_COMPILE_C_CMDS | |
176 | $(QUIET)$(TOOL_LLVMGCC42MACHO_CC) -c\ | |
177 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
178 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
179 | -o $(obj)\ | |
180 | $(abspath $(source)) | |
181 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
182 | endef | |
183 | endif # !KUSE_OBJCACHE | |
184 | ||
185 | ||
186 | ## Compile C++ source. | |
187 | # @param $(target) Normalized main target name. | |
188 | # @param $(source) Source filename (relative). | |
189 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
190 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
191 | # @param $(flags) Flags. | |
192 | # @param $(defs) Definitions. No -D or something. | |
193 | # @param $(incs) Includes. No -I or something. | |
194 | # @param $(dirdep) Directory creation dependency. | |
195 | # @param $(deps) Other dependencies. | |
196 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
197 | # @param $(objsuff) Object suffix. | |
198 | TOOL_LLVMGCC42MACHO_COMPILE_CXX_DEPEND = | |
199 | TOOL_LLVMGCC42MACHO_COMPILE_CXX_DEPORD = | |
200 | ifdef KBUILD_USE_KOBJCACHE | |
201 | TOOL_LLVMGCC42MACHO_COMPILE_CXX_USES_KOBJCACHE = 1 | |
202 | TOOL_LLVMGCC42MACHO_COMPILE_CXX_OUTPUT = $(outbase).ii | |
203 | define TOOL_LLVMGCC42MACHO_COMPILE_CXX_CMDS | |
204 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
205 | --kObjCache-cpp $(outbase).ii\ | |
206 | $(TOOL_LLVMGCC42MACHO_CXX) -E -o -\ | |
207 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
208 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
209 | $(abspath $(source))\ | |
210 | --kObjCache-cc $(obj)\ | |
211 | $(TOOL_LLVMGCC42MACHO_CXX) -c\ | |
212 | $(flags) -fpreprocessed -x c++\ | |
213 | -o $(obj)\ | |
214 | - | |
215 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
216 | endef | |
217 | else # !KBUILD_USE_KOBJCACHE | |
218 | TOOL_LLVMGCC42MACHO_COMPILE_CXX_OUTPUT = | |
219 | define TOOL_LLVMGCC42MACHO_COMPILE_CXX_CMDS | |
220 | $(QUIET)$(TOOL_LLVMGCC42MACHO_CXX) -c\ | |
221 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
222 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
223 | -o $(obj)\ | |
224 | $(abspath $(source)) | |
225 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
226 | endef | |
227 | endif # !KBUILD_USE_KOBJCACHE | |
228 | ||
229 | ||
230 | ## Compile Objective-C source. | |
231 | # @param $(target) Normalized main target name. | |
232 | # @param $(source) Source filename (relative). | |
233 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
234 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
235 | # @param $(flags) Flags. | |
236 | # @param $(defs) Definitions. No -D or something. | |
237 | # @param $(incs) Includes. No -I or something. | |
238 | # @param $(dirdep) Directory creation dependency. | |
239 | # @param $(deps) Other dependencies. | |
240 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
241 | # @param $(objsuff) Object suffix. | |
242 | TOOL_LLVMGCC42MACHO_COMPILE_OBJC_DEPEND = | |
243 | TOOL_LLVMGCC42MACHO_COMPILE_OBJC_DEPORD = | |
244 | ifdef KBUILD_USE_KOBJCACHE | |
245 | TOOL_LLVMGCC42MACHO_COMPILE_OBJC_USES_KOBJCACHE = 1 | |
246 | TOOL_LLVMGCC42MACHO_COMPILE_OBJC_OUTPUT = $(outbase).mi | |
247 | define TOOL_LLVMGCC42MACHO_COMPILE_OBJC_CMDS | |
248 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
249 | --kObjCache-cpp $(outbase).ii\ | |
250 | $(TOOL_LLVMGCC42MACHO_OBJC) -E -o -\ | |
251 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
252 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
253 | $(abspath $(source))\ | |
254 | --kObjCache-cc $(obj)\ | |
255 | $(TOOL_LLVMGCC42MACHO_OBJC) -c\ | |
256 | $(flags) -fpreprocessed -x cbjective-c\ | |
257 | -o $(obj)\ | |
258 | - | |
259 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
260 | endef | |
261 | else # !KBUILD_USE_KOBJCACHE | |
262 | TOOL_LLVMGCC42MACHO_COMPILE_OBJC_OUTPUT = | |
263 | define TOOL_LLVMGCC42MACHO_COMPILE_OBJC_CMDS | |
264 | $(QUIET)$(TOOL_LLVMGCC42MACHO_OBJC) -c\ | |
265 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
266 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
267 | -o $(obj)\ | |
268 | $(abspath $(source)) | |
269 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
270 | endef | |
271 | endif # !KBUILD_USE_KOBJCACHE | |
272 | ||
273 | ||
274 | ## Compile Objective-C++ source. | |
275 | # @param $(target) Normalized main target name. | |
276 | # @param $(source) Source filename (relative). | |
277 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
278 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
279 | # @param $(flags) Flags. | |
280 | # @param $(defs) Definitions. No -D or something. | |
281 | # @param $(incs) Includes. No -I or something. | |
282 | # @param $(dirdep) Directory creation dependency. | |
283 | # @param $(deps) Other dependencies. | |
284 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
285 | # @param $(objsuff) Object suffix. | |
286 | TOOL_LLVMGCC42MACHO_COMPILE_OBJCXX_DEPEND = | |
287 | TOOL_LLVMGCC42MACHO_COMPILE_OBJCXX_DEPORD = | |
288 | ifdef KBUILD_USE_KOBJCACHE | |
289 | TOOL_LLVMGCC42MACHO_COMPILE_OBJCXX_USES_KOBJCACHE = 1 | |
290 | TOOL_LLVMGCC42MACHO_COMPILE_OBJCXX_OUTPUT = $(outbase).mii | |
291 | define TOOL_LLVMGCC42MACHO_COMPILE_OBJCXX_CMDS | |
292 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
293 | --kObjCache-cpp $(outbase).mii\ | |
294 | $(TOOL_LLVMGCC42MACHO_OBJCXX) -E -o -\ | |
295 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
296 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
297 | $(abspath $(source))\ | |
298 | --kObjCache-cc $(obj)\ | |
299 | $(TOOL_LLVMGCC42MACHO_OBJCXX) -c\ | |
300 | $(flags) -fpreprocessed -x objective-c++\ | |
301 | -o $(obj)\ | |
302 | - | |
303 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
304 | endef | |
305 | else # !KBUILD_USE_KOBJCACHE | |
306 | TOOL_LLVMGCC42MACHO_COMPILE_OBJCXX_OUTPUT = | |
307 | define TOOL_LLVMGCC42MACHO_COMPILE_OBJCXX_CMDS | |
308 | $(QUIET)$(TOOL_LLVMGCC42MACHO_OBJCXX) -c\ | |
309 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
310 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
311 | -o $(obj)\ | |
312 | $(abspath $(source)) | |
313 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
314 | endef | |
315 | endif # !KBUILD_USE_KOBJCACHE | |
316 | ||
317 | ||
318 | ## Compile Assembly source. | |
319 | # @param $(target) Normalized main target name. | |
320 | # @param $(source) Source filename (relative). | |
321 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
322 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
323 | # @param $(flags) Flags. | |
324 | # @param $(defs) Definitions. No -D or something. | |
325 | # @param $(incs) Includes. No -I or something. | |
326 | # @param $(dirdep) Directory creation dependency. | |
327 | # @param $(deps) Other dependencies. | |
328 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
329 | # @param $(objsuff) Object suffix. | |
330 | # | |
331 | TOOL_LLVMGCC42MACHO_COMPILE_AS_OUTPUT = | |
332 | TOOL_LLVMGCC42MACHO_COMPILE_AS_DEPEND = | |
333 | TOOL_LLVMGCC42MACHO_COMPILE_AS_DEPORD = | |
334 | define TOOL_LLVMGCC42MACHO_COMPILE_AS_CMDS | |
335 | $(QUIET)$(TOOL_LLVMGCC42MACHO_AS) -c\ | |
336 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
337 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
338 | -o $(obj)\ | |
339 | $(abspath $(source)) | |
340 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
341 | endef | |
342 | ||
343 | ||
344 | ## Link library | |
345 | # @param $(target) Normalized main target name. | |
346 | # @param $(out) Library name. | |
347 | # @param $(objs) Object files to put in the library. | |
348 | # @param $(flags) Flags. | |
349 | # @param $(dirdep) Directory creation dependency. | |
350 | # @param $(deps) Other dependencies. | |
351 | # @param $(othersrc) Unhandled sources. | |
352 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
353 | TOOL_LLVMGCC42MACHO_LINK_LIBRARY_OUTPUT = | |
354 | TOOL_LLVMGCC42MACHO_LINK_LIBRARY_DEPEND = $(othersrc) | |
355 | TOOL_LLVMGCC42MACHO_LINK_LIBRARY_DEPORD = | |
356 | define TOOL_LLVMGCC42MACHO_LINK_LIBRARY_CMDS | |
357 | $(if $(strip $(objs)),$(call xargs,$(QUIET)$(TOOL_LLVMGCC42MACHO_AR) $(flags) $(out),$(objs))) | |
358 | $(foreach lib,$(othersrc)\ | |
359 | ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \ | |
360 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \ | |
361 | $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \ | |
362 | $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \ | |
363 | && $(TOOL_LLVMGCC42MACHO_AR) -x $(abspath $(lib)) \ | |
364 | && $(RM_EXT) -f ./__.SYMDEF* \ | |
365 | && $(TOOL_LLVMGCC42MACHO_AR) $(flags) $(out) *) \ | |
366 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \ | |
367 | $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/) | |
368 | endef | |
369 | ||
370 | ||
371 | ## Link program | |
372 | # @param $(target) Normalized main target name. | |
373 | # @param $(out) Program name. | |
374 | # @param $(objs) Object files to link together. | |
375 | # @param $(libs) Libraries to search. | |
376 | # @param $(libpath) Library search paths. | |
377 | # @param $(flags) Flags. | |
378 | # @param $(dirdep) Directory creation dependency. | |
379 | # @param $(deps) Other dependencies. | |
380 | # @param $(othersrc) Unhandled sources. | |
381 | # @param $(custom_pre) Custom step invoked before linking. | |
382 | # @param $(custom_post) Custom step invoked after linking. | |
383 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
384 | TOOL_LLVMGCC42MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp | |
385 | TOOL_LLVMGCC42MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_LLVMGCC42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
386 | TOOL_LLVMGCC42MACHO_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_LLVMGCC42MACHO_DEBUG_INSTALL_FN) | |
387 | TOOL_LLVMGCC42MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
388 | TOOL_LLVMGCC42MACHO_LINK_PROGRAM_DEPORD = | |
389 | define TOOL_LLVMGCC42MACHO_LINK_PROGRAM_CMDS | |
390 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
391 | $(QUIET)$(TOOL_LLVMGCC42MACHO_LD) $(flags) -o $(out)\ | |
392 | -filelist $(outbase).rsp\ | |
393 | $(foreach p,$(libpath), -L$(p))\ | |
394 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
395 | ifeq ($(ld_debug),split) | |
396 | $(QUIET)$(TOOL_LLVMGCC42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
397 | $(QUIET)$(TOOL_LLVMGCC42MACHO_STRIP_PROGRAM) $(out) | |
398 | endif | |
399 | endef | |
400 | ||
401 | ||
402 | ||
403 | ## Link DLL | |
404 | # @param $(target) Normalized main target name. | |
405 | # @param $(out) Program name. | |
406 | # @param $(objs) Object files to link together. | |
407 | # @param $(libs) Libraries to search. | |
408 | # @param $(libpath) Library search paths. | |
409 | # @param $(flags) Flags. | |
410 | # @param $(dirdep) Directory creation dependency. | |
411 | # @param $(deps) Other dependencies. | |
412 | # @param $(othersrc) Unhandled sources. | |
413 | # @param $(custom_pre) Custom step invoked before linking. | |
414 | # @param $(custom_post) Custom step invoked after linking. | |
415 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
416 | TOOL_LLVMGCC42MACHO_LINK_DLL_OUTPUT = $(outbase).rsp | |
417 | TOOL_LLVMGCC42MACHO_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_LLVMGCC42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
418 | TOOL_LLVMGCC42MACHO_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_LLVMGCC42MACHO_DEBUG_INSTALL_FN) | |
419 | TOOL_LLVMGCC42MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
420 | TOOL_LLVMGCC42MACHO_LINK_DLL_DEPORD = | |
421 | define TOOL_LLVMGCC42MACHO_LINK_DLL_CMDS | |
422 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
423 | $(QUIET)$(TOOL_LLVMGCC42MACHO_LD) $(TOOL_LLVMGCC42MACHO_LDFLAGS.dll) $(flags) -o $(out)\ | |
424 | $(call TOOL_LLVMGCC42MACHO_LD_SONAME,$(target),$(out))\ | |
425 | -filelist $(outbase).rsp\ | |
426 | $(foreach p,$(libpath), -L$(p))\ | |
427 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
428 | ifeq ($(ld_debug),split) | |
429 | $(QUIET)$(TOOL_LLVMGCC42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
430 | $(QUIET)$(TOOL_LLVMGCC42MACHO_STRIP_DLL) $(out) | |
431 | endif | |
432 | endef | |
433 | ||
434 | ||
435 | ## Link system module (windows aka driver, linux aka kernel module) | |
436 | # @param $(target) Normalized main target name. | |
437 | # @param $(out) System module name. | |
438 | # @param $(objs) Object files to link together. | |
439 | # @param $(libs) Libraries to search. | |
440 | # @param $(libpath) Library search paths. | |
441 | # @param $(flags) Flags. | |
442 | # @param $(dirdep) Directory creation dependency. | |
443 | # @param $(deps) Other dependencies. | |
444 | # @param $(othersrc) Unhandled sources. | |
445 | # @param $(custom_pre) Custom step invoked before linking. | |
446 | # @param $(custom_post) Custom step invoked after linking. | |
447 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
448 | TOOL_LLVMGCC42MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp | |
449 | TOOL_LLVMGCC42MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_LLVMGCC42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
450 | TOOL_LLVMGCC42MACHO_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_LLVMGCC42MACHO_DEBUG_INSTALL_FN) | |
451 | TOOL_LLVMGCC42MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
452 | TOOL_LLVMGCC42MACHO_LINK_SYSMOD_DEPORD = | |
453 | define TOOL_LLVMGCC42MACHO_LINK_SYSMOD_CMDS | |
454 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
455 | $(QUIET)$(TOOL_LLVMGCC42MACHO_LD_SYSMOD) $(TOOL_LLVMGCC42MACHO_LDFLAGS.sysmod) $(flags) -o $(out)\ | |
456 | -filelist $(outbase).rsp\ | |
457 | $(foreach p,$(libpath), -L$(p))\ | |
458 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
459 | ifeq ($(ld_debug),split) | |
460 | $(QUIET)$(TOOL_LLVMGCC42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
461 | $(QUIET)$(TOOL_LLVMGCC42MACHO_STRIP_SYSMOD) $(out) | |
462 | endif | |
463 | endef | |
464 |
0 | # $Id: LLVMGXX42MACHO.kmk 2547 2011-11-04 21:58:53Z bird $ | |
1 | ## @file | |
2 | # kBuild Tool Config - LLVM GCC v4.2.x targeting Darwin (Mac OS X) Mach-O, for building C++ code. | |
3 | # | |
4 | ||
5 | # | |
6 | # Copyright (c) 2004-2011 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | # | |
8 | # This file is part of kBuild. | |
9 | # | |
10 | # kBuild is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 2 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # kBuild is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with kBuild; if not, write to the Free Software | |
22 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 | # | |
24 | # | |
25 | # As a special exception you are granted permission to include this file, via | |
26 | # the kmk include directive, as you wish without this in itself causing the | |
27 | # resulting makefile, program or whatever to be covered by the GPL license. | |
28 | # This exception does not however invalidate any other reasons why the makefile, | |
29 | # program, whatever should not be covered the GPL. | |
30 | # | |
31 | # | |
32 | ||
33 | TOOL_LLVMGXX42MACHO := LLVM GCC v4.2.x targeting Darwin (Mac OS X) Mach-O, for building C++ code. | |
34 | ||
35 | # Tool Specific Properties | |
36 | TOOL_LLVMGXX42MACHO_PREFIX ?= llvm- | |
37 | TOOL_LLVMGXX42MACHO_SUFFIX ?= -4.2$(HOSTSUFF_EXE) | |
38 | TOOL_LLVMGXX42MACHO_CC ?= $(TOOL_LLVMGXX42MACHO_PREFIX)gcc$(TOOL_LLVMGXX42MACHO_SUFFIX) | |
39 | TOOL_LLVMGXX42MACHO_CXX ?= $(TOOL_LLVMGXX42MACHO_PREFIX)g++$(TOOL_LLVMGXX42MACHO_SUFFIX) | |
40 | TOOL_LLVMGXX42MACHO_OBJC ?= $(TOOL_LLVMGXX42MACHO_PREFIX)gcc$(TOOL_LLVMGXX42MACHO_SUFFIX) | |
41 | TOOL_LLVMGXX42MACHO_OBJCXX ?= $(TOOL_LLVMGXX42MACHO_PREFIX)gcc$(TOOL_LLVMGXX42MACHO_SUFFIX) | |
42 | TOOL_LLVMGXX42MACHO_AS ?= $(TOOL_LLVMGXX42MACHO_PREFIX)gcc$(TOOL_LLVMGXX42MACHO_SUFFIX) | |
43 | TOOL_LLVMGXX42MACHO_LD ?= $(TOOL_LLVMGXX42MACHO_PREFIX)g++$(TOOL_LLVMGXX42MACHO_SUFFIX) | |
44 | TOOL_LLVMGXX42MACHO_LD_SYSMOD ?= $(TOOL_LLVMGXX42MACHO_PREFIX)g++$(TOOL_LLVMGXX42MACHO_SUFFIX) | |
45 | ifndef TOOL_LLVMGXX42MACHO_LDFLAGS.$(KBUILD_TARGET) | |
46 | TOOL_LLVMGXX42MACHO_LDFLAGS.dll ?= -dynamiclib | |
47 | else | |
48 | TOOL_LLVMGXX42MACHO_LDFLAGS.dll ?= $(TOOL_LLVMGXX42MACHO_LDFLAGS.$(KBUILD_TARGET)) | |
49 | endif | |
50 | TOOL_LLVMGXX42MACHO_LDFLAGS.sysmod ?= -r | |
51 | #TOOL_LLVMGXX42MACHO_LD_SONAME = -Wl,-dylib_install_name $(firstword $($(1)_SONAME.$(KBUILD_TARGET).$(KBUILD_TYPE)) $($(1)_SONAME.$(KBUILD_TARGET)) $($(1)_SONAME.$(KBUILD_TYPE)) $($(1)_SONAME) $(notdir $(2))) | |
52 | TOOL_LLVMGXX42MACHO_DSYMUTIL ?= dsymutil | |
53 | ||
54 | ifdef SLKRUNS | |
55 | TOOL_LLVMGXX42MACHO_CC += -fmessage-length=0 | |
56 | TOOL_LLVMGXX42MACHO_CXX += -fmessage-length=0 | |
57 | TOOL_LLVMGXX42MACHO_OBJC += -fmessage-length=0 | |
58 | TOOL_LLVMGXX42MACHO_OBJCXX += -fmessage-length=0 | |
59 | endif | |
60 | ||
61 | # General Properties used by kBuild | |
62 | TOOL_LLVMGXX42MACHO_COBJSUFF ?= .o | |
63 | TOOL_LLVMGXX42MACHO_CFLAGS ?= | |
64 | TOOL_LLVMGXX42MACHO_CFLAGS.debug ?= -g | |
65 | TOOL_LLVMGXX42MACHO_CFLAGS.profile ?= -O2 #-g -pg | |
66 | TOOL_LLVMGXX42MACHO_CFLAGS.release ?= -O2 | |
67 | TOOL_LLVMGXX42MACHO_CINCS ?= | |
68 | TOOL_LLVMGXX42MACHO_CDEFS ?= | |
69 | ||
70 | TOOL_LLVMGXX42MACHO_CXXOBJSUFF ?= .o | |
71 | TOOL_LLVMGXX42MACHO_CXXFLAGS ?= | |
72 | TOOL_LLVMGXX42MACHO_CXXFLAGS.debug ?= -g | |
73 | TOOL_LLVMGXX42MACHO_CXXFLAGS.profile ?= -O2 #-g -pg | |
74 | TOOL_LLVMGXX42MACHO_CXXFLAGS.release ?= -O2 | |
75 | TOOL_LLVMGXX42MACHO_CXXINCS ?= | |
76 | TOOL_LLVMGXX42MACHO_CXXDEFS ?= | |
77 | ||
78 | TOOL_LLVMGXX42MACHO_OBJCOBJSUFF ?= .o | |
79 | TOOL_LLVMGXX42MACHO_OBJCFLAGS ?= | |
80 | TOOL_LLVMGXX42MACHO_OBJCFLAGS.debug ?= -g | |
81 | TOOL_LLVMGXX42MACHO_OBJCFLAGS.profile?= -O2 #-g -pg | |
82 | TOOL_LLVMGXX42MACHO_OBJCFLAGS.release?= -O2 | |
83 | TOOL_LLVMGXX42MACHO_OBJCINCS ?= | |
84 | TOOL_LLVMGXX42MACHO_OBJCDEFS ?= | |
85 | ||
86 | TOOL_LLVMGXX42MACHO_OBJCXXOBJSUFF ?= .o | |
87 | TOOL_LLVMGXX42MACHO_OBJCXXFLAGS ?= | |
88 | TOOL_LLVMGXX42MACHO_OBJCXXFLAGS.debug ?= -g | |
89 | TOOL_LLVMGXX42MACHO_OBJCXXFLAGS.profile ?= -O2 #-g -pg | |
90 | TOOL_LLVMGXX42MACHO_OBJCXXFLAGS.release ?= -O2 | |
91 | TOOL_LLVMGXX42MACHO_OBJCXXINCS ?= | |
92 | TOOL_LLVMGXX42MACHO_OBJCXXDEFS ?= | |
93 | ||
94 | TOOL_LLVMGXX42MACHO_ASFLAGS ?= -x assembler-with-cpp | |
95 | TOOL_LLVMGXX42MACHO_ASFLAGS.debug ?= -g | |
96 | TOOL_LLVMGXX42MACHO_ASFLAGS.profile ?= -g | |
97 | TOOL_LLVMGXX42MACHO_ASOBJSUFF ?= .o | |
98 | ||
99 | TOOL_LLVMGXX42MACHO_AR ?= ar$(HOSTSUFF_EXE) | |
100 | TOOL_LLVMGXX42MACHO_ARFLAGS ?= -c -rs | |
101 | TOOL_LLVMGXX42MACHO_ARLIBSUFF ?= .a | |
102 | ||
103 | TOOL_LLVMGXX42MACHO_LDFLAGS ?= | |
104 | TOOL_LLVMGXX42MACHO_LDFLAGS.debug ?= -g | |
105 | TOOL_LLVMGXX42MACHO_LDFLAGS.profile ?= -g | |
106 | ||
107 | TOOL_LLVMGXX42MACHO_STRIP_PROGRAM ?= strip -SXxru | |
108 | TOOL_LLVMGXX42MACHO_STRIP_DLL ?= strip -Sxru | |
109 | TOOL_LLVMGXX42MACHO_STRIP_SYSMOD ?= strip -Sru | |
110 | ||
111 | ||
112 | ## | |
113 | # Calculate the files in the debug bundle. | |
114 | # @param 1 The whole output filename. | |
115 | # @param 2 The output filename sans suffix. | |
116 | TOOL_LLVMGXX42MACHO_DEBUG_BUNDLE_FN = \ | |
117 | $(1).dSYM/ \ | |
118 | $(1).dSYM/Contents/ \ | |
119 | $(1).dSYM/Contents/Resources/ \ | |
120 | $(1).dSYM/Contents/Resources/DWARF/ \ | |
121 | $(1).dSYM/Contents/Info.plist \ | |
122 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1)) | |
123 | ||
124 | ## | |
125 | # Calculate the files in the debug bundle. | |
126 | # @param 1 The whole linker output filename. | |
127 | # @param 2 The linker output filename sans suffix. | |
128 | # @param 3 The desired install name (no dir slash). | |
129 | # @remarks The Info.plist has some reference to the original name, but gdb | |
130 | # does not care and only check for a symbol file in the DWARF | |
131 | # directory with the same name as the debugged module. | |
132 | TOOL_LLVMGXX42MACHO_DEBUG_INSTALL_FN= \ | |
133 | $(3).dSYM/ \ | |
134 | $(3).dSYM/Contents/ \ | |
135 | $(3).dSYM/Contents/Resources/ \ | |
136 | $(3).dSYM/Contents/Resources/DWARF/ \ | |
137 | $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \ | |
138 | $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(3)) | |
139 | ||
140 | ||
141 | ## Compile C source. | |
142 | # @param $(target) Normalized main target name. | |
143 | # @param $(source) Source filename (relative). | |
144 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
145 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
146 | # @param $(flags) Flags. | |
147 | # @param $(defs) Definitions. No -D or something. | |
148 | # @param $(incs) Includes. No -I or something. | |
149 | # @param $(dirdep) Directory creation dependency. | |
150 | # @param $(deps) Other dependencies. | |
151 | # | |
152 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
153 | # @param $(objsuff) Object suffix. | |
154 | TOOL_LLVMGXX42MACHO_COMPILE_C_DEPEND = | |
155 | TOOL_LLVMGXX42MACHO_COMPILE_C_DEPORD = | |
156 | ifdef KBUILD_USE_KOBJCACHE | |
157 | TOOL_LLVMGXX42MACHO_COMPILE_C_USES_KOBJCACHE = 1 | |
158 | TOOL_LLVMGXX42MACHO_COMPILE_C_OUTPUT = $(outbase).i | |
159 | define TOOL_LLVMGXX42MACHO_COMPILE_C_CMDS | |
160 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
161 | --kObjCache-cpp $(outbase).i\ | |
162 | $(TOOL_LLVMGXX42MACHO_CC) -E -o -\ | |
163 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
164 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
165 | $(abspath $(source))\ | |
166 | --kObjCache-cc $(obj)\ | |
167 | $(TOOL_LLVMGXX42MACHO_CC) -c\ | |
168 | $(flags) -fpreprocessed -x c\ | |
169 | -o $(obj)\ | |
170 | - | |
171 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
172 | endef | |
173 | else # !KBUILD_USE_KOBJCACHE | |
174 | TOOL_LLVMGXX42MACHO_COMPILE_C_OUTPUT = | |
175 | define TOOL_LLVMGXX42MACHO_COMPILE_C_CMDS | |
176 | $(QUIET)$(TOOL_LLVMGXX42MACHO_CC) -c\ | |
177 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
178 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
179 | -o $(obj)\ | |
180 | $(abspath $(source)) | |
181 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
182 | endef | |
183 | endif # !KUSE_OBJCACHE | |
184 | ||
185 | ||
186 | ## Compile C++ source. | |
187 | # @param $(target) Normalized main target name. | |
188 | # @param $(source) Source filename (relative). | |
189 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
190 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
191 | # @param $(flags) Flags. | |
192 | # @param $(defs) Definitions. No -D or something. | |
193 | # @param $(incs) Includes. No -I or something. | |
194 | # @param $(dirdep) Directory creation dependency. | |
195 | # @param $(deps) Other dependencies. | |
196 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
197 | # @param $(objsuff) Object suffix. | |
198 | TOOL_LLVMGXX42MACHO_COMPILE_CXX_DEPEND = | |
199 | TOOL_LLVMGXX42MACHO_COMPILE_CXX_DEPORD = | |
200 | ifdef KBUILD_USE_KOBJCACHE | |
201 | TOOL_LLVMGXX42MACHO_COMPILE_CXX_USES_KOBJCACHE = 1 | |
202 | TOOL_LLVMGXX42MACHO_COMPILE_CXX_OUTPUT = $(outbase).ii | |
203 | define TOOL_LLVMGXX42MACHO_COMPILE_CXX_CMDS | |
204 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
205 | --kObjCache-cpp $(outbase).ii\ | |
206 | $(TOOL_LLVMGXX42MACHO_CXX) -E -o -\ | |
207 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
208 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
209 | $(abspath $(source))\ | |
210 | --kObjCache-cc $(obj)\ | |
211 | $(TOOL_LLVMGXX42MACHO_CXX) -c\ | |
212 | $(flags) -fpreprocessed -x c++\ | |
213 | -o $(obj)\ | |
214 | - | |
215 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
216 | endef | |
217 | else # !KBUILD_USE_KOBJCACHE | |
218 | TOOL_LLVMGXX42MACHO_COMPILE_CXX_OUTPUT = | |
219 | define TOOL_LLVMGXX42MACHO_COMPILE_CXX_CMDS | |
220 | $(QUIET)$(TOOL_LLVMGXX42MACHO_CXX) -c\ | |
221 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
222 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
223 | -o $(obj)\ | |
224 | $(abspath $(source)) | |
225 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
226 | endef | |
227 | endif # !KBUILD_USE_KOBJCACHE | |
228 | ||
229 | ||
230 | ## Compile Objective-C source. | |
231 | # @param $(target) Normalized main target name. | |
232 | # @param $(source) Source filename (relative). | |
233 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
234 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
235 | # @param $(flags) Flags. | |
236 | # @param $(defs) Definitions. No -D or something. | |
237 | # @param $(incs) Includes. No -I or something. | |
238 | # @param $(dirdep) Directory creation dependency. | |
239 | # @param $(deps) Other dependencies. | |
240 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
241 | # @param $(objsuff) Object suffix. | |
242 | TOOL_LLVMGXX42MACHO_COMPILE_OBJC_DEPEND = | |
243 | TOOL_LLVMGXX42MACHO_COMPILE_OBJC_DEPORD = | |
244 | ifdef KBUILD_USE_KOBJCACHE | |
245 | TOOL_LLVMGXX42MACHO_COMPILE_OBJC_USES_KOBJCACHE = 1 | |
246 | TOOL_LLVMGXX42MACHO_COMPILE_OBJC_OUTPUT = $(outbase).mi | |
247 | define TOOL_LLVMGXX42MACHO_COMPILE_OBJC_CMDS | |
248 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
249 | --kObjCache-cpp $(outbase).ii\ | |
250 | $(TOOL_LLVMGXX42MACHO_OBJC) -E -o -\ | |
251 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
252 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
253 | $(abspath $(source))\ | |
254 | --kObjCache-cc $(obj)\ | |
255 | $(TOOL_LLVMGXX42MACHO_OBJC) -c\ | |
256 | $(flags) -fpreprocessed -x objective-c \ | |
257 | -o $(obj)\ | |
258 | - | |
259 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
260 | endef | |
261 | else # !KBUILD_USE_KOBJCACHE | |
262 | TOOL_LLVMGXX42MACHO_COMPILE_OBJC_OUTPUT = | |
263 | define TOOL_LLVMGXX42MACHO_COMPILE_OBJC_CMDS | |
264 | $(QUIET)$(TOOL_LLVMGXX42MACHO_OBJC) -c\ | |
265 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
266 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
267 | -o $(obj)\ | |
268 | $(abspath $(source)) | |
269 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
270 | endef | |
271 | endif # !KBUILD_USE_KOBJCACHE | |
272 | ||
273 | ||
274 | ## Compile Objective-C++ source. | |
275 | # @param $(target) Normalized main target name. | |
276 | # @param $(source) Source filename (relative). | |
277 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
278 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
279 | # @param $(flags) Flags. | |
280 | # @param $(defs) Definitions. No -D or something. | |
281 | # @param $(incs) Includes. No -I or something. | |
282 | # @param $(dirdep) Directory creation dependency. | |
283 | # @param $(deps) Other dependencies. | |
284 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
285 | # @param $(objsuff) Object suffix. | |
286 | TOOL_LLVMGXX42MACHO_COMPILE_OBJCXX_DEPEND = | |
287 | TOOL_LLVMGXX42MACHO_COMPILE_OBJCXX_DEPORD = | |
288 | ifdef KBUILD_USE_KOBJCACHE | |
289 | TOOL_LLVMGXX42MACHO_COMPILE_OBJCXX_USES_KOBJCACHE = 1 | |
290 | TOOL_LLVMGXX42MACHO_COMPILE_OBJCXX_OUTPUT = $(outbase).mii | |
291 | define TOOL_LLVMGXX42MACHO_COMPILE_OBJCXX_CMDS | |
292 | $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\ | |
293 | --kObjCache-cpp $(outbase).mii\ | |
294 | $(TOOL_LLVMGXX42MACHO_OBJCXX) -E -o -\ | |
295 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
296 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
297 | $(abspath $(source))\ | |
298 | --kObjCache-cc $(obj)\ | |
299 | $(TOOL_LLVMGXX42MACHO_OBJCXX) -c\ | |
300 | $(flags) -fpreprocessed -x objective-c++ \ | |
301 | -o $(obj)\ | |
302 | - | |
303 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
304 | endef | |
305 | else # !KBUILD_USE_KOBJCACHE | |
306 | TOOL_LLVMGXX42MACHO_COMPILE_OBJCXX_OUTPUT = | |
307 | define TOOL_LLVMGXX42MACHO_COMPILE_OBJCXX_CMDS | |
308 | $(QUIET)$(TOOL_LLVMGXX42MACHO_OBJCXX) -c\ | |
309 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
310 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
311 | -o $(obj)\ | |
312 | $(abspath $(source)) | |
313 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
314 | endef | |
315 | endif # !KBUILD_USE_KOBJCACHE | |
316 | ||
317 | ||
318 | ## Compile Assembly source. | |
319 | # @param $(target) Normalized main target name. | |
320 | # @param $(source) Source filename (relative). | |
321 | # @param $(obj) Object file name. This shall be (re)created by the compilation. | |
322 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation. | |
323 | # @param $(flags) Flags. | |
324 | # @param $(defs) Definitions. No -D or something. | |
325 | # @param $(incs) Includes. No -I or something. | |
326 | # @param $(dirdep) Directory creation dependency. | |
327 | # @param $(deps) Other dependencies. | |
328 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
329 | # @param $(objsuff) Object suffix. | |
330 | # | |
331 | TOOL_LLVMGXX42MACHO_COMPILE_AS_OUTPUT = | |
332 | TOOL_LLVMGXX42MACHO_COMPILE_AS_DEPEND = | |
333 | TOOL_LLVMGXX42MACHO_COMPILE_AS_DEPORD = | |
334 | define TOOL_LLVMGXX42MACHO_COMPILE_AS_CMDS | |
335 | $(QUIET)$(TOOL_LLVMGXX42MACHO_AS) -c\ | |
336 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\ | |
337 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\ | |
338 | -o $(obj)\ | |
339 | $(abspath $(source)) | |
340 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" "" | |
341 | endef | |
342 | ||
343 | ||
344 | ## Link library | |
345 | # @param $(target) Normalized main target name. | |
346 | # @param $(out) Library name. | |
347 | # @param $(objs) Object files to put in the library. | |
348 | # @param $(flags) Flags. | |
349 | # @param $(dirdep) Directory creation dependency. | |
350 | # @param $(deps) Other dependencies. | |
351 | # @param $(othersrc) Unhandled sources. | |
352 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
353 | TOOL_LLVMGXX42MACHO_LINK_LIBRARY_OUTPUT = | |
354 | TOOL_LLVMGXX42MACHO_LINK_LIBRARY_DEPEND = $(othersrc) | |
355 | TOOL_LLVMGXX42MACHO_LINK_LIBRARY_DEPORD = | |
356 | define TOOL_LLVMGXX42MACHO_LINK_LIBRARY_CMDS | |
357 | $(if $(strip $(objs)),$(call xargs,$(QUIET)$(TOOL_LLVMGXX42MACHO_AR) $(flags) $(out),$(objs))) | |
358 | $(foreach lib,$(othersrc)\ | |
359 | ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \ | |
360 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \ | |
361 | $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \ | |
362 | $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \ | |
363 | && $(TOOL_LLVMGXX42MACHO_AR) -x $(abspath $(lib)) \ | |
364 | && $(RM_EXT) -f ./__.SYMDEF* \ | |
365 | && $(TOOL_LLVMGXX42MACHO_AR) $(flags) $(out) *) \ | |
366 | $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \ | |
367 | $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/) | |
368 | endef | |
369 | ||
370 | ||
371 | ## Link program | |
372 | # @param $(target) Normalized main target name. | |
373 | # @param $(out) Program name. | |
374 | # @param $(objs) Object files to link together. | |
375 | # @param $(libs) Libraries to search. | |
376 | # @param $(libpath) Library search paths. | |
377 | # @param $(flags) Flags. | |
378 | # @param $(dirdep) Directory creation dependency. | |
379 | # @param $(deps) Other dependencies. | |
380 | # @param $(othersrc) Unhandled sources. | |
381 | # @param $(custom_pre) Custom step invoked before linking. | |
382 | # @param $(custom_post) Custom step invoked after linking. | |
383 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
384 | TOOL_LLVMGXX42MACHO_LINK_PROGRAM_OUTPUT = $(outbase).rsp | |
385 | TOOL_LLVMGXX42MACHO_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_LLVMGXX42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
386 | TOOL_LLVMGXX42MACHO_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_LLVMGXX42MACHO_DEBUG_INSTALL_FN) | |
387 | TOOL_LLVMGXX42MACHO_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
388 | TOOL_LLVMGXX42MACHO_LINK_PROGRAM_DEPORD = | |
389 | define TOOL_LLVMGXX42MACHO_LINK_PROGRAM_CMDS | |
390 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
391 | $(QUIET)$(TOOL_LLVMGXX42MACHO_LD) $(flags) -o $(out)\ | |
392 | -filelist $(outbase).rsp\ | |
393 | $(foreach p,$(libpath), -L$(p))\ | |
394 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
395 | ifeq ($(ld_debug),split) | |
396 | $(QUIET)$(TOOL_LLVMGXX42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
397 | $(QUIET)$(TOOL_LLVMGXX42MACHO_STRIP_PROGRAM) $(out) | |
398 | endif | |
399 | endef | |
400 | ||
401 | ||
402 | ## Link DLL | |
403 | # @param $(target) Normalized main target name. | |
404 | # @param $(out) Program name. | |
405 | # @param $(objs) Object files to link together. | |
406 | # @param $(libs) Libraries to search. | |
407 | # @param $(libpath) Library search paths. | |
408 | # @param $(flags) Flags. | |
409 | # @param $(dirdep) Directory creation dependency. | |
410 | # @param $(deps) Other dependencies. | |
411 | # @param $(othersrc) Unhandled sources. | |
412 | # @param $(custom_pre) Custom step invoked before linking. | |
413 | # @param $(custom_post) Custom step invoked after linking. | |
414 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
415 | TOOL_LLVMGXX42MACHO_LINK_DLL_OUTPUT = $(outbase).rsp | |
416 | TOOL_LLVMGXX42MACHO_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_LLVMGXX42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
417 | TOOL_LLVMGXX42MACHO_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_LLVMGXX42MACHO_DEBUG_INSTALL_FN) | |
418 | TOOL_LLVMGXX42MACHO_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
419 | TOOL_LLVMGXX42MACHO_LINK_DLL_DEPORD = | |
420 | define TOOL_LLVMGXX42MACHO_LINK_DLL_CMDS | |
421 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
422 | $(QUIET)$(TOOL_LLVMGXX42MACHO_LD) $(TOOL_LLVMGXX42MACHO_LDFLAGS.dll) $(flags) -o $(out)\ | |
423 | $(call TOOL_LLVMGXX42MACHO_LD_SONAME,$(target),$(out))\ | |
424 | -filelist $(outbase).rsp\ | |
425 | $(foreach p,$(libpath), -L$(p))\ | |
426 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
427 | ifeq ($(ld_debug),split) | |
428 | $(QUIET)$(TOOL_LLVMGXX42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
429 | $(QUIET)$(TOOL_LLVMGXX42MACHO_STRIP_DLL) $(out) | |
430 | endif | |
431 | endef | |
432 | ||
433 | ||
434 | ## Link system module (windows aka driver, linux aka kernel module) | |
435 | # @param $(target) Normalized main target name. | |
436 | # @param $(out) System module name. | |
437 | # @param $(objs) Object files to link together. | |
438 | # @param $(libs) Libraries to search. | |
439 | # @param $(libpath) Library search paths. | |
440 | # @param $(flags) Flags. | |
441 | # @param $(dirdep) Directory creation dependency. | |
442 | # @param $(deps) Other dependencies. | |
443 | # @param $(othersrc) Unhandled sources. | |
444 | # @param $(custom_pre) Custom step invoked before linking. | |
445 | # @param $(custom_post) Custom step invoked after linking. | |
446 | # @param $(outbase) Output basename (full). Use this for list files and such. | |
447 | TOOL_LLVMGXX42MACHO_LINK_SYSMOD_OUTPUT = $(outbase).rsp | |
448 | TOOL_LLVMGXX42MACHO_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_LLVMGXX42MACHO_DEBUG_BUNDLE_FN,$(out)) | |
449 | TOOL_LLVMGXX42MACHO_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_LLVMGXX42MACHO_DEBUG_INSTALL_FN) | |
450 | TOOL_LLVMGXX42MACHO_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) | |
451 | TOOL_LLVMGXX42MACHO_LINK_SYSMOD_DEPORD = | |
452 | define TOOL_LLVMGXX42MACHO_LINK_SYSMOD_CMDS | |
453 | $(QUIET)$(APPEND) -n $(outbase).rsp $(objs) | |
454 | $(QUIET)$(TOOL_LLVMGXX42MACHO_LD_SYSMOD) $(TOOL_LLVMGXX42MACHO_LDFLAGS.sysmod) $(flags) -o $(out)\ | |
455 | -filelist $(outbase).rsp\ | |
456 | $(foreach p,$(libpath), -L$(p))\ | |
457 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib))) | |
458 | ifeq ($(ld_debug),split) | |
459 | $(QUIET)$(TOOL_LLVMGXX42MACHO_DSYMUTIL) -o $(out).dSYM/ $(out) | |
460 | $(QUIET)$(TOOL_LLVMGXX42MACHO_STRIP_SYSMOD) $(out) | |
461 | endif | |
462 | endef | |
463 |
0 | # $Id: OPENWATCOM-16.kmk 2413 2010-09-11 17:43:04Z bird $ | |
0 | # $Id: OPENWATCOM-16.kmk 2572 2012-04-27 13:19:55Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Open Watcom v1.4 and later, 16-bit targets. |
3 | 3 | # |
44 | 44 | TOOL_OPENWATCOM-16_COMPILE_AS_DEPORD = |
45 | 45 | TOOL_OPENWATCOM-16_COMPILE_AS_OUTPUT = $(obj).err |
46 | 46 | define TOOL_OPENWATCOM-16_COMPILE_AS_CMDS |
47 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_CC16) \ | |
47 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_AS) \ | |
48 | 48 | $(flags) \ |
49 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \ | |
49 | $(addsuffix , $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs)))) \ | |
50 | 50 | $(addprefix -d, $(defs)) \ |
51 | -fo=$(subst /,\\,$(obj)) \ | |
52 | -fr=$(subst /,\\,$(obj)).err \ | |
53 | $(subst /,\\,$(abspath $(source))) | |
51 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
52 | -fr=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)).err \ | |
53 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
54 | 54 | $(QUIET)$(APPEND) -n $(obj).err |
55 | 55 | ## @todo dependencies |
56 | 56 | endef |
61 | 61 | define TOOL_OPENWATCOM-16_COMPILE_C_CMDS |
62 | 62 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_CC16) \ |
63 | 63 | $(flags) \ |
64 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \ | |
64 | $(addsuffix , $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs)))) \ | |
65 | 65 | $(addprefix -d, $(defs)) \ |
66 | -fo=$(subst /,\\,$(obj)) \ | |
67 | -fr=$(subst /,\\,$(obj)).err \ | |
68 | $(subst /,\\,$(abspath $(source))) | |
66 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
67 | -fr=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)).err \ | |
68 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
69 | 69 | $(QUIET)$(APPEND) -n $(obj).err |
70 | 70 | ## @todo dependencies |
71 | 71 | endef |
76 | 76 | define TOOL_OPENWATCOM-16_COMPILE_CXX_CMDS |
77 | 77 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_CXX16) \ |
78 | 78 | $(flags) \ |
79 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \ | |
79 | $(addsuffix , $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs)))) \ | |
80 | 80 | $(addprefix -d, $(defs)) \ |
81 | -fo=$(subst /,\\,$(obj)) \ | |
82 | -fr=$(subst /,\\,$(obj)).err \ | |
83 | $(subst /,\\,$(abspath $(source))) | |
81 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
82 | -fr=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)).err \ | |
83 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
84 | 84 | $(QUIET)$(APPEND) -n $(obj).err |
85 | 85 | ## @todo dependencies |
86 | 86 | endef |
92 | 92 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) \ |
93 | 93 | $(TOOL_OPENWATCOM_RC) -r\ |
94 | 94 | $(flags) \ |
95 | $(addprefix -i=, $(subst /,\\,$(incs))) \ | |
95 | $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs))) \ | |
96 | 96 | $(addprefix -d, $(defs))\ |
97 | -fo=$(subst /,\\,$(obj)) \ | |
98 | $(subst /,\\,$(abspath $(source))) | |
97 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
98 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
99 | 99 | endef |
100 | 100 | |
101 | 101 | TOOL_OPENWATCOM-16_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
102 | 102 | TOOL_OPENWATCOM-16_LINK_LIBRARY_DEPEND = $(othersrc) |
103 | 103 | TOOL_OPENWATCOM-16_LINK_LIBRARY_DEPORD = |
104 | 104 | define TOOL_OPENWATCOM-16_LINK_LIBRARY_CMDS |
105 | $(QUIET)$(APPEND) -tn $(outbase).rsp $(foreach obj,$(subst /,\,$(objs) $(othersrc)),'+"$(obj)"') | |
106 | $(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_AR) $(flags) $(subst /,\\,$(out)) @$(outbase).rsp | |
105 | $(QUIET)$(APPEND) -tn $(outbase).rsp $(foreach obj,$(call TOOL_OPENWATCOM_FIX_SLASHES,$(objs) $(othersrc)),'+"$(obj)"') | |
106 | $(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_AR) $(flags) $(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) @$(outbase).rsp | |
107 | 107 | endef |
108 | 108 | |
109 | 109 | TOOL_OPENWATCOM-16_LINK_PROGRAM_OUTPUT = $(outbase).map |
110 | TOOL_OPENWATCOM-16_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).sym | |
110 | 111 | TOOL_OPENWATCOM-16_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
111 | 112 | TOOL_OPENWATCOM-16_LINK_PROGRAM_DEPORD = |
112 | 113 | define TOOL_OPENWATCOM-16_LINK_PROGRAM_CMDS |
113 | 114 | $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \ |
114 | 115 | $(TOOL_OPENWATCOM_LD16) \ |
115 | 116 | $(flags) \ |
116 | -fe=$(subst /,\\,$(out)) \ | |
117 | -fm=$(subst /,\\,$(outbase).map) \ | |
118 | $(subst /,\\,$(filter-out %.res,$(objs))) \ | |
119 | $(subst /,\\,$(libs)) \ | |
120 | $(subst /,\\,$(othersrc)) | |
117 | -fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
118 | -fm=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).map) \ | |
119 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter-out %.res,$(objs))) \ | |
120 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(libs)) \ | |
121 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(othersrc)) | |
121 | 122 | $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
122 | 123 | $(TOOL_OPENWATCOM_RC) \ |
123 | 124 | $(filter -bt=%,$(flags)) \ |
124 | /fe=$(subst /,\\,$(out)) \ | |
125 | $(subst /,\\,$(filter %.res,$(objs)))) | |
125 | /fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
126 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter %.res,$(objs)))) | |
126 | 127 | endef |
127 | 128 | |
128 | 129 | TOOL_OPENWATCOM-16_LINK_DLL_OUTPUT = $(outbase).map |
130 | TOOL_OPENWATCOM-16_LINK_DLL_OUTPUT_MAYBE = $(outbase).sym | |
129 | 131 | TOOL_OPENWATCOM-16_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
130 | 132 | TOOL_OPENWATCOM-16_LINK_DLL_DEPORD = |
131 | 133 | define TOOL_OPENWATCOM-16_LINK_DLL_CMDS |
132 | 134 | $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \ |
133 | 135 | $(TOOL_OPENWATCOM_LD16) \ |
134 | 136 | $(flags) \ |
135 | -fe=$(subst /,\\,$(out)) \ | |
136 | -fm=$(subst /,\\,$(outbase).map) \ | |
137 | $(subst /,\\,$(filter-out %.res,$(objs))) \ | |
138 | $(subst /,\\,$(libs)) \ | |
139 | $(subst /,\\,$(othersrc)) | |
137 | -fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
138 | -fm=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).map) \ | |
139 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter-out %.res,$(objs))) \ | |
140 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(libs)) \ | |
141 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(othersrc)) | |
140 | 142 | $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
141 | 143 | $(TOOL_OPENWATCOM_RC) \ |
142 | 144 | $(filter -bt=%,$(flags)) \ |
143 | /fe=$(subst /,\\,$(out)) \ | |
144 | $(subst /,\\,$(filter %.res,$(objs)))) | |
145 | /fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
146 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter %.res,$(objs)))) | |
145 | 147 | endef |
146 | 148 | |
147 | 149 | TOOL_OPENWATCOM-16_LINK_SYSMOD_OUTPUT = $(outbase).map |
150 | TOOL_OPENWATCOM-16_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).sym | |
148 | 151 | TOOL_OPENWATCOM-16_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
149 | 152 | TOOL_OPENWATCOM-16_LINK_SYSMOD_DEPORD = |
150 | 153 | define TOOL_OPENWATCOM-16_LINK_SYSMOD_CMDS |
151 | 154 | $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \ |
152 | 155 | $(TOOL_OPENWATCOM_LD16) \ |
153 | 156 | $(flags) \ |
154 | -fe=$(subst /,\\,$(out)) \ | |
155 | -fm=$(subst /,\\,$(outbase).map) \ | |
156 | $(subst /,\\,$(filter-out %.res,$(objs))) \ | |
157 | $(subst /,\\,$(libs)) \ | |
158 | $(subst /,\\,$(othersrc)) | |
157 | -fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
158 | -fm=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).map) \ | |
159 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter-out %.res,$(objs))) \ | |
160 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(libs)) \ | |
161 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(othersrc)) | |
159 | 162 | $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
160 | 163 | $(TOOL_OPENWATCOM_RC) \ |
161 | 164 | $(filter -bt=%,$(flags)) \ |
162 | /fe=$(subst /,\\,$(out)) \ | |
163 | $(subst /,\\,$(filter %.res,$(objs)))) | |
165 | /fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
166 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter %.res,$(objs)))) | |
164 | 167 | endef |
165 | 168 |
0 | # $Id: OPENWATCOM-WL.kmk 2413 2010-09-11 17:43:04Z bird $ | |
0 | # $Id: OPENWATCOM-WL.kmk 2572 2012-04-27 13:19:55Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Open Watcom v1.4 and later, using wlink. |
3 | 3 | # |
42 | 42 | |
43 | 43 | |
44 | 44 | TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp |
45 | TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).sym | |
45 | 46 | TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
46 | 47 | TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPORD = |
47 | 48 | define TOOL_OPENWATCOM-WL_LINK_PROGRAM_CMDS |
48 | 49 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ |
49 | 50 | $(if $(flags),'$(flags)',) \ |
50 | 'Name $(subst /,\,$(out)$(if $(suffix $(out)),,.))' \ | |
51 | 'Option Map=$(subst /,\,$(outbase)).map' \ | |
52 | $(foreach p,$(subst /,\,$(libpath)),'LIBPath $p') \ | |
53 | $(foreach o,$(subst /,\,$(filter-out %.res,$(objs)) $(othersrc)),'$(if $(filter %.lib %.a,$l),LIB,)File $o') \ | |
54 | $(foreach l,$(subst /,\,$(libs)),'Library $l') | |
51 | 'Name $(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)$(if $(suffix $(out)),,.))' \ | |
52 | 'Option Map=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase)).map' \ | |
53 | $(foreach p,$(call TOOL_OPENWATCOM_FIX_SLASHES,$(libpath)),'LIBPath $p') \ | |
54 | $(foreach o,$(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter-out %.res,$(objs)) $(othersrc)),'$(if $(filter %.lib %.a,$l),LIB,)File $o') \ | |
55 | $(foreach l,$(call TOOL_OPENWATCOM_FIX_SLASHES,$(libs)),'Library $l') | |
55 | 56 | $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
56 | 57 | $(TOOL_OPENWATCOM_WLINK) @$(outbase).rsp |
57 | 58 | $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
58 | 59 | $(TOOL_OPENWATCOM_RC) \ |
59 | 60 | $(filter -bt=%,$(flags)) \ |
60 | /fe=$(subst /,\\,$(out)) \ | |
61 | $(subst /,\\,$(filter %.res,$(objs)))) | |
61 | /fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
62 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter %.res,$(objs)))) | |
62 | 63 | endef |
63 | 64 | |
64 | 65 | TOOL_OPENWATCOM-WL_LINK_DLL_OUTPUT = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT) |
66 | TOOL_OPENWATCOM-WL_LINK_DLL_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT_MAYBE) | |
65 | 67 | TOOL_OPENWATCOM-WL_LINK_DLL_DEPEND = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPEND) |
66 | 68 | TOOL_OPENWATCOM-WL_LINK_DLL_DEPORD = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPORD) |
67 | 69 | TOOL_OPENWATCOM-WL_LINK_DLL_CMDS = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_CMDS) |
68 | 70 | |
69 | 71 | TOOL_OPENWATCOM-WL_LINK_SYSMOD_OUTPUT = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT) |
72 | TOOL_OPENWATCOM-WL_LINK_SYSMOD_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT_MAYBE) | |
70 | 73 | TOOL_OPENWATCOM-WL_LINK_SYSMOD_DEPEND = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPEND) |
71 | 74 | TOOL_OPENWATCOM-WL_LINK_SYSMOD_DEPORD = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPORD) |
72 | 75 | TOOL_OPENWATCOM-WL_LINK_SYSMOD_CMDS = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_CMDS) |
73 | 76 | |
74 | 77 | TOOL_OPENWATCOM-WL_LINK_MISCBIN_OUTPUT = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT) |
78 | TOOL_OPENWATCOM-WL_LINK_MISCBIN_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_OUTPUT_MAYBE) | |
75 | 79 | TOOL_OPENWATCOM-WL_LINK_MISCBIN_DEPEND = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPEND) |
76 | 80 | TOOL_OPENWATCOM-WL_LINK_MISCBIN_DEPORD = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_DEPORD) |
77 | 81 | TOOL_OPENWATCOM-WL_LINK_MISCBIN_CMDS = $(TOOL_OPENWATCOM-WL_LINK_PROGRAM_CMDS) |
0 | # $Id: OPENWATCOM.kmk 2413 2010-09-11 17:43:04Z bird $ | |
0 | # $Id: OPENWATCOM.kmk 2576 2012-05-31 15:07:00Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Open Watcom v1.4 and later. |
3 | 3 | # |
57 | 57 | ifneq ($(PATH_TOOL_OPENWATCOM),) |
58 | 58 | TOOL_OPENWATCOM_PATHLESS := no |
59 | 59 | |
60 | ifeq ($(KBUILD_HOST),os2) | |
60 | ifeq ($(KBUILD_HOST),darwin) | |
61 | PATH_TOOL_OPENWATCOM_BIN = $(PATH_TOOL_OPENWATCOM)/binosx | |
62 | TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \ | |
63 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN):$(PATH_TOOL_OPENWATCOM)/binl:$(PATH_TOOL_OPENWATCOM)/binw:$(PATH)' \ | |
64 | -E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \ | |
65 | -E 'EDPATH=$(PATH_TOOL_OPENWATCOM)/EDDAT' \ | |
66 | -E 'LIB=$1' \ | |
67 | -E 'INCLUDE=' \ | |
68 | -- | |
69 | else ifeq ($(KBUILD_HOST),freebsd) | |
70 | PATH_TOOL_OPENWATCOM_BIN = $(PATH_TOOL_OPENWATCOM)/binfbsd | |
71 | TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \ | |
72 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN):$(PATH_TOOL_OPENWATCOM)/binl:$(PATH_TOOL_OPENWATCOM)/binw:$(PATH)' \ | |
73 | -E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \ | |
74 | -E 'EDPATH=$(PATH_TOOL_OPENWATCOM)/EDDAT' \ | |
75 | -E 'LIB=$1' \ | |
76 | -E 'INCLUDE=' \ | |
77 | -- | |
78 | else ifeq ($(KBUILD_HOST),linux) | |
79 | PATH_TOOL_OPENWATCOM_BIN = $(PATH_TOOL_OPENWATCOM)/binl | |
80 | TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \ | |
81 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN):$(PATH_TOOL_OPENWATCOM)/binw:$(PATH)' \ | |
82 | -E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \ | |
83 | -E 'EDPATH=$(PATH_TOOL_OPENWATCOM)/EDDAT' \ | |
84 | -E 'LIB=$1' \ | |
85 | -E 'INCLUDE=' \ | |
86 | -- | |
87 | else ifeq ($(KBUILD_HOST),os2) | |
61 | 88 | PATH_TOOL_OPENWATCOM_BIN = $(PATH_TOOL_OPENWATCOM)/binp |
62 | 89 | TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \ |
63 | 90 | -E 'BEGINLIBPATH=$(PATH_TOOL_OPENWATCOM)/binp/dll;$(BEGINLIBPATH)' \ |
64 | 91 | -E 'LIBPATHSTRICT=T' \ |
65 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN);$(PATH_TOOL_OPENWATCOM)/binw' \ | |
66 | -E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \ | |
67 | -E 'EDPATH=$(PATH_TOOL_OPENWATCOM)/EDDAT' \ | |
68 | -E 'LIB=$1' \ | |
69 | -E 'INCLUDE=' \ | |
70 | -- | |
71 | else ifeq ($(KBUILD_HOST),linux) | |
72 | PATH_TOOL_OPENWATCOM_BIN = $(PATH_TOOL_OPENWATCOM)/binl | |
73 | TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \ | |
74 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN):$(PATH_TOOL_OPENWATCOM)/binw' \ | |
92 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN);$(PATH_TOOL_OPENWATCOM)/binw;$(PATH)' \ | |
93 | -E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \ | |
94 | -E 'EDPATH=$(PATH_TOOL_OPENWATCOM)/EDDAT' \ | |
95 | -E 'LIB=$1' \ | |
96 | -E 'INCLUDE=' \ | |
97 | -- | |
98 | else ifeq ($(KBUILD_HOST),solaris) | |
99 | PATH_TOOL_OPENWATCOM_BIN = $(PATH_TOOL_OPENWATCOM)/binsol | |
100 | TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \ | |
101 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN):$(PATH_TOOL_OPENWATCOM)/binl:$(PATH_TOOL_OPENWATCOM)/binw:$(PATH)' \ | |
75 | 102 | -E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \ |
76 | 103 | -E 'EDPATH=$(PATH_TOOL_OPENWATCOM)/EDDAT' \ |
77 | 104 | -E 'LIB=$1' \ |
80 | 107 | else |
81 | 108 | PATH_TOOL_OPENWATCOM_BIN = $(PATH_TOOL_OPENWATCOM)/binnt |
82 | 109 | TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \ |
83 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN);$(PATH_TOOL_OPENWATCOM)/binw' \ | |
110 | -E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN);$(PATH_TOOL_OPENWATCOM)/binw;$(PATH)' \ | |
84 | 111 | -E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \ |
85 | 112 | -E 'EDPATH=$(PATH_TOOL_OPENWATCOM)/EDDAT' \ |
86 | 113 | -E 'LIB=$1' \ |
119 | 146 | |
120 | 147 | endif |
121 | 148 | |
149 | if1of ($(KBUILD_HOST), os2 win) | |
150 | TOOL_OPENWATCOM_FIX_SLASHES = $(subst /,\\,$1) | |
151 | else | |
152 | TOOL_OPENWATCOM_FIX_SLASHES = $1 | |
153 | endif | |
154 | ||
122 | 155 | # General Properties used by kBuild |
123 | 156 | TOOL_OPENWATCOM_ASOBJSUFF ?= .obj |
124 | 157 | TOOL_OPENWATCOM_ASFLAGS ?= -zq |
167 | 200 | define TOOL_OPENWATCOM_COMPILE_AS_CMDS |
168 | 201 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_AS) \ |
169 | 202 | $(flags) \ |
170 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \ | |
203 | $(addsuffix , $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs)))) \ | |
171 | 204 | $(addprefix -d, $(defs)) \ |
172 | -fo=$(subst /,\\,$(obj)) \ | |
173 | -fr=$(subst /,\\,$(obj)).err \ | |
174 | $(subst /,\\,$(abspath $(source))) | |
205 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
206 | -fr=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)).err \ | |
207 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
175 | 208 | $(QUIET)$(APPEND) -n $(obj).err |
176 | 209 | ## @todo dependencies |
177 | 210 | endef |
183 | 216 | define TOOL_OPENWATCOM_COMPILE_C_CMDS |
184 | 217 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_CC) \ |
185 | 218 | $(flags) \ |
186 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \ | |
219 | $(addsuffix , $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs)))) \ | |
187 | 220 | $(addprefix -d, $(defs)) \ |
188 | -fo=$(subst /,\\,$(obj)) \ | |
189 | -fr=$(subst /,\\,$(obj)).err \ | |
190 | $(subst /,\\,$(abspath $(source))) | |
221 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
222 | -fr=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)).err \ | |
223 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
191 | 224 | $(QUIET)$(APPEND) -n $(obj).err |
192 | 225 | ## @todo dependencies |
193 | 226 | endef |
198 | 231 | define TOOL_OPENWATCOM_COMPILE_CXX_CMDS |
199 | 232 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_CXX) \ |
200 | 233 | $(flags) \ |
201 | $(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \ | |
234 | $(addsuffix , $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs)))) \ | |
202 | 235 | $(addprefix -d, $(defs)) \ |
203 | -fo=$(subst /,\\,$(obj)) \ | |
204 | -fr=$(subst /,\\,$(obj)).err \ | |
205 | $(subst /,\\,$(abspath $(source))) | |
236 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
237 | -fr=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)).err \ | |
238 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
206 | 239 | $(QUIET)$(APPEND) -n $(obj).err |
207 | 240 | ## @todo dependencies |
208 | 241 | endef |
214 | 247 | $(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) \ |
215 | 248 | $(TOOL_OPENWATCOM_RC) -r\ |
216 | 249 | $(flags) \ |
217 | $(addprefix -i=, $(subst /,\\,$(incs))) \ | |
250 | $(addprefix -i=, $(call TOOL_OPENWATCOM_FIX_SLASHES,$(incs))) \ | |
218 | 251 | $(addprefix -d, $(defs))\ |
219 | -fo=$(subst /,\\,$(obj)) \ | |
220 | $(subst /,\\,$(abspath $(source))) | |
252 | -fo=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \ | |
253 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) | |
221 | 254 | endef |
222 | 255 | |
223 | 256 | TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp |
224 | 257 | TOOL_OPENWATCOM_LINK_LIBRARY_DEPEND = $(othersrc) |
225 | 258 | TOOL_OPENWATCOM_LINK_LIBRARY_DEPORD = |
226 | 259 | define TOOL_OPENWATCOM_LINK_LIBRARY_CMDS |
227 | $(QUIET)$(APPEND) -tn $(outbase).rsp $(foreach obj,$(subst /,\,$(objs) $(othersrc)),'+"$(obj)"') | |
228 | $(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_AR) $(flags) $(subst /,\\,$(out)) @$(outbase).rsp | |
260 | $(QUIET)$(APPEND) -tn $(outbase).rsp $(foreach obj,$(call TOOL_OPENWATCOM_FIX_SLASHES,$(objs) $(othersrc)),'+"$(obj)"') | |
261 | $(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_AR) $(flags) $(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) @$(outbase).rsp | |
229 | 262 | endef |
230 | 263 | |
231 | 264 | TOOL_OPENWATCOM_LINK_PROGRAM_OUTPUT = $(outbase).map |
235 | 268 | $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \ |
236 | 269 | $(TOOL_OPENWATCOM_LD) \ |
237 | 270 | $(flags) \ |
238 | -fe=$(subst /,\\,$(out)) \ | |
239 | -fm=$(subst /,\\,$(outbase).map) \ | |
240 | $(subst /,\\,$(filter-out %.res,$(objs))) \ | |
241 | $(subst /,\\,$(libs)) \ | |
242 | $(subst /,\\,$(othersrc)) | |
271 | -fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
272 | -fm=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).map) \ | |
273 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter-out %.res,$(objs))) \ | |
274 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(libs)) \ | |
275 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(othersrc)) | |
243 | 276 | $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
244 | 277 | $(TOOL_OPENWATCOM_RC) \ |
245 | 278 | $(filter -bt=%,$(flags)) \ |
246 | /fe=$(subst /,\\,$(out)) \ | |
247 | $(subst /,\\,$(filter %.res,$(objs)))) | |
279 | /fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
280 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter %.res,$(objs)))) | |
248 | 281 | endef |
249 | 282 | |
250 | 283 | TOOL_OPENWATCOM_LINK_DLL_OUTPUT = $(outbase).map |
254 | 287 | $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \ |
255 | 288 | $(TOOL_OPENWATCOM_LD) \ |
256 | 289 | $(flags) \ |
257 | -fe=$(subst /,\\,$(out)) \ | |
258 | -fm=$(subst /,\\,$(outbase).map) \ | |
259 | $(subst /,\\,$(filter-out %.res,$(objs))) \ | |
260 | $(subst /,\\,$(libs)) \ | |
261 | $(subst /,\\,$(othersrc)) | |
290 | -fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
291 | -fm=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).map) \ | |
292 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter-out %.res,$(objs))) \ | |
293 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(libs)) \ | |
294 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(othersrc)) | |
262 | 295 | $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
263 | 296 | $(TOOL_OPENWATCOM_RC) \ |
264 | 297 | $(filter -bt=%,$(flags)) \ |
265 | /fe=$(subst /,\\,$(out)) \ | |
266 | $(subst /,\\,$(filter %.res,$(objs)))) | |
298 | /fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
299 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter %.res,$(objs)))) | |
267 | 300 | endef |
268 | 301 | |
269 | 302 | TOOL_OPENWATCOM_LINK_SYSMOD_OUTPUT = $(outbase).map |
273 | 306 | $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \ |
274 | 307 | $(TOOL_OPENWATCOM_LD) \ |
275 | 308 | $(flags) \ |
276 | -fe=$(subst /,\\,$(out)) \ | |
277 | -fm=$(subst /,\\,$(outbase).map) \ | |
278 | $(subst /,\\,$(filter-out %.res,$(objs))) \ | |
279 | $(subst /,\\,$(libs)) \ | |
280 | $(subst /,\\,$(othersrc)) | |
309 | -fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
310 | -fm=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).map) \ | |
311 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter-out %.res,$(objs))) \ | |
312 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(libs)) \ | |
313 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(othersrc)) | |
281 | 314 | $(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP) \ |
282 | 315 | $(TOOL_OPENWATCOM_RC) \ |
283 | 316 | $(filter -bt=%,$(flags)) \ |
284 | /fe=$(subst /,\\,$(out)) \ | |
285 | $(subst /,\\,$(filter %.res,$(objs)))) | |
286 | endef | |
287 | ||
317 | /fe=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(out)) \ | |
318 | $(call TOOL_OPENWATCOM_FIX_SLASHES,$(filter %.res,$(objs)))) | |
319 | endef | |
320 |
0 | # $Id: StandardDTrace.kmk 2567 2012-03-17 19:27:32Z bird $ | |
1 | ## @file | |
2 | # Standard DTrace tool. | |
3 | # | |
4 | ||
5 | # | |
6 | # Copyright (c) 2012 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | # | |
8 | # This file is part of kBuild. | |
9 | # | |
10 | # kBuild is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 2 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # kBuild is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with kBuild; if not, write to the Free Software | |
22 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
23 | # | |
24 | # | |
25 | # As a special exception you are granted permission to include this file, via | |
26 | # the kmk include directive, as you wish without this in itself causing the | |
27 | # resulting makefile, program or whatever to be covered by the GPL license. | |
28 | # This exception does not however invalidate any other reasons why the makefile, | |
29 | # program, whatever should not be covered the GPL. | |
30 | # | |
31 | # | |
32 | ||
33 | TOOL_StandardDTrace := Standard DTrace or similar. | |
34 | TOOL_StandardDTrace_DTRACE := dtrace | |
35 | ||
36 | TOOL_StandardDTrace_DTRACE_HDR_FLAGS := -h | |
37 | define TOOL_StandardDTrace_DTRACE_HDR_CMDS | |
38 | $(QUIET)$(TOOL_StandardDTrace_DTRACE) $(flags) \ | |
39 | -o "$(out)" -s "$(source)" | |
40 | endef | |
41 | ||
42 | TOOL_StandardDTrace_DTRACE_OBJ_NOT_NEEDED := darwin | |
43 | TOOL_StandardDTrace_DTRACE_OBJ_FLAGS := -G | |
44 | define TOOL_StandardDTrace_DTRACE_OBJ_CMDS | |
45 | $(QUIET)$(TOOL_StandardDTrace_DTRACE) \ | |
46 | $(if-expr $(intersects $(bld_trg_arch),$(KBUILD_ARCHES_64)),-64,-32) \ | |
47 | $(flags) \ | |
48 | -o "$(out)" -s "$(source)" \ | |
49 | $$(filter-out %-dtrace-object-format.o, $$($(target)_2_OBJS)) | |
50 | endef | |
51 |
0 | # $Id: VCC100.kmk 2524 2011-08-01 13:37:47Z bird $ | |
0 | # $Id: VCC100.kmk 2557 2011-12-13 12:48:32Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting $(KBUILD_TARGET). |
3 | 3 | # |
225 | 225 | TOOL_VCC100_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
226 | 226 | TOOL_VCC100_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb |
227 | 227 | define TOOL_VCC100_LINK_LIBRARY_CMDS |
228 | $(QUIET)$(APPEND) -n $(outbase).rsp \ | |
228 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
229 | 229 | $(foreach arg,\ |
230 | 230 | $(subst /,\\,$(objs) \ |
231 | 231 | $(filter-out %.def,$(othersrc))) \ |
253 | 253 | # |
254 | 254 | TOOL_VCC100_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
255 | 255 | TOOL_VCC100_LINK_PROGRAM_DEPORD = |
256 | TOOL_VCC100_LINK_PROGRAM_OUTPUT = $(outbase).map | |
256 | TOOL_VCC100_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp | |
257 | 257 | TOOL_VCC100_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
258 | 258 | TOOL_VCC100_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb |
259 | 259 | TOOL_VCC100_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
260 | 260 | define TOOL_VCC100_LINK_PROGRAM_CMDS |
261 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
262 | $(foreach arg,\ | |
263 | $(subst /,\\,$(objs)) \ | |
264 | $(subst /,\\,$(libs)) \ | |
265 | ,\"$(arg)\") | |
261 | 266 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \ |
262 | 267 | /OUT:$(out) \ |
263 | 268 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
265 | 270 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
266 | 271 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
267 | 272 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
268 | $(subst /,\\,$(objs)) \ | |
269 | $(subst /,\\,$(libs)) | |
273 | @$(outbase).rsp | |
270 | 274 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
271 | 275 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)) |
272 | 276 | endef |
288 | 292 | # @param $(outbase) Output basename (full). Use this for list files and such. |
289 | 293 | TOOL_VCC100_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
290 | 294 | TOOL_VCC100_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) |
291 | TOOL_VCC100_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp | |
295 | TOOL_VCC100_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp | |
292 | 296 | TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp |
293 | 297 | TOOL_VCC100_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb |
294 | 298 | TOOL_VCC100_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
295 | 299 | define TOOL_VCC100_LINK_DLL_CMDS |
300 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
301 | $(foreach arg,\ | |
302 | $(subst /,\\,$(objs)) \ | |
303 | $(subst /,\\,$(libs)) \ | |
304 | ,\"$(arg)\") | |
296 | 305 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \ |
297 | 306 | /OUT:$(out) \ |
298 | 307 | /IMPLIB:$(outbase).lib \ |
302 | 311 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
303 | 312 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
304 | 313 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
305 | $(subst /,\\,$(objs)) \ | |
306 | $(subst /,\\,$(libs)) | |
314 | @$(outbase).rsp | |
307 | 315 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
308 | 316 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
309 | 317 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/ |
327 | 335 | # @param $(outbase) Output basename (full). Use this for list files and such. |
328 | 336 | TOOL_VCC100_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
329 | 337 | TOOL_VCC100_LINK_SYSMOD_DEPORD = |
330 | TOOL_VCC100_LINK_SYSMOD_OUTPUT = $(outbase).map | |
338 | TOOL_VCC100_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp | |
331 | 339 | TOOL_VCC100_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
332 | 340 | TOOL_VCC100_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb |
333 | 341 | TOOL_VCC100_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
334 | 342 | define TOOL_VCC100_LINK_SYSMOD_CMDS |
343 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
344 | $(foreach arg,\ | |
345 | $(subst /,\\,$(objs)) \ | |
346 | $(subst /,\\,$(libs)) \ | |
347 | ,\"$(arg)\") | |
335 | 348 | $(QUIET)$(TOOL_VCC100_LD) $(flags) \ |
336 | 349 | /OUT:$(out) \ |
337 | 350 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
339 | 352 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
340 | 353 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
341 | 354 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
342 | $(subst /,\\,$(objs)) \ | |
343 | $(subst /,\\,$(libs)) | |
355 | @$(outbase).rsp | |
344 | 356 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
345 | 357 | $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
346 | 358 | endef |
0 | # $Id: VCC100AMD64.kmk 2524 2011-08-01 13:37:47Z bird $ | |
0 | # $Id: VCC100AMD64.kmk 2557 2011-12-13 12:48:32Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting AMD64. |
3 | 3 | # |
245 | 245 | TOOL_VCC100AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
246 | 246 | TOOL_VCC100AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb |
247 | 247 | define TOOL_VCC100AMD64_LINK_LIBRARY_CMDS |
248 | $(QUIET)$(APPEND) -n $(outbase).rsp \ | |
248 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
249 | 249 | $(foreach arg,\ |
250 | 250 | $(subst /,\\,$(objs) \ |
251 | 251 | $(filter-out %.def,$(othersrc))) \ |
271 | 271 | # |
272 | 272 | TOOL_VCC100AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
273 | 273 | TOOL_VCC100AMD64_LINK_PROGRAM_DEPORD = |
274 | TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map | |
274 | TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp | |
275 | 275 | TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
276 | 276 | TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb |
277 | 277 | TOOL_VCC100AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
278 | 278 | define TOOL_VCC100AMD64_LINK_PROGRAM_CMDS |
279 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
280 | $(foreach arg,\ | |
281 | $(subst /,\\,$(objs)) \ | |
282 | $(subst /,\\,$(libs)) \ | |
283 | ,\"$(arg)\") | |
279 | 284 | $(QUIET)$(TOOL_VCC100AMD64_LD) $(flags) \ |
280 | 285 | /OUT:$(out) \ |
281 | 286 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
283 | 288 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
284 | 289 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
285 | 290 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
286 | $(subst /,\\,$(objs)) \ | |
287 | $(subst /,\\,$(libs)) | |
291 | @$(outbase).rsp | |
288 | 292 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
289 | 293 | $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)) |
290 | 294 | endef |
306 | 310 | # @param $(outbase) Output basename (full). Use this for list files and such. |
307 | 311 | TOOL_VCC100AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
308 | 312 | TOOL_VCC100AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) |
309 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp | |
313 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp | |
310 | 314 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp |
311 | 315 | TOOL_VCC100AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb |
312 | 316 | TOOL_VCC100AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
313 | 317 | define TOOL_VCC100AMD64_LINK_DLL_CMDS |
318 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
319 | $(foreach arg,\ | |
320 | $(subst /,\\,$(objs)) \ | |
321 | $(subst /,\\,$(libs)) \ | |
322 | ,\"$(arg)\") | |
314 | 323 | $(QUIET)$(TOOL_VCC100AMD64_LD) $(flags) \ |
315 | 324 | /OUT:$(out) \ |
316 | 325 | /IMPLIB:$(outbase).lib \ |
320 | 329 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
321 | 330 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
322 | 331 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
323 | $(subst /,\\,$(objs)) \ | |
324 | $(subst /,\\,$(libs)) | |
332 | @$(outbase).rsp | |
325 | 333 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
326 | 334 | $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
327 | 335 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/ |
345 | 353 | # @param $(outbase) Output basename (full). Use this for list files and such. |
346 | 354 | TOOL_VCC100AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
347 | 355 | TOOL_VCC100AMD64_LINK_SYSMOD_DEPORD = |
348 | TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map | |
356 | TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp | |
349 | 357 | TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
350 | 358 | TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb |
351 | 359 | TOOL_VCC100AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
352 | 360 | define TOOL_VCC100AMD64_LINK_SYSMOD_CMDS |
361 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
362 | $(foreach arg,\ | |
363 | $(subst /,\\,$(objs)) \ | |
364 | $(subst /,\\,$(libs)) \ | |
365 | ,\"$(arg)\") | |
353 | 366 | $(QUIET)$(TOOL_VCC100AMD64_LD) $(flags) \ |
354 | 367 | /OUT:$(out) \ |
355 | 368 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
357 | 370 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
358 | 371 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
359 | 372 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
360 | $(subst /,\\,$(objs)) \ | |
361 | $(subst /,\\,$(libs)) | |
373 | @$(outbase).rsp | |
362 | 374 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
363 | 375 | $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
364 | 376 | endef |
0 | # $Id: VCC100X86.kmk 2524 2011-08-01 13:37:47Z bird $ | |
0 | # $Id: VCC100X86.kmk 2557 2011-12-13 12:48:32Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86. |
3 | 3 | # |
206 | 206 | TOOL_VCC100X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
207 | 207 | TOOL_VCC100X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb |
208 | 208 | define TOOL_VCC100X86_LINK_LIBRARY_CMDS |
209 | $(QUIET)$(APPEND) -n $(outbase).rsp \ | |
209 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
210 | 210 | $(foreach arg,\ |
211 | 211 | $(subst /,\\,$(objs) \ |
212 | 212 | $(filter-out %.def,$(othersrc))) \ |
232 | 232 | # |
233 | 233 | TOOL_VCC100X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
234 | 234 | TOOL_VCC100X86_LINK_PROGRAM_DEPORD = |
235 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT = $(outbase).map | |
235 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp | |
236 | 236 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
237 | 237 | TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb |
238 | 238 | TOOL_VCC100X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
239 | 239 | define TOOL_VCC100X86_LINK_PROGRAM_CMDS |
240 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
241 | $(foreach arg,\ | |
242 | $(subst /,\\,$(objs)) \ | |
243 | $(subst /,\\,$(libs)) \ | |
244 | ,\"$(arg)\") | |
240 | 245 | $(QUIET)$(TOOL_VCC100X86_LD) $(flags) \ |
241 | 246 | /OUT:$(out) \ |
242 | 247 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
244 | 249 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
245 | 250 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
246 | 251 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
247 | $(subst /,\\,$(objs)) \ | |
248 | $(subst /,\\,$(libs)) | |
252 | @$(outbase).rsp | |
249 | 253 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
250 | 254 | $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)) |
251 | 255 | endef |
267 | 271 | # @param $(outbase) Output basename (full). Use this for list files and such. |
268 | 272 | TOOL_VCC100X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
269 | 273 | TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) |
270 | TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp | |
274 | TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp | |
271 | 275 | TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp |
272 | 276 | TOOL_VCC100X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb |
273 | 277 | TOOL_VCC100X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
274 | 278 | define TOOL_VCC100X86_LINK_DLL_CMDS |
279 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
280 | $(foreach arg,\ | |
281 | $(subst /,\\,$(objs)) \ | |
282 | $(subst /,\\,$(libs)) \ | |
283 | ,\"$(arg)\") | |
275 | 284 | $(QUIET)$(TOOL_VCC100X86_LD) $(flags) \ |
276 | 285 | /OUT:$(out) \ |
277 | 286 | /IMPLIB:$(outbase).lib \ |
281 | 290 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
282 | 291 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
283 | 292 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
284 | $(subst /,\\,$(objs)) \ | |
285 | $(subst /,\\,$(libs)) | |
293 | @$(outbase).rsp | |
286 | 294 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
287 | 295 | $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
288 | 296 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/ |
306 | 314 | # @param $(outbase) Output basename (full). Use this for list files and such. |
307 | 315 | TOOL_VCC100X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
308 | 316 | TOOL_VCC100X86_LINK_SYSMOD_DEPORD = |
309 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT = $(outbase).map | |
317 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp | |
310 | 318 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
311 | 319 | TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb |
312 | 320 | TOOL_VCC100X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
313 | 321 | define TOOL_VCC100X86_LINK_SYSMOD_CMDS |
322 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
323 | $(foreach arg,\ | |
324 | $(subst /,\\,$(objs)) \ | |
325 | $(subst /,\\,$(libs)) \ | |
326 | ,\"$(arg)\") | |
314 | 327 | $(QUIET)$(TOOL_VCC100X86_LD) $(flags) \ |
315 | 328 | /OUT:$(out) \ |
316 | 329 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
318 | 331 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
319 | 332 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
320 | 333 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
321 | $(subst /,\\,$(objs)) \ | |
322 | $(subst /,\\,$(libs)) | |
334 | @$(outbase).rsp | |
323 | 335 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
324 | 336 | $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
325 | 337 | endef |
0 | # $Id: VCC70.kmk 2524 2011-08-01 13:37:47Z bird $ | |
0 | # $Id: VCC70.kmk 2557 2011-12-13 12:48:32Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Visual C++ 7.0 (aka Visual Studio .NET), targeting x86. |
3 | 3 | # |
238 | 238 | TOOL_VCC70_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
239 | 239 | TOOL_VCC70_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb |
240 | 240 | define TOOL_VCC70_LINK_LIBRARY_CMDS |
241 | $(QUIET)$(APPEND) -n $(outbase).rsp \ | |
241 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
242 | 242 | $(foreach arg,\ |
243 | 243 | $(subst /,\\,$(objs) \ |
244 | 244 | $(filter-out %.def,$(othersrc))) \ |
262 | 262 | # @param $(custom_post) Custom step invoked after linking. |
263 | 263 | # @param $(outbase) Output basename (full). Use this for list files and such. |
264 | 264 | # |
265 | TOOL_VCC70_LINK_PROGRAM_OUTPUT = $(outbase).rsp | |
265 | 266 | TOOL_VCC70_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).ilk |
266 | 267 | TOOL_VCC70_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb |
267 | 268 | TOOL_VCC70_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
268 | 269 | TOOL_VCC70_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
269 | 270 | TOOL_VCC70_LINK_PROGRAM_DEPORD = |
270 | 271 | define TOOL_VCC70_LINK_PROGRAM_CMDS |
272 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
273 | $(foreach arg,\ | |
274 | $(subst /,\\,$(objs)) \ | |
275 | $(subst /,\\,$(libs)) \ | |
276 | ,\"$(arg)\") | |
271 | 277 | $(QUIET)$(TOOL_VCC70_LD) $(flags) \ |
272 | 278 | /OUT:$(out) \ |
273 | 279 | /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \ |
275 | 281 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
276 | 282 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
277 | 283 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
278 | $(subst /,\\,$(objs)) \ | |
279 | $(subst /,\\,$(libs)) | |
284 | @$(outbase).rsp | |
280 | 285 | endef |
281 | 286 | |
282 | 287 | |
294 | 299 | # @param $(custom_post) Custom step invoked after linking. |
295 | 300 | # |
296 | 301 | # @param $(outbase) Output basename (full). Use this for list files and such. |
297 | TOOL_VCC70_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp | |
302 | TOOL_VCC70_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp | |
298 | 303 | TOOL_VCC70_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp |
299 | 304 | TOOL_VCC70_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb |
300 | 305 | TOOL_VCC70_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
301 | 306 | TOOL_VCC70_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
302 | 307 | TOOL_VCC70_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) |
303 | 308 | define TOOL_VCC70_LINK_DLL_CMDS |
309 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
310 | $(foreach arg,\ | |
311 | $(subst /,\\,$(objs)) \ | |
312 | $(subst /,\\,$(libs)) \ | |
313 | ,\"$(arg)\") | |
304 | 314 | $(QUIET)$(TOOL_VCC70_LD) $(flags) \ |
305 | 315 | /OUT:$(out) \ |
306 | 316 | /IMPLIB:$(outbase).lib \ |
310 | 320 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
311 | 321 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
312 | 322 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
313 | $(subst /,\\,$(objs)) \ | |
314 | $(subst /,\\,$(libs)) | |
323 | @$(outbase).rsp | |
315 | 324 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/ |
316 | 325 | $(eval _DIRS += $(PATH_STAGE_LIB)) |
317 | 326 | endef |
331 | 340 | # @param $(custom_post) Custom step invoked after linking. |
332 | 341 | # |
333 | 342 | # @param $(outbase) Output basename (full). Use this for list files and such. |
334 | TOOL_VCC70_LINK_SYSMOD_OUTPUT = $(outbase).map | |
343 | TOOL_VCC70_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp | |
335 | 344 | TOOL_VCC70_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk |
336 | 345 | TOOL_VCC70_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb |
337 | 346 | TOOL_VCC70_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
338 | 347 | TOOL_VCC70_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
339 | 348 | TOOL_VCC70_LINK_SYSMOD_DEPORD = |
340 | 349 | define TOOL_VCC70_LINK_SYSMOD_CMDS |
350 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
351 | $(foreach arg,\ | |
352 | $(subst /,\\,$(objs)) \ | |
353 | $(subst /,\\,$(libs)) \ | |
354 | ,\"$(arg)\") | |
341 | 355 | $(QUIET)$(TOOL_VCC70_LD) $(flags) \ |
342 | 356 | /OUT:$(out) \ |
343 | 357 | /MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \ |
345 | 359 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
346 | 360 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
347 | 361 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
348 | $(subst /,\\,$(objs)) \ | |
349 | $(subst /,\\,$(libs)) | |
350 | endef | |
351 | ||
362 | @$(outbase).rsp | |
363 | endef | |
364 |
0 | # $Id: VCC80.kmk 2524 2011-08-01 13:37:47Z bird $ | |
0 | # $Id: VCC80.kmk 2557 2011-12-13 12:48:32Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Visual C++ 8.0 (aka Visual .NET 2005, or MSC v14), targeting $(KBUILD_TARGET). |
3 | 3 | # |
225 | 225 | TOOL_VCC80_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
226 | 226 | TOOL_VCC80_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb |
227 | 227 | define TOOL_VCC80_LINK_LIBRARY_CMDS |
228 | $(QUIET)$(APPEND) -n $(outbase).rsp \ | |
228 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
229 | 229 | $(foreach arg,\ |
230 | 230 | $(subst /,\\,$(objs) \ |
231 | 231 | $(filter-out %.def,$(othersrc))) \ |
253 | 253 | # |
254 | 254 | TOOL_VCC80_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
255 | 255 | TOOL_VCC80_LINK_PROGRAM_DEPORD = |
256 | TOOL_VCC80_LINK_PROGRAM_OUTPUT = $(outbase).map | |
256 | TOOL_VCC80_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp | |
257 | 257 | TOOL_VCC80_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
258 | 258 | TOOL_VCC80_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb |
259 | 259 | TOOL_VCC80_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
260 | 260 | define TOOL_VCC80_LINK_PROGRAM_CMDS |
261 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
262 | $(foreach arg,\ | |
263 | $(subst /,\\,$(objs)) \ | |
264 | $(subst /,\\,$(libs)) \ | |
265 | ,\"$(arg)\") | |
261 | 266 | $(QUIET)$(TOOL_VCC80_LD) $(flags) \ |
262 | 267 | /OUT:$(out) \ |
263 | 268 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
265 | 270 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
266 | 271 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
267 | 272 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
268 | $(subst /,\\,$(objs)) \ | |
269 | $(subst /,\\,$(libs)) | |
273 | @$(outbase).rsp | |
270 | 274 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
271 | 275 | $(TOOL_VCC80_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)) |
272 | 276 | endef |
288 | 292 | # @param $(outbase) Output basename (full). Use this for list files and such. |
289 | 293 | TOOL_VCC80_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
290 | 294 | TOOL_VCC80_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) |
291 | TOOL_VCC80_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp | |
295 | TOOL_VCC80_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp | |
292 | 296 | TOOL_VCC80_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp |
293 | 297 | TOOL_VCC80_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb |
294 | 298 | TOOL_VCC80_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
295 | 299 | define TOOL_VCC80_LINK_DLL_CMDS |
300 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
301 | $(foreach arg,\ | |
302 | $(subst /,\\,$(objs)) \ | |
303 | $(subst /,\\,$(libs)) \ | |
304 | ,\"$(arg)\") | |
296 | 305 | $(QUIET)$(TOOL_VCC80_LD) $(flags) \ |
297 | 306 | /OUT:$(out) \ |
298 | 307 | /IMPLIB:$(outbase).lib \ |
302 | 311 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
303 | 312 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
304 | 313 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
305 | $(subst /,\\,$(objs)) \ | |
306 | $(subst /,\\,$(libs)) | |
314 | @$(outbase).rsp | |
307 | 315 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
308 | 316 | $(TOOL_VCC80_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
309 | 317 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/ |
327 | 335 | # @param $(outbase) Output basename (full). Use this for list files and such. |
328 | 336 | TOOL_VCC80_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
329 | 337 | TOOL_VCC80_LINK_SYSMOD_DEPORD = |
330 | TOOL_VCC80_LINK_SYSMOD_OUTPUT = $(outbase).map | |
338 | TOOL_VCC80_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp | |
331 | 339 | TOOL_VCC80_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
332 | 340 | TOOL_VCC80_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb |
333 | 341 | TOOL_VCC80_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
334 | 342 | define TOOL_VCC80_LINK_SYSMOD_CMDS |
343 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
344 | $(foreach arg,\ | |
345 | $(subst /,\\,$(objs)) \ | |
346 | $(subst /,\\,$(libs)) \ | |
347 | ,\"$(arg)\") | |
335 | 348 | $(QUIET)$(TOOL_VCC80_LD) $(flags) \ |
336 | 349 | /OUT:$(out) \ |
337 | 350 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
339 | 352 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
340 | 353 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
341 | 354 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
342 | $(subst /,\\,$(objs)) \ | |
343 | $(subst /,\\,$(libs)) | |
355 | @$(outbase).rsp | |
344 | 356 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
345 | 357 | $(TOOL_VCC80_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
346 | 358 | endef |
0 | # $Id: VCC80AMD64.kmk 2524 2011-08-01 13:37:47Z bird $ | |
0 | # $Id: VCC80AMD64.kmk 2557 2011-12-13 12:48:32Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Visual C++ 8.0 (aka Visual .NET 2005, or MSC v14), targeting AMD64. |
3 | 3 | # |
204 | 204 | TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
205 | 205 | TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb |
206 | 206 | define TOOL_VCC80AMD64_LINK_LIBRARY_CMDS |
207 | $(QUIET)$(APPEND) -n $(outbase).rsp \ | |
207 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
208 | 208 | $(foreach arg,\ |
209 | 209 | $(subst /,\\,$(objs) \ |
210 | 210 | $(filter-out %.def,$(othersrc))) \ |
230 | 230 | # |
231 | 231 | TOOL_VCC80AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
232 | 232 | TOOL_VCC80AMD64_LINK_PROGRAM_DEPORD = |
233 | TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map | |
233 | TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp | |
234 | 234 | TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
235 | 235 | TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb |
236 | 236 | TOOL_VCC80AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
237 | 237 | define TOOL_VCC80AMD64_LINK_PROGRAM_CMDS |
238 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
239 | $(foreach arg,\ | |
240 | $(subst /,\\,$(objs)) \ | |
241 | $(subst /,\\,$(libs)) \ | |
242 | ,\"$(arg)\") | |
238 | 243 | $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \ |
239 | 244 | /OUT:$(out) \ |
240 | 245 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
242 | 247 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
243 | 248 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
244 | 249 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
245 | $(subst /,\\,$(objs)) \ | |
246 | $(subst /,\\,$(libs)) | |
250 | @$(outbase).rsp | |
247 | 251 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
248 | 252 | $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)) |
249 | 253 | endef |
265 | 269 | # @param $(outbase) Output basename (full). Use this for list files and such. |
266 | 270 | TOOL_VCC80AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
267 | 271 | TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) |
268 | TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp | |
272 | TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp | |
269 | 273 | TOOL_VCC80AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp |
270 | 274 | TOOL_VCC80AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb |
271 | 275 | TOOL_VCC80AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
272 | 276 | define TOOL_VCC80AMD64_LINK_DLL_CMDS |
277 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
278 | $(foreach arg,\ | |
279 | $(subst /,\\,$(objs)) \ | |
280 | $(subst /,\\,$(libs)) \ | |
281 | ,\"$(arg)\") | |
273 | 282 | $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \ |
274 | 283 | /OUT:$(out) \ |
275 | 284 | /IMPLIB:$(outbase).lib \ |
279 | 288 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
280 | 289 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
281 | 290 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
282 | $(subst /,\\,$(objs)) \ | |
283 | $(subst /,\\,$(libs)) | |
291 | @$(outbase).rsp | |
284 | 292 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
285 | 293 | $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
286 | 294 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/ |
304 | 312 | # @param $(outbase) Output basename (full). Use this for list files and such. |
305 | 313 | TOOL_VCC80AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
306 | 314 | TOOL_VCC80AMD64_LINK_SYSMOD_DEPORD = |
307 | TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map | |
315 | TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp | |
308 | 316 | TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
309 | 317 | TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb |
310 | 318 | TOOL_VCC80AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
311 | 319 | define TOOL_VCC80AMD64_LINK_SYSMOD_CMDS |
320 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
321 | $(foreach arg,\ | |
322 | $(subst /,\\,$(objs)) \ | |
323 | $(subst /,\\,$(libs)) \ | |
324 | ,\"$(arg)\") | |
312 | 325 | $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \ |
313 | 326 | /OUT:$(out) \ |
314 | 327 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
316 | 329 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
317 | 330 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
318 | 331 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
319 | $(subst /,\\,$(objs)) \ | |
320 | $(subst /,\\,$(libs)) | |
332 | @$(outbase).rsp | |
321 | 333 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
322 | 334 | $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
323 | 335 | endef |
0 | # $Id: VCC80X86.kmk 2524 2011-08-01 13:37:47Z bird $ | |
0 | # $Id: VCC80X86.kmk 2557 2011-12-13 12:48:32Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # kBuild Tool Config - Visual C++ 8.0 (aka Visual .NET 2005, or MSC v14), targeting x86. |
3 | 3 | # |
206 | 206 | TOOL_VCC80X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp |
207 | 207 | TOOL_VCC80X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb |
208 | 208 | define TOOL_VCC80X86_LINK_LIBRARY_CMDS |
209 | $(QUIET)$(APPEND) -n $(outbase).rsp \ | |
209 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
210 | 210 | $(foreach arg,\ |
211 | 211 | $(subst /,\\,$(objs) \ |
212 | 212 | $(filter-out %.def,$(othersrc))) \ |
232 | 232 | # |
233 | 233 | TOOL_VCC80X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
234 | 234 | TOOL_VCC80X86_LINK_PROGRAM_DEPORD = |
235 | TOOL_VCC80X86_LINK_PROGRAM_OUTPUT = $(outbase).map | |
235 | TOOL_VCC80X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp | |
236 | 236 | TOOL_VCC80X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
237 | 237 | TOOL_VCC80X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb |
238 | 238 | TOOL_VCC80X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
239 | 239 | define TOOL_VCC80X86_LINK_PROGRAM_CMDS |
240 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
241 | $(foreach arg,\ | |
242 | $(subst /,\\,$(objs)) \ | |
243 | $(subst /,\\,$(libs)) \ | |
244 | ,\"$(arg)\") | |
240 | 245 | $(QUIET)$(TOOL_VCC80X86_LD) $(flags) \ |
241 | 246 | /OUT:$(out) \ |
242 | 247 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
244 | 249 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
245 | 250 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
246 | 251 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
247 | $(subst /,\\,$(objs)) \ | |
248 | $(subst /,\\,$(libs)) | |
252 | @$(outbase).rsp | |
249 | 253 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
250 | 254 | $(TOOL_VCC80X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)) |
251 | 255 | endef |
267 | 271 | # @param $(outbase) Output basename (full). Use this for list files and such. |
268 | 272 | TOOL_VCC80X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
269 | 273 | TOOL_VCC80X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB)) |
270 | TOOL_VCC80X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp | |
274 | TOOL_VCC80X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp | |
271 | 275 | TOOL_VCC80X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp |
272 | 276 | TOOL_VCC80X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb |
273 | 277 | TOOL_VCC80X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
274 | 278 | define TOOL_VCC80X86_LINK_DLL_CMDS |
279 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
280 | $(foreach arg,\ | |
281 | $(subst /,\\,$(objs)) \ | |
282 | $(subst /,\\,$(libs)) \ | |
283 | ,\"$(arg)\") | |
275 | 284 | $(QUIET)$(TOOL_VCC80X86_LD) $(flags) \ |
276 | 285 | /OUT:$(out) \ |
277 | 286 | /IMPLIB:$(outbase).lib \ |
281 | 290 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
282 | 291 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
283 | 292 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
284 | $(subst /,\\,$(objs)) \ | |
285 | $(subst /,\\,$(libs)) | |
293 | @$(outbase).rsp | |
286 | 294 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
287 | 295 | $(TOOL_VCC80X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
288 | 296 | $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/ |
306 | 314 | # @param $(outbase) Output basename (full). Use this for list files and such. |
307 | 315 | TOOL_VCC80X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc) |
308 | 316 | TOOL_VCC80X86_LINK_SYSMOD_DEPORD = |
309 | TOOL_VCC80X86_LINK_SYSMOD_OUTPUT = $(outbase).map | |
317 | TOOL_VCC80X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp | |
310 | 318 | TOOL_VCC80X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest |
311 | 319 | TOOL_VCC80X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb |
312 | 320 | TOOL_VCC80X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb |
313 | 321 | define TOOL_VCC80X86_LINK_SYSMOD_CMDS |
322 | $(QUIET)$(APPEND) -tn $(outbase).rsp \ | |
323 | $(foreach arg,\ | |
324 | $(subst /,\\,$(objs)) \ | |
325 | $(subst /,\\,$(libs)) \ | |
326 | ,\"$(arg)\") | |
314 | 327 | $(QUIET)$(TOOL_VCC80X86_LD) $(flags) \ |
315 | 328 | /OUT:$(out) \ |
316 | 329 | /MAPINFO:EXPORTS /INCREMENTAL:NO \ |
318 | 331 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \ |
319 | 332 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \ |
320 | 333 | $(foreach p,$(libpath), /LIBPATH:$(p)) \ |
321 | $(subst /,\\,$(objs)) \ | |
322 | $(subst /,\\,$(libs)) | |
334 | @$(outbase).rsp | |
323 | 335 | $(QUIET)$(TEST) -f $(out).manifest -- \ |
324 | 336 | $(TOOL_VCC80X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2' |
325 | 337 | endef |
0 | # $Id: dtrace.kmk 2571 2012-04-15 11:12:31Z bird $ | |
1 | ## @file | |
2 | # DTrace unit. | |
3 | # | |
4 | ||
5 | # | |
6 | # Copyright (c) 2012 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | # | |
8 | # This file is part of kBuild. | |
9 | # | |
10 | # kBuild is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 2 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # kBuild is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with kBuild; if not, write to the Free Software | |
22 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
23 | # | |
24 | # | |
25 | # As a special exception you are granted permission to include this file, via | |
26 | # the kmk include directive, as you wish without this in itself causing the | |
27 | # resulting makefile, program or whatever to be covered by the GPL license. | |
28 | # This exception does not however invalidate any other reasons why the makefile, | |
29 | # program, whatever should not be covered the GPL. | |
30 | # | |
31 | # | |
32 | ||
33 | ifdef UNIT_dtrace | |
34 | $(error kBuild: The lex unit was included twice!) | |
35 | endif | |
36 | UNIT_dtrace = dtrace | |
37 | ||
38 | # Add our target properties. | |
39 | PROPS_TOOLS += DTRACETOOL | |
40 | PROPS_SINGLE += DTRACETOOL | |
41 | PROPS_ACCUMULATE_R += DTRACE_HDR_FLAGS DTRACE_OBJ_FLAGS | |
42 | ||
43 | # Add ourselves to the default source handlers. | |
44 | KBUILD_SRC_HANDLERS += \ | |
45 | .d:def_src_handler_dtrace | |
46 | ||
47 | ||
48 | ## wrapper the compile command dependency check. | |
49 | ifndef NO_COMPILE_CMDS_DEPS | |
50 | _DEP_DTRACE_HDR_CMDS = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_DTRACE_HDR_CMDS_PREV_),$$(commands $(out)),FORCE) | |
51 | _DEP_DTRACE_OBJ_CMDS = $$(comp-cmds-ex $$($(target)_$(subst :,_,$(source))_DTRACE_OBJ_CMDS_PREV_),$$(commands $(out)),FORCE) | |
52 | else | |
53 | _DEP_DTRACE_HDR_CMDS = | |
54 | _DEP_DTRACE_OBJ_CMDS = | |
55 | endif | |
56 | ||
57 | ||
58 | ## | |
59 | # Generates the rule for creating a DTrace header from a D source file. | |
60 | # | |
61 | # @param out The output file. | |
62 | # @param cmds The dtrace command(s). | |
63 | # @param lots more | |
64 | # | |
65 | define def_dtrace_hdr_rule | |
66 | $(out): \ | |
67 | $(deps) \ | |
68 | $(value _DEP_DTRACE_HDR_CMDS) \ | |
69 | | \ | |
70 | $(orderdeps) | |
71 | %$$(call MSG_GENERATE,$(target),$$@,$(source)) | |
72 | $$(QUIET)$$(RM) -f -- $(dep) $(out) | |
73 | ||
74 | $(cmds) | |
75 | ||
76 | ifndef NO_COMPILE_CMDS_DEPS | |
77 | %$$(QUIET2)$$(APPEND) '$(dep)' | |
78 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_DTRACE_HDR_CMDS_PREV_' | |
79 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' | |
80 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' | |
81 | endif | |
82 | ||
83 | # update globals | |
84 | _OUT_FILES += $(out) | |
85 | $(target)_INTERMEDIATES += $(out) | |
86 | ||
87 | endef # def_dtrace_hdr_rule | |
88 | ||
89 | ||
90 | ## | |
91 | # Generates the rule for creating a DTrace object file from a D source file | |
92 | # and a bunch of object files. | |
93 | # | |
94 | # @param out The output file. | |
95 | # @param cmds The dtrace command(s). | |
96 | # @param lots more | |
97 | # | |
98 | define def_dtrace_obj_rule | |
99 | $(out): \ | |
100 | $(deps) \ | |
101 | $$$$(filter-out %-dtrace-object-format.o, $$$$($(target)_2_OBJS)) \ | |
102 | $(value _DEP_DTRACE_OBJ_CMDS) \ | |
103 | | \ | |
104 | $(orderdeps) | |
105 | %$$(call MSG_GENERATE,$(target),$$@,$(source) ++) | |
106 | $$(QUIET)$$(RM) -f -- $(dep) $(out) | |
107 | ||
108 | $(cmds) | |
109 | ||
110 | ifndef NO_COMPILE_CMDS_DEPS | |
111 | %$$(QUIET2)$$(APPEND) '$(dep)' | |
112 | %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_DTRACE_OBJ_CMDS_PREV_' | |
113 | %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)' | |
114 | %$$(QUIET2)$$(APPEND) '$(dep)' 'endef' | |
115 | endif | |
116 | ||
117 | # update globals | |
118 | _OUT_FILES += $(out) | |
119 | $(target)_2_OBJS <= $(out) | |
120 | ||
121 | endef # def_dtrace_hdr_rule | |
122 | ||
123 | ||
124 | ## | |
125 | # Handler for .d files listed in the SOURCES properties. | |
126 | # | |
127 | # .d files are transformed into .h that is used when compiling, thus needing | |
128 | # to be generated before anything is compiled, and into object files that needs | |
129 | # to go into the linking. Mac does not create object files. | |
130 | # | |
131 | # The step producing the object file requires all the object files with dtrace | |
132 | # probes in them as input/output as well, because it adjusts the dtrace symbols | |
133 | # from UNDEF to IGNORE. This is really ugly and cannot be expressed in make | |
134 | # syntax (prerequisite object files being modified). Fortunately, it works | |
135 | # fine because the object files won't be used by anyone else before the dtrace | |
136 | # object file exists. | |
137 | # | |
138 | # @param target The target file. | |
139 | # @param source The source file. | |
140 | # @param lots more | |
141 | # @returns quite a bit. | |
142 | define def_src_handler_dtrace | |
143 | ||
144 | local type := DTRACE | |
145 | local tmp := $(kb-src-tool tool) | |
146 | ifeq ($(tool),) | |
147 | $ (error kBuild: $(target) / $(sources) does not have a (DTRACE) tool defined!) | |
148 | endif | |
149 | local dtracedir := $($(target)_0_OUTDIR)/dtrace | |
150 | ||
151 | # | |
152 | # The header file first. | |
153 | # | |
154 | ||
155 | # Figure out all the props. | |
156 | ifndef TOOL_$(tool)_DTRACE_HDR_CMDS | |
157 | $(error kBuild: TOOL_$(tool)_DTRACE_HDR_CMDS isn't defined! target=$(target) source=$(source) ) | |
158 | endif | |
159 | ## @todo put the header in a subdir and add this to INCS? Do we have a early per-target hook for this?? | |
160 | local outbase := $(dtracedir)/dtrace/$(basename $(notdir $(source))) | |
161 | local out := $(outbase).h | |
162 | local tmp := $(kb-src-prop DTRACE_HDR_FLAGS,flags,left-to-right,) | |
163 | local tmp := $(kb-src-prop DEPS,deps,left-to-right,$(defpath)) | |
164 | local tmp := $(kb-src-prop ORDERDEPS,orderdeps,left-to-right,$(defpath)) | |
165 | local dirdep := $(call DIRDEP,$(dir $(out))) | |
166 | ||
167 | # Adjust paths if we got a default path. | |
168 | ifneq ($(defpath),) | |
169 | local source := $(abspathex $(source),$(defpath)) | |
170 | endif | |
171 | ||
172 | # dependency file. | |
173 | local dep := $(out)$(SUFF_DEP) | |
174 | ifndef NO_COMPILE_CMDS_DEPS | |
175 | _DEPFILES_INCLUDED += $(dep) | |
176 | $(eval includedep $(dep)) | |
177 | endif | |
178 | ||
179 | # call the tool | |
180 | local cmds := $(TOOL_$(tool)_DTRACE_HDR_CMDS) | |
181 | local deps += $(TOOL_$(tool)_DTRACE_DEPEND) $(source) | |
182 | local orderdeps += $(TOOL_$(tool)_DTRACE_DEPORD) $(dirdep) | |
183 | ||
184 | # generate the rule. | |
185 | $(eval $(def_dtrace_hdr_rule)) | |
186 | ||
187 | ||
188 | # | |
189 | # Adjust the object files and generate one from the D source, if needed. | |
190 | # | |
191 | ifn1of ($(bld_trg), $(TOOL_$(tool)_DTRACE_OBJ_NOT_NEEDED)) | |
192 | # Figure out all the props. | |
193 | ifndef TOOL_$(tool)_DTRACE_OBJ_CMDS | |
194 | $(error kBuild: TOOL_$(tool)_DTRACE_OBJ_CMDS isn't defined! target=$(target) source=$(source) ) | |
195 | endif | |
196 | local outbase := $(dtracedir)/$(basename $(notdir $(source))) | |
197 | local out := $(outbase)-dtrace-object-format.o | |
198 | local tmp := $(kb-src-prop DTRACE_OBJ_FLAGS,flags,left-to-right,) | |
199 | local tmp := $(kb-src-prop DEPS,deps,left-to-right,$(defpath)) | |
200 | local tmp := $(kb-src-prop ORDERDEPS,orderdeps,left-to-right,$(defpath)) | |
201 | local dirdep := $(call DIRDEP,$(dir $(out))) | |
202 | ||
203 | # Adjust paths if we got a default path. | |
204 | ifneq ($(defpath),) | |
205 | local source := $(abspathex $(source),$(defpath)) | |
206 | endif | |
207 | ||
208 | # dependency file. | |
209 | local dep := $(out)$(SUFF_DEP) | |
210 | ifndef NO_COMPILE_CMDS_DEPS | |
211 | _DEPFILES_INCLUDED += $(dep) | |
212 | $(eval includedep $(dep)) | |
213 | endif | |
214 | ||
215 | # call the tool | |
216 | local cmds := $(TOOL_$(tool)_DTRACE_OBJ_CMDS) | |
217 | local deps += $(TOOL_$(tool)_DTRACE_DEPEND) $(source) | |
218 | local orderdeps += $(TOOL_$(tool)_DTRACE_DEPORD) $(dirdep) | |
219 | ||
220 | # generate the rule. | |
221 | $(eval $(def_dtrace_obj_rule)) | |
222 | endif | |
223 | ||
224 | endef # def_src_handler_dtrace | |
225 | ||
226 | ||
227 | ||
228 | # | |
229 | # The pre-target hook. | |
230 | # | |
231 | define def_unit_dtrace_target_pre | |
232 | ||
233 | local dtracedir := $($(target)_0_OUTDIR)/dtrace | |
234 | $(eval $(target)_INCS += $(dtracedir)) | |
235 | ||
236 | endef #def_unit_dtrace_target_pre | |
237 |
0 | # $Id: qt3.kmk 2479 2011-07-20 14:16:19Z bird $ | |
0 | # $Id: qt3.kmk 2544 2011-09-13 19:00:25Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # Qt 3.3.x unit. |
3 | 3 | # |
118 | 118 | $(PATH_SDK_QT3)/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \ |
119 | 119 | /usr/lib32/libqt-mt$(SUFF_DLL) \ |
120 | 120 | /usr/lib32/qt3/libqt-mt$(SUFF_DLL) \ |
121 | /usr/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \ | |
121 | /usr/lib/i386-linux-gnu/libqt-mt$(SUFF_DLL) \ | |
122 | 122 | /usr/local/lib32/libqt-mt$(SUFF_DLL) \ |
123 | 123 | /usr/local/lib32/qt3/libqt-mt$(SUFF_DLL) \ |
124 | 124 | /usr/local/lib32/qt3-3/lib/libqt-mt$(SUFF_DLL) \ |
125 | /usr/local/lib/i386-linux-gnu/libqt-mt$(SUFF_DLL) \ | |
125 | 126 | $(PATH_SDK_QT3)/lib/libqt-mt$(SUFF_DLL) \ |
126 | 127 | $(PATH_SDK_QT3)/lib/qt3/libqt-mt$(SUFF_DLL) \ |
127 | 128 | $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \ |
129 | $(PATH_SDK_QT3)/lib/i386-linux-gnu/libqt-mt$(SUFF_DLL) \ | |
128 | 130 | ))) |
129 | 131 | ifneq ($(PATH_SDK_QT3_LIB.x86),) |
130 | 132 | export PATH_SDK_QT3_LIB.x86 |
142 | 144 | /usr/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \ |
143 | 145 | /usr/lib/amd64/libqt-mt$(SUFF_DLL) \ |
144 | 146 | /usr/lib/64/libqt-mt$(SUFF_DLL) \ |
147 | /usr/lib/x86_64-linux-gnu/libqt-mt$(SUFF_DLL) \ | |
145 | 148 | /usr/local/lib64/libqt-mt$(SUFF_DLL) \ |
146 | 149 | /usr/local/lib64/qt3/libqt-mt$(SUFF_DLL) \ |
147 | 150 | /usr/local/lib64/qt3-3/lib/libqt-mt$(SUFF_DLL) \ |
148 | 151 | /usr/local/lib/amd64/libqt-mt$(SUFF_DLL) \ |
149 | 152 | /usr/local/lib/64/libqt-mt$(SUFF_DLL) \ |
153 | /usr/local/lib/x86_64-linux-gnu/libqt-mt$(SUFF_DLL) \ | |
150 | 154 | $(PATH_SDK_QT3)/lib/libqt-mt$(SUFF_DLL) \ |
151 | 155 | $(PATH_SDK_QT3)/lib/qt3/libqt-mt$(SUFF_DLL) \ |
152 | 156 | $(PATH_SDK_QT3)/lib/qt3-3/lib/libqt-mt$(SUFF_DLL) \ |
157 | $(PATH_SDK_QT3)/lib/x86_64-linux-gnu/libqt-mt$(SUFF_DLL) \ | |
153 | 158 | ))) |
154 | 159 | ifneq ($(PATH_SDK_QT3_LIB.amd64),) |
155 | 160 | export PATH_SDK_QT3_LIB.amd64 |
0 | # $Id: qt4.kmk 2479 2011-07-20 14:16:19Z bird $ | |
0 | # $Id: qt4.kmk 2544 2011-09-13 19:00:25Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # Qt 4 unit. |
3 | 3 | # |
115 | 115 | $(PATH_SDK_QT4)/lib32/qt4/libQtCore$(SUFF_DLL) \ |
116 | 116 | /usr/lib32/libQtCore$(SUFF_DLL) \ |
117 | 117 | /usr/lib32/qt4/libQtCore$(SUFF_DLL) \ |
118 | /usr/lib/i386-linux-gnu/libQtCore$(SUFF_DLL) \ | |
118 | 119 | /usr/local/lib32/libQtCore$(SUFF_DLL) \ |
119 | 120 | /usr/local/lib32/qt4/libQtCore$(SUFF_DLL) \ |
121 | /usr/local/lib/i386-linux-gnu/libQtCore$(SUFF_DLL) \ | |
120 | 122 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \ |
121 | 123 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \ |
124 | $(PATH_SDK_QT4)/lib/i386-linux-gnu/libQtCore$(SUFF_DLL) \ | |
122 | 125 | ))) |
123 | 126 | ifneq ($(PATH_SDK_QT4_LIB.x86),) |
124 | 127 | export PATH_SDK_QT4_LIB.x86 |
132 | 135 | /usr/lib64/libQtCore$(SUFF_DLL) \ |
133 | 136 | /usr/lib64/qt4/libQtCore$(SUFF_DLL) \ |
134 | 137 | /usr/lib/amd64/libQtCore$(SUFF_DLL) \ |
138 | /usr/lib/x86_64-linux-gnu/libQtCore$(SUFF_DLL) \ | |
135 | 139 | /usr/local/lib64/libQtCore$(SUFF_DLL) \ |
136 | 140 | /usr/local/lib64/qt4/libQtCore$(SUFF_DLL) \ |
137 | 141 | /usr/local/lib/amd64/libQtCore$(SUFF_DLL) \ |
142 | /usr/local/lib/x86_64-linux-gnu/libQtCore$(SUFF_DLL) \ | |
138 | 143 | $(PATH_SDK_QT4)/lib/libQtCore$(SUFF_DLL) \ |
139 | 144 | $(PATH_SDK_QT4)/lib/qt4/libQtCore$(SUFF_DLL) \ |
145 | $(PATH_SDK_QT4)/lib/x86_64-linux-gnu/libQtCore$(SUFF_DLL) \ | |
140 | 146 | ))) |
141 | 147 | ifneq ($(PATH_SDK_QT4_LIB.amd64),) |
142 | 148 | export PATH_SDK_QT4_LIB.amd64 |
0 | /* $Id: kObjCache.c 2463 2011-07-08 11:54:37Z bird $ */ | |
0 | /* $Id: kObjCache.c 2568 2012-03-18 17:59:32Z bird $ */ | |
1 | 1 | /** @file |
2 | 2 | * kObjCache - Object Cache. |
3 | 3 | */ |
72 | 72 | # include <Windows.h> |
73 | 73 | # include "quoted_spawn.h" |
74 | 74 | #endif |
75 | #if defined(__HAIKU__) | |
76 | # include <posix/sys/file.h> | |
77 | #endif | |
75 | 78 | |
76 | 79 | #include "crc32.h" |
77 | 80 | #include "md5.h" |
658 | 661 | && errno != EEXIST) |
659 | 662 | #else |
660 | 663 | if ( mkdir(pszAbsPath, 0777) |
661 | && errno != EEXIST) | |
664 | && errno != EEXIST | |
665 | && errno != ENOSYS /* Solaris nonsensical mkdir crap. */ | |
666 | && errno != EACCES /* Solaris nonsensical mkdir crap. */ | |
667 | ) | |
662 | 668 | #endif |
663 | 669 | { |
664 | 670 | iErr = errno; |
3983 | 3989 | } |
3984 | 3990 | else if (!strcmp(argv[i], "-V") || !strcmp(argv[i], "--version")) |
3985 | 3991 | { |
3986 | printf("kObjCache - kBuild version %d.%d.%d ($Revision: 2463 $)\n" | |
3992 | printf("kObjCache - kBuild version %d.%d.%d ($Revision: 2568 $)\n" | |
3987 | 3993 | "Copyright (c) 2007-2011 knut st. osmundsen\n", |
3988 | 3994 | KBUILD_VERSION_MAJOR, KBUILD_VERSION_MINOR, KBUILD_VERSION_PATCH); |
3989 | 3995 | return 0; |
0 | # $Id: Makefile.kmk 2498 2011-07-22 12:05:57Z bird $ | |
0 | # $Id: Makefile.kmk 2546 2011-10-01 19:49:54Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # Sub-makefile for kash. |
3 | 3 | # |
35 | 35 | kash_DEFS = lint SHELL SMALL |
36 | 36 | kash_DEFS += SH_FORKED_MODE |
37 | 37 | kash_DEFS.debug = DEBUG=2 |
38 | kash_DEFS.haiku = BSD | |
38 | 39 | kash_DEFS.linux = BSD |
39 | 40 | kash_DEFS.solaris = BSD |
40 | 41 | ## @todo bring over PC_SLASHES? |
95 | 96 | shheap.c \ |
96 | 97 | shthread.c \ |
97 | 98 | shfile.c |
99 | kash_SOURCES.haiku = \ | |
100 | sys_signame.c \ | |
101 | strlcpy.c | |
98 | 102 | kash_SOURCES.linux = \ |
99 | 103 | sys_signame.c \ |
100 | 104 | strlcpy.c |
105 | kash_SOURCES.solaris = \ | |
106 | sys_signame.c \ | |
107 | strlcpy.c | |
101 | 108 | kash_SOURCES.win = \ |
102 | 109 | sys_signame.c \ |
103 | 110 | strlcpy.c \ |
104 | 111 | shfork-win.c \ |
105 | 112 | shforkA-win.asm |
106 | kash_SOURCES.solaris = \ | |
107 | sys_signame.c \ | |
108 | strlcpy.c | |
109 | 113 | |
110 | 114 | kash_INTERMEDIATES = \ |
111 | 115 | $(kash_0_OUTDIR)/builtins.h \ |
58 | 58 | * inner scope, and restore handler on exit from the scope. |
59 | 59 | */ |
60 | 60 | |
61 | #include <setjmp.h> | |
61 | #ifndef __HAIKU__ | |
62 | # include <setjmp.h> | |
63 | #else | |
64 | # include <posix/setjmp.h> /** @todo silly */ | |
65 | #endif | |
62 | 66 | |
63 | 67 | struct jmploc { |
64 | 68 | jmp_buf loc; |
119 | 123 | * so we use _setjmp instead. |
120 | 124 | */ |
121 | 125 | |
122 | #if defined(BSD) && !defined(__SVR4) && !defined(__GLIBC__) && !defined(__KLIBC__) && !defined(_MSC_VER) | |
126 | #if defined(BSD) && !defined(__SVR4) && !defined(__GLIBC__) \ | |
127 | && !defined(__KLIBC__) && !defined(_MSC_VER) && !defined(__HAIKU__) | |
123 | 128 | #define setjmp(jmploc) _setjmp(jmploc) |
124 | 129 | #define longjmp(jmploc, val) _longjmp(jmploc, val) |
125 | 130 | #endif |
0 | /* $Id: shfile.c 2425 2010-10-18 08:52:22Z bird $ */ | |
0 | /* $Id: shfile.c 2553 2011-11-25 21:44:21Z bird $ */ | |
1 | 1 | /** @file |
2 | 2 | * |
3 | 3 | * File management. |
789 | 789 | i, hFile, pfdtab->tab[i].oflags, pfdtab->tab[i].shflags)); |
790 | 790 | if (!SetHandleInformation(hFile, HANDLE_FLAG_INHERIT, fFlag)) |
791 | 791 | { |
792 | #if 0 /* Seems to happen for console handles, ignore it. */ | |
792 | 793 | DWORD err = GetLastError(); |
793 | 794 | assert(0); |
795 | #endif | |
794 | 796 | } |
795 | 797 | } |
796 | 798 | } |
863 | 865 | |
864 | 866 | if (!SetHandleInformation(hFile, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT)) |
865 | 867 | { |
868 | #if 0 /* Seems to fail for console handles, ignore. */ | |
866 | 869 | DWORD err = GetLastError(); |
867 | 870 | assert(0); |
871 | #endif | |
868 | 872 | } |
869 | 873 | paf[i] = FOPEN; |
870 | 874 | if (pfdtab->tab[i].oflags & _O_APPEND) |
0 | /* $Id: shfile.h 2498 2011-07-22 12:05:57Z bird $ */ | |
0 | /* $Id: shfile.h 2546 2011-10-01 19:49:54Z bird $ */ | |
1 | 1 | /** @file |
2 | * | |
3 | 2 | * File management. |
4 | * | |
3 | */ | |
4 | ||
5 | /* | |
5 | 6 | * Copyright (c) 2007-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net> |
6 | 7 | * |
7 | 8 | * |
45 | 46 | # endif |
46 | 47 | #endif |
47 | 48 | #ifndef _MSC_VER |
48 | # include <sys/fcntl.h> | |
49 | # include <fcntl.h> | |
49 | 50 | # include <unistd.h> |
50 | 51 | # ifndef O_BINARY |
51 | 52 | # define O_BINARY 0 |
0 | /* $Id: shinstance.c 2423 2010-10-17 23:43:35Z bird $ */ | |
0 | /* $Id: shinstance.c 2546 2011-10-01 19:49:54Z bird $ */ | |
1 | 1 | /** @file |
2 | 2 | * The shell instance methods. |
3 | 3 | */ |
888 | 888 | (void)hChild; |
889 | 889 | return 0; |
890 | 890 | } |
891 | #include <setjmp.h> | |
892 | 891 | |
893 | 892 | pid_t sh_fork(shinstance *psh) |
894 | 893 | { |
0 | /* $Id: shinstance.h 2498 2011-07-22 12:05:57Z bird $ */ | |
0 | /* $Id: shinstance.h 2546 2011-10-01 19:49:54Z bird $ */ | |
1 | 1 | /** @file |
2 | 2 | * The shell instance and it's methods. |
3 | 3 | */ |
443 | 443 | # define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED) |
444 | 444 | #else |
445 | 445 | # include <sys/wait.h> |
446 | # ifdef __HAIKU__ | |
447 | # define WCOREDUMP(x) (0) /** @todo check the haiku headers and see if this information is available or not... */ | |
448 | # endif | |
446 | 449 | #endif |
447 | 450 | pid_t sh_fork(shinstance *); |
448 | 451 | pid_t sh_waitpid(shinstance *, pid_t, int *, int); |
0 | /* $Id: shtypes.h 2413 2010-09-11 17:43:04Z bird $ */ | |
0 | /* $Id: shtypes.h 2546 2011-10-01 19:49:54Z bird $ */ | |
1 | 1 | /** @file |
2 | * | |
3 | 2 | * Wrapper for missing types and such. |
4 | * | |
3 | */ | |
4 | ||
5 | /* | |
5 | 6 | * Copyright (c) 2007-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net> |
6 | 7 | * |
7 | 8 | * |
30 | 31 | |
31 | 32 | #include <sys/types.h> |
32 | 33 | #include <stdlib.h> |
33 | #ifndef _MSC_VER | |
34 | #ifdef __HAIKU__ | |
35 | # include <posix/signal.h> /* silly */ | |
36 | #elif !defined(_MSC_VER) | |
34 | 37 | # include <sys/signal.h> |
35 | 38 | #endif |
36 | 39 |
67 | 67 | |
68 | 68 | #endif |
69 | 69 | |
70 | #if defined(_MSC_VER) || defined(_WIN32) | |
71 | /* On Windows the PATH variable is called "Path". */ | |
72 | # define PC_MIXED_PATH_VAR_NAME | |
73 | #endif | |
74 | ||
75 | ||
70 | 76 | |
71 | 77 | /* |
72 | 78 | * Shell variables. |
149 | 155 | NULL }, |
150 | 156 | { offsetof(shinstance, vpath), VSTRFIXED|VTEXTFIXED, "PATH=" _PATH_DEFPATH, |
151 | 157 | changepath }, |
152 | #ifdef _MSC_VER | |
153 | { offsetof(shinstance, vpath2), VSTRFIXED|VTEXTFIXED, "Path=", | |
154 | changepath }, | |
155 | #endif | |
156 | 158 | /* |
157 | 159 | * vps1 depends on uid |
158 | 160 | */ |
396 | 398 | /* not found */ |
397 | 399 | if (flags & VNOSET) |
398 | 400 | return; |
401 | ||
402 | #ifdef PC_MIXED_PATH_VAR_NAME | |
403 | if ( nlen == 4 | |
404 | && (s[0] == 'p' || s[0] == 'P') | |
405 | && (s[1] == 'a' || s[1] == 'A') | |
406 | && (s[2] == 't' || s[2] == 'T') | |
407 | && (s[3] == 'h' || s[3] == 'H') ) { | |
408 | s[0] = 'P'; | |
409 | s[1] = 'A'; | |
410 | s[2] = 'T'; | |
411 | s[3] = 'H'; | |
412 | } | |
413 | #endif | |
414 | ||
399 | 415 | vp = ckmalloc(psh, sizeof (*vp)); |
400 | 416 | vp->flags = flags & ~VNOFUNC; |
401 | 417 | vp->text = s; |
910 | 926 | hashval = 2 * hashval + (unsigned char)*p++; |
911 | 927 | len = (int)(p - name); |
912 | 928 | |
929 | #ifdef PC_MIXED_PATH_VAR_NAME | |
930 | /* On Windows the PATH variable is called "Path". */ | |
931 | if ( len == 4 | |
932 | && (name[0] == 'p' || name[0] == 'P') | |
933 | && (name[1] == 'a' || name[1] == 'A') | |
934 | && (name[2] == 't' || name[2] == 'T') | |
935 | && (name[3] == 'h' || name[3] == 'H') ) | |
936 | { | |
937 | name = "PATH"; | |
938 | hashval = (unsigned char)'P'; | |
939 | hashval = hashval * 2 + (unsigned char)'A'; | |
940 | hashval = hashval * 2 + (unsigned char)'T'; | |
941 | hashval = hashval * 2 + (unsigned char)'H'; | |
942 | } | |
943 | #endif | |
944 | ||
913 | 945 | if (lenp) |
914 | 946 | *lenp = len; |
915 | 947 | vpp = &psh->vartab[hashval % VTABSIZE]; |
51 | 51 | strcache2.c \ |
52 | 52 | alloccache.c \ |
53 | 53 | kbuild.c \ |
54 | kbuild-read.c \ | |
54 | 55 | electric.c \ |
55 | 56 | ../lib/md5.c \ |
56 | 57 | ../lib/kDep.c \ |
0 | # $Id: Makefile.kmk 2532 2011-08-02 13:05:37Z bird $ | |
0 | # $Id: Makefile.kmk 2548 2011-11-08 21:28:16Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # Sub-makefile for kmk / GNU Make. |
3 | 3 | # |
56 | 56 | TEMPLATE_BIN-KMK_INCS.darwin = glob |
57 | 57 | TEMPLATE_BIN-KMK_INCS.dragonfly = glob |
58 | 58 | TEMPLATE_BIN-KMK_INCS.freebsd = glob |
59 | TEMPLATE_BIN-KMK_INCS.haiku = glob | |
59 | 60 | TEMPLATE_BIN-KMK_INCS.openbsd = glob |
60 | 61 | TEMPLATE_BIN-KMK_INCS.solaris = glob |
61 | 62 | TEMPLATE_BIN-KMK_LIBS = $(TEMPLATE_BIN-THREADED_LIBS) $(kmkmissing_1_TARGET) $(LIB_KUTIL) |
97 | 98 | glob/fnmatch.c |
98 | 99 | |
99 | 100 | kmkmissing_SOURCES.freebsd = \ |
101 | glob/glob.c \ | |
102 | glob/fnmatch.c | |
103 | ||
104 | kmkmissing_SOURCES.haiku = \ | |
105 | kmkbuiltin/haikufakes.c \ | |
100 | 106 | glob/glob.c \ |
101 | 107 | glob/fnmatch.c |
102 | 108 | |
197 | 203 | kmk_SOURCES = \ |
198 | 204 | main.c \ |
199 | 205 | kbuild.c \ |
206 | kbuild-read.c \ | |
200 | 207 | read.c \ |
201 | 208 | expreval.c \ |
202 | 209 | incdep.c \ |
230 | 230 | #endif |
231 | 231 | |
232 | 232 | #ifndef WINDOWS32 |
233 | # ifndef __BEOS__ | |
233 | # if !defined(__BEOS__) && !defined(__HAIKU__) | |
234 | 234 | # include <ar.h> |
235 | 235 | # else |
236 | 236 | /* BeOS 5 doesn't have <ar.h> but has archives in the same format |
0 | /* config.h. Generated from config.h.in by configure. */ | |
1 | /* config.h.in. Generated from configure.in by autoheader. */ | |
2 | ||
3 | /* Define to 1 if the `closedir' function returns void instead of `int'. */ | |
4 | /* #undef CLOSEDIR_VOID */ | |
5 | ||
6 | /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP | |
7 | systems. This function is required for `alloca.c' support on those systems. | |
8 | */ | |
9 | /* #undef CRAY_STACKSEG_END */ | |
10 | ||
11 | /* Define to 1 if using `alloca.c'. */ | |
12 | /* #undef C_ALLOCA */ | |
13 | ||
14 | /* Define to 1 if using `getloadavg.c'. */ | |
15 | #define C_GETLOADAVG 1 | |
16 | ||
17 | /* Define to 1 for DGUX with <sys/dg_sys_info.h>. */ | |
18 | /* #undef DGUX */ | |
19 | ||
20 | /* Use high resolution file timestamps if nonzero. */ | |
21 | #define FILE_TIMESTAMP_HI_RES 1 | |
22 | ||
23 | /* Define to 1 if the `getloadavg' function needs to be run setuid or setgid. | |
24 | */ | |
25 | /* #undef GETLOADAVG_PRIVILEGED */ | |
26 | ||
27 | /* Define to 1 if you have `alloca', as a function or macro. */ | |
28 | #define HAVE_ALLOCA 1 | |
29 | ||
30 | /* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). | |
31 | */ | |
32 | #define HAVE_ALLOCA_H 1 | |
33 | ||
34 | /* Define to 1 if your compiler conforms to the ANSI C standard. */ | |
35 | #define HAVE_ANSI_COMPILER 1 | |
36 | ||
37 | /* Define to 1 if you have the `atexit' function. */ | |
38 | #define HAVE_ATEXIT 1 | |
39 | ||
40 | /* Define to 1 if you have the `bsd_signal' function. */ | |
41 | /* #undef HAVE_BSD_SIGNAL */ | |
42 | ||
43 | /* Use case insensitive file names */ | |
44 | /* #undef HAVE_CASE_INSENSITIVE_FS */ | |
45 | ||
46 | /* Define to 1 if you have the clock_gettime function. */ | |
47 | /* #undef HAVE_CLOCK_GETTIME */ | |
48 | ||
49 | /* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you | |
50 | don't. */ | |
51 | #define HAVE_DECL_SYS_SIGLIST 1 | |
52 | ||
53 | /* Define to 1 if you have the declaration of `_sys_siglist', and to 0 if you | |
54 | don't. */ | |
55 | #define HAVE_DECL__SYS_SIGLIST 0 | |
56 | ||
57 | /* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you | |
58 | don't. */ | |
59 | #define HAVE_DECL___SYS_SIGLIST 0 | |
60 | ||
61 | /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. | |
62 | */ | |
63 | #define HAVE_DIRENT_H 1 | |
64 | ||
65 | /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ | |
66 | /* #undef HAVE_DOPRNT */ | |
67 | ||
68 | /* Use platform specific coding */ | |
69 | /* #undef HAVE_DOS_PATHS */ | |
70 | ||
71 | /* Define to 1 if you have the `dup2' function. */ | |
72 | #define HAVE_DUP2 1 | |
73 | ||
74 | /* Define to 1 if you have the <fcntl.h> header file. */ | |
75 | #define HAVE_FCNTL_H 1 | |
76 | ||
77 | /* Define to 1 if you have the `fdopen' function. */ | |
78 | #define HAVE_FDOPEN 1 | |
79 | ||
80 | /* Define to 1 if you have the `fork' function. */ | |
81 | #define HAVE_FORK 1 | |
82 | ||
83 | /* Define to 1 if you have the `getcwd' function. */ | |
84 | #define HAVE_GETCWD 1 | |
85 | ||
86 | /* Define to 1 if you have the `getgroups' function. */ | |
87 | #define HAVE_GETGROUPS 1 | |
88 | ||
89 | /* Define to 1 if you have the `gethostbyname' function. */ | |
90 | /* #undef HAVE_GETHOSTBYNAME */ | |
91 | ||
92 | /* Define to 1 if you have the `gethostname' function. */ | |
93 | /* #undef HAVE_GETHOSTNAME */ | |
94 | ||
95 | /* Define to 1 if you have the `getloadavg' function. */ | |
96 | /* #undef HAVE_GETLOADAVG */ | |
97 | ||
98 | /* Define to 1 if you have the `getrlimit' function. */ | |
99 | #define HAVE_GETRLIMIT 1 | |
100 | ||
101 | /* Define to 1 if you have a standard gettimeofday function */ | |
102 | #define HAVE_GETTIMEOFDAY 1 | |
103 | ||
104 | /* Define to 1 if you have the <inttypes.h> header file. */ | |
105 | #define HAVE_INTTYPES_H 1 | |
106 | ||
107 | /* Define to 1 if you have the `dgc' library (-ldgc). */ | |
108 | /* #undef HAVE_LIBDGC */ | |
109 | ||
110 | /* Define to 1 if you have the `kstat' library (-lkstat). */ | |
111 | /* #undef HAVE_LIBKSTAT */ | |
112 | ||
113 | /* Define to 1 if you have the <limits.h> header file. */ | |
114 | #define HAVE_LIMITS_H 1 | |
115 | ||
116 | /* Define to 1 if you have the <locale.h> header file. */ | |
117 | #define HAVE_LOCALE_H 1 | |
118 | ||
119 | /* Define to 1 if you have the `lstat' function. */ | |
120 | #define HAVE_LSTAT 1 | |
121 | ||
122 | /* Define to 1 if you have the <mach/mach.h> header file. */ | |
123 | /* #undef HAVE_MACH_MACH_H */ | |
124 | ||
125 | /* Define to 1 if you have the <memory.h> header file. */ | |
126 | #define HAVE_MEMORY_H 1 | |
127 | ||
128 | /* Define to 1 if you have the `mkstemp' function. */ | |
129 | #define HAVE_MKSTEMP 1 | |
130 | ||
131 | /* Define to 1 if you have the `mktemp' function. */ | |
132 | #define HAVE_MKTEMP 1 | |
133 | ||
134 | /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ | |
135 | /* #undef HAVE_NDIR_H */ | |
136 | ||
137 | /* Define to 1 if you have the <nlist.h> header file. */ | |
138 | /* #undef HAVE_NLIST_H */ | |
139 | ||
140 | /* Define to 1 if you have the `pipe' function. */ | |
141 | #define HAVE_PIPE 1 | |
142 | ||
143 | /* Define to 1 if you have the `pstat_getdynamic' function. */ | |
144 | /* #undef HAVE_PSTAT_GETDYNAMIC */ | |
145 | ||
146 | /* Define to 1 if you have the `readlink' function. */ | |
147 | #define HAVE_READLINK 1 | |
148 | ||
149 | /* Define to 1 if you have the `realpath' function. */ | |
150 | #define HAVE_REALPATH 1 | |
151 | ||
152 | /* Define to 1 if <signal.h> defines the SA_RESTART constant. */ | |
153 | #define HAVE_SA_RESTART 1 | |
154 | ||
155 | /* Define to 1 if you have the `setegid' function. */ | |
156 | #define HAVE_SETEGID 1 | |
157 | ||
158 | /* Define to 1 if you have the `seteuid' function. */ | |
159 | #define HAVE_SETEUID 1 | |
160 | ||
161 | /* Define to 1 if you have the `setlinebuf' function. */ | |
162 | #define HAVE_SETLINEBUF 1 | |
163 | ||
164 | /* Define to 1 if you have the `setlocale' function. */ | |
165 | #define HAVE_SETLOCALE 1 | |
166 | ||
167 | /* Define to 1 if you have the `setregid' function. */ | |
168 | #define HAVE_SETREGID 1 | |
169 | ||
170 | /* Define to 1 if you have the `setreuid' function. */ | |
171 | #define HAVE_SETREUID 1 | |
172 | ||
173 | /* Define to 1 if you have the `setrlimit' function. */ | |
174 | #define HAVE_SETRLIMIT 1 | |
175 | ||
176 | /* Define to 1 if you have the `setvbuf' function. */ | |
177 | #define HAVE_SETVBUF 1 | |
178 | ||
179 | /* Define to 1 if you have the `sigaction' function. */ | |
180 | #define HAVE_SIGACTION 1 | |
181 | ||
182 | /* Define to 1 if you have the `sigsetmask' function. */ | |
183 | /* #undef HAVE_SIGSETMASK */ | |
184 | ||
185 | /* Define to 1 if you have the `socket' function. */ | |
186 | /* #undef HAVE_SOCKET */ | |
187 | ||
188 | /* Define to 1 if you have the <stdarg.h> header file. */ | |
189 | #define HAVE_STDARG_H 1 | |
190 | ||
191 | /* Define to 1 if you have the <stdint.h> header file. */ | |
192 | #define HAVE_STDINT_H 1 | |
193 | ||
194 | /* Define to 1 if you have the <stdlib.h> header file. */ | |
195 | #define HAVE_STDLIB_H 1 | |
196 | ||
197 | /* Define to 1 if you have the `strcasecmp' function. */ | |
198 | #define HAVE_STRCASECMP 1 | |
199 | ||
200 | /* Define to 1 if you have the `strcmpi' function. */ | |
201 | /* #undef HAVE_STRCMPI */ | |
202 | ||
203 | /* Define to 1 if you have the `strcoll' function and it is properly defined. | |
204 | */ | |
205 | #define HAVE_STRCOLL 1 | |
206 | ||
207 | /* Define to 1 if you have the `strdup' function. */ | |
208 | #define HAVE_STRDUP 1 | |
209 | ||
210 | /* Define to 1 if you have the `strerror' function. */ | |
211 | #define HAVE_STRERROR 1 | |
212 | ||
213 | /* Define to 1 if you have the `stricmp' function. */ | |
214 | /* #undef HAVE_STRICMP */ | |
215 | ||
216 | /* Define to 1 if you have the <strings.h> header file. */ | |
217 | #define HAVE_STRINGS_H 1 | |
218 | ||
219 | /* Define to 1 if you have the <string.h> header file. */ | |
220 | #define HAVE_STRING_H 1 | |
221 | ||
222 | /* Define to 1 if you have the `strsignal' function. */ | |
223 | #define HAVE_STRSIGNAL 1 | |
224 | ||
225 | /* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */ | |
226 | /* #undef HAVE_STRUCT_NLIST_N_UN_N_NAME */ | |
227 | ||
228 | /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. | |
229 | */ | |
230 | /* #undef HAVE_SYS_DIR_H */ | |
231 | ||
232 | /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. | |
233 | */ | |
234 | /* #undef HAVE_SYS_NDIR_H */ | |
235 | ||
236 | /* Define to 1 if you have the <sys/param.h> header file. */ | |
237 | #define HAVE_SYS_PARAM_H 1 | |
238 | ||
239 | /* Define to 1 if you have the <sys/resource.h> header file. */ | |
240 | #define HAVE_SYS_RESOURCE_H 1 | |
241 | ||
242 | /* Define to 1 if you have the <sys/stat.h> header file. */ | |
243 | #define HAVE_SYS_STAT_H 1 | |
244 | ||
245 | /* Define to 1 if you have the <sys/timeb.h> header file. */ | |
246 | #define HAVE_SYS_TIMEB_H 1 | |
247 | ||
248 | /* Define to 1 if you have the <sys/time.h> header file. */ | |
249 | #define HAVE_SYS_TIME_H 1 | |
250 | ||
251 | /* Define to 1 if you have the <sys/types.h> header file. */ | |
252 | #define HAVE_SYS_TYPES_H 1 | |
253 | ||
254 | /* Define to 1 if you have the <sys/wait.h> header file. */ | |
255 | #define HAVE_SYS_WAIT_H 1 | |
256 | ||
257 | /* Define to 1 if you have the \`union wait' type in <sys/wait.h>. */ | |
258 | /* #undef HAVE_UNION_WAIT */ | |
259 | ||
260 | /* Define to 1 if you have the <unistd.h> header file. */ | |
261 | #define HAVE_UNISTD_H 1 | |
262 | ||
263 | /* Define to 1 if you have the <varargs.h> header file. */ | |
264 | /* #undef HAVE_VARARGS_H */ | |
265 | ||
266 | /* Define to 1 if you have the `vfork' function. */ | |
267 | #define HAVE_VFORK 1 | |
268 | ||
269 | /* Define to 1 if you have the <vfork.h> header file. */ | |
270 | /* #undef HAVE_VFORK_H */ | |
271 | ||
272 | /* Define to 1 if you have the `vprintf' function. */ | |
273 | #define HAVE_VPRINTF 1 | |
274 | ||
275 | /* Define to 1 if you have the `wait3' function. */ | |
276 | /* #undef HAVE_WAIT3 */ | |
277 | ||
278 | /* Define to 1 if you have the `waitpid' function. */ | |
279 | #define HAVE_WAITPID 1 | |
280 | ||
281 | /* Define to 1 if `fork' works. */ | |
282 | #define HAVE_WORKING_FORK 1 | |
283 | ||
284 | /* Define to 1 if `vfork' works. */ | |
285 | #define HAVE_WORKING_VFORK 1 | |
286 | ||
287 | /* Build host information. (not used by kmk) */ | |
288 | #define MAKE_HOST "i586-pc-haiku" | |
289 | ||
290 | /* Define to 1 to enable job server support in GNU make. */ | |
291 | #define MAKE_JOBSERVER 1 | |
292 | ||
293 | /* Define to 1 to enable symbolic link timestamp checking. */ | |
294 | #define MAKE_SYMLINKS 1 | |
295 | ||
296 | /* Define to 1 if your `struct nlist' has an `n_un' member. Obsolete, depend | |
297 | on `HAVE_STRUCT_NLIST_N_UN_N_NAME */ | |
298 | /* #undef NLIST_NAME_UNION */ | |
299 | ||
300 | /* Define to 1 if struct nlist.n_name is a pointer rather than an array. */ | |
301 | /* #undef NLIST_STRUCT */ | |
302 | ||
303 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ | |
304 | /* #undef NO_MINUS_C_MINUS_O */ | |
305 | ||
306 | /* Name of package */ | |
307 | #define PACKAGE "make" | |
308 | ||
309 | /* Define to the address where bug reports for this package should be sent. */ | |
310 | #define PACKAGE_BUGREPORT "bug-make@gnu.org" | |
311 | ||
312 | /* Define to the full name of this package. */ | |
313 | #define PACKAGE_NAME "GNU make" | |
314 | ||
315 | /* Define to the full name and version of this package. */ | |
316 | #define PACKAGE_STRING "GNU make 3.81.90" | |
317 | ||
318 | /* Define to the one symbol short name of this package. */ | |
319 | #define PACKAGE_TARNAME "make" | |
320 | ||
321 | /* Define to the home page for this package. */ | |
322 | #define PACKAGE_URL "http://www.gnu.org/software/make/" | |
323 | ||
324 | /* Define to the version of this package. */ | |
325 | #define PACKAGE_VERSION "3.81.90" | |
326 | ||
327 | /* Define to the character that separates directories in PATH. */ | |
328 | #define PATH_SEPARATOR_CHAR ':' | |
329 | ||
330 | /* Define as the return type of signal handlers (`int' or `void'). */ | |
331 | #define RETSIGTYPE void | |
332 | ||
333 | /* Define to the name of the SCCS 'get' command. */ | |
334 | #define SCCS_GET "get" | |
335 | ||
336 | /* Define to 1 if the SCCS 'get' command understands the '-G<file>' option. */ | |
337 | /* #undef SCCS_GET_MINUS_G */ | |
338 | ||
339 | /* If using the C implementation of alloca, define if you know the | |
340 | direction of stack growth for your system; otherwise it will be | |
341 | automatically deduced at runtime. | |
342 | STACK_DIRECTION > 0 => grows toward higher addresses | |
343 | STACK_DIRECTION < 0 => grows toward lower addresses | |
344 | STACK_DIRECTION = 0 => direction of growth unknown */ | |
345 | /* #undef STACK_DIRECTION */ | |
346 | ||
347 | /* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ | |
348 | /* #undef STAT_MACROS_BROKEN */ | |
349 | ||
350 | /* Define to 1 if you have the ANSI C header files. */ | |
351 | #define STDC_HEADERS 1 | |
352 | ||
353 | /* Define if struct stat contains a nanoseconds field */ | |
354 | #define ST_MTIM_NSEC tv_nsec | |
355 | ||
356 | /* Define to 1 on System V Release 4. */ | |
357 | /* #undef SVR4 */ | |
358 | ||
359 | /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ | |
360 | #define TIME_WITH_SYS_TIME 1 | |
361 | ||
362 | /* Define to 1 for Encore UMAX. */ | |
363 | /* #undef UMAX */ | |
364 | ||
365 | /* Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h> instead of | |
366 | <sys/cpustats.h>. */ | |
367 | /* #undef UMAX4_3 */ | |
368 | ||
369 | /* Enable extensions on AIX 3, Interix. */ | |
370 | #ifndef _ALL_SOURCE | |
371 | # define _ALL_SOURCE 1 | |
372 | #endif | |
373 | /* Enable GNU extensions on systems that have them. */ | |
374 | #ifndef _GNU_SOURCE | |
375 | # define _GNU_SOURCE 1 | |
376 | #endif | |
377 | /* Enable threading extensions on Solaris. */ | |
378 | #ifndef _POSIX_PTHREAD_SEMANTICS | |
379 | # define _POSIX_PTHREAD_SEMANTICS 1 | |
380 | #endif | |
381 | /* Enable extensions on HP NonStop. */ | |
382 | #ifndef _TANDEM_SOURCE | |
383 | # define _TANDEM_SOURCE 1 | |
384 | #endif | |
385 | /* Enable general extensions on Solaris. */ | |
386 | #ifndef __EXTENSIONS__ | |
387 | # define __EXTENSIONS__ 1 | |
388 | #endif | |
389 | ||
390 | ||
391 | /* Version number of package */ | |
392 | #define VERSION "3.81.90" | |
393 | ||
394 | /* Use platform specific coding */ | |
395 | /* #undef WINDOWS32 */ | |
396 | ||
397 | /* Define if using the dmalloc debugging malloc package */ | |
398 | /* #undef WITH_DMALLOC */ | |
399 | ||
400 | /* Number of bits in a file offset, on hosts where this is settable. */ | |
401 | /* #undef _FILE_OFFSET_BITS */ | |
402 | ||
403 | /* Define for large files, on AIX-style hosts. */ | |
404 | /* #undef _LARGE_FILES */ | |
405 | ||
406 | /* Define to 1 if on MINIX. */ | |
407 | /* #undef _MINIX */ | |
408 | ||
409 | /* Define to 2 if the system does not provide POSIX.1 features except with | |
410 | this defined. */ | |
411 | /* #undef _POSIX_1_SOURCE */ | |
412 | ||
413 | /* Define to 1 if you need to in order for `stat' and other things to work. */ | |
414 | /* #undef _POSIX_SOURCE */ | |
415 | ||
416 | /* Define to empty if `const' does not conform to ANSI C. */ | |
417 | /* #undef const */ | |
418 | ||
419 | /* Define to `int' if <sys/types.h> doesn't define. */ | |
420 | /* #undef gid_t */ | |
421 | ||
422 | /* Define to `int' if <sys/types.h> does not define. */ | |
423 | /* #undef pid_t */ | |
424 | ||
425 | /* Define to `unsigned int' if <sys/types.h> does not define. */ | |
426 | /* #undef size_t */ | |
427 | ||
428 | /* Define to `int' if <sys/types.h> doesn't define. */ | |
429 | /* #undef uid_t */ | |
430 | ||
431 | /* Define uintmax_t if not defined in <stdint.h> or <inttypes.h>. */ | |
432 | /* #undef uintmax_t */ | |
433 | ||
434 | /* Define as `fork' if `vfork' does not work. */ | |
435 | /* #undef vfork */ | |
436 | ||
437 | #include "inlined_memchr.h" |
1107 | 1107 | |
1108 | 1108 | #ifdef CONFIG_WITH_VALUE_LENGTH |
1109 | 1109 | /* Handle the most common case in allocated_variable_expand_for_file |
1110 | specially and provide some additional string lenght features. */ | |
1110 | specially and provide some additional string length features. */ | |
1111 | 1111 | |
1112 | 1112 | char * |
1113 | 1113 | allocated_variable_expand_2 (const char *line, unsigned int length, |
0 | 0 | #ifdef CONFIG_WITH_IF_CONDITIONALS |
1 | /* $Id: expreval.c 2413 2010-09-11 17:43:04Z bird $ */ | |
1 | /* $Id: expreval.c 2573 2012-05-13 19:39:47Z bird $ */ | |
2 | 2 | /** @file |
3 | 3 | * expreval - Expressions evaluator, C / BSD make / nmake style. |
4 | 4 | */ |
1978 | 1978 | */ |
1979 | 1979 | do rc = expr_get_unary_or_operand(pThis); |
1980 | 1980 | while (rc == kExprRet_Operator); |
1981 | if (rc < kExprRet_Error) | |
1981 | if (rc < kExprRet_Ok) | |
1982 | 1982 | break; |
1983 | 1983 | |
1984 | 1984 | /* |
1985 | 1985 | * Look for a binary operator, right parenthesis or end of expression. |
1986 | 1986 | */ |
1987 | 1987 | rc = expr_get_binary_or_eoe_or_rparen(pThis); |
1988 | if (rc < kExprRet_Error) | |
1988 | if (rc < kExprRet_Ok) | |
1989 | 1989 | break; |
1990 | 1990 | expr_unget_op(pThis); |
1991 | 1991 | |
2001 | 2001 | pOp = pThis->apOps[pThis->iOp--]; |
2002 | 2002 | assert(pThis->iVar + 1 >= pOp->cArgs); |
2003 | 2003 | rc = pOp->pfn(pThis); |
2004 | if (rc < kExprRet_Error) | |
2004 | if (rc < kExprRet_Ok) | |
2005 | 2005 | break; |
2006 | 2006 | } |
2007 | if (rc < kExprRet_Error) | |
2007 | if (rc < kExprRet_Ok) | |
2008 | 2008 | break; |
2009 | 2009 | |
2010 | 2010 | /* |
2012 | 2012 | * There should be no right parenthesis here. |
2013 | 2013 | */ |
2014 | 2014 | rc = expr_get_binary_or_eoe_or_rparen(pThis); |
2015 | if (rc < kExprRet_Error) | |
2015 | if (rc < kExprRet_Ok) | |
2016 | 2016 | break; |
2017 | 2017 | pOp = pThis->apOps[pThis->iOp]; |
2018 | 2018 | if (!pOp->iPrecedence) |
75 | 75 | # define QHINF_MAPSEL 8 /* NE only */ |
76 | 76 | extern APIRET APIENTRY DosQueryHeaderInfo(HMODULE hmod, ULONG ulIndex, PVOID pvBuffer, ULONG cbBuffer, ULONG ulSubFunction); |
77 | 77 | #endif /* CONFIG_WITH_OS2_LIBPATH */ |
78 | ||
79 | #ifdef KMK | |
80 | /** Checks if the @a_cch characters (bytes) in @a a_psz equals @a a_szConst. */ | |
81 | # define STR_N_EQUALS(a_psz, a_cch, a_szConst) \ | |
82 | ( (a_cch) == sizeof (a_szConst) - 1 && !strncmp ((a_psz), (a_szConst), sizeof (a_szConst) - 1) ) | |
83 | #endif | |
78 | 84 | |
79 | 85 | |
80 | 86 | struct function_table_entry |
5219 | 5225 | return o; |
5220 | 5226 | } |
5221 | 5227 | #endif /* CONFIG_WITH_COMMANDS_FUNC */ |
5222 | ||
5223 | 5228 | #ifdef KMK |
5229 | ||
5224 | 5230 | /* Useful when debugging kmk and/or makefiles. */ |
5225 | 5231 | char * |
5226 | 5232 | func_breakpoint (char *o, char **argv UNUSED, const char *funcname UNUSED) |
5229 | 5235 | __debugbreak(); |
5230 | 5236 | #elif defined(__i386__) || defined(__x86__) || defined(__X86__) || defined(_M_IX86) || defined(__i386) \ |
5231 | 5237 | || defined(__amd64__) || defined(__x86_64__) || defined(__AMD64__) || defined(_M_X64) || defined(__amd64) |
5238 | # ifdef __sun__ | |
5239 | __asm__ __volatile__ ("int $3\n\t"); | |
5240 | # else | |
5232 | 5241 | __asm__ __volatile__ ("int3\n\t"); |
5242 | # endif | |
5233 | 5243 | #else |
5234 | 5244 | char *p = (char *)0; |
5235 | 5245 | *p = '\0'; |
5236 | 5246 | #endif |
5237 | 5247 | return o; |
5238 | 5248 | } |
5249 | ||
5250 | /* umask | umask -S. */ | |
5251 | char * | |
5252 | func_get_umask (char *o, char **argv UNUSED, const char *funcname UNUSED) | |
5253 | { | |
5254 | char sz[80]; | |
5255 | int off; | |
5256 | mode_t u; | |
5257 | int symbolic = 0; | |
5258 | const char *psz = argv[0]; | |
5259 | ||
5260 | if (psz) | |
5261 | { | |
5262 | const char *pszEnd = strchr (psz, '\0'); | |
5263 | strip_whitespace (&psz, &pszEnd); | |
5264 | ||
5265 | if (pszEnd != psz) | |
5266 | { | |
5267 | if ( STR_N_EQUALS (psz, pszEnd - pszEnd, "S") | |
5268 | || STR_N_EQUALS (psz, pszEnd - pszEnd, "-S") | |
5269 | || STR_N_EQUALS (psz, pszEnd - pszEnd, "symbolic") ) | |
5270 | symbolic = 1; | |
5271 | else | |
5272 | error (reading_file, _("$(%s ) invalid argument `%s'"), | |
5273 | funcname, argv[0]); | |
5274 | } | |
5275 | } | |
5276 | ||
5277 | u = umask (002); | |
5278 | umask (u); | |
5279 | ||
5280 | if (symbolic) | |
5281 | { | |
5282 | off = 0; | |
5283 | sz[off++] = 'u'; | |
5284 | sz[off++] = '='; | |
5285 | if ((u & S_IRUSR) == 0) | |
5286 | sz[off++] = 'r'; | |
5287 | if ((u & S_IWUSR) == 0) | |
5288 | sz[off++] = 'w'; | |
5289 | if ((u & S_IXUSR) == 0) | |
5290 | sz[off++] = 'x'; | |
5291 | sz[off++] = ','; | |
5292 | sz[off++] = 'g'; | |
5293 | sz[off++] = '='; | |
5294 | if ((u & S_IRGRP) == 0) | |
5295 | sz[off++] = 'r'; | |
5296 | if ((u & S_IWGRP) == 0) | |
5297 | sz[off++] = 'w'; | |
5298 | if ((u & S_IXGRP) == 0) | |
5299 | sz[off++] = 'x'; | |
5300 | sz[off++] = ','; | |
5301 | sz[off++] = 'o'; | |
5302 | sz[off++] = '='; | |
5303 | if ((u & S_IROTH) == 0) | |
5304 | sz[off++] = 'r'; | |
5305 | if ((u & S_IWOTH) == 0) | |
5306 | sz[off++] = 'w'; | |
5307 | if ((u & S_IXOTH) == 0) | |
5308 | sz[off++] = 'x'; | |
5309 | } | |
5310 | else | |
5311 | off = sprintf (sz, "%.4o", u); | |
5312 | ||
5313 | return variable_buffer_output (o, sz, off); | |
5314 | } | |
5315 | ||
5316 | ||
5317 | /* umask 0002 | umask u=rwx,g=rwx,o=rx. */ | |
5318 | char * | |
5319 | func_set_umask (char *o, char **argv UNUSED, const char *funcname UNUSED) | |
5320 | { | |
5321 | mode_t u; | |
5322 | const char *psz; | |
5323 | ||
5324 | /* Figure what kind of input this is. */ | |
5325 | psz = argv[0]; | |
5326 | while (isblank ((unsigned char)*psz)) | |
5327 | psz++; | |
5328 | ||
5329 | if (isdigit ((unsigned char)*psz)) | |
5330 | { | |
5331 | u = 0; | |
5332 | while (*psz) | |
5333 | { | |
5334 | u <<= 3; | |
5335 | if (*psz < '0' || *psz >= '8') | |
5336 | { | |
5337 | error (reading_file, _("$(%s ) illegal number `%s'"), funcname, argv[0]); | |
5338 | break; | |
5339 | } | |
5340 | u += *psz - '0'; | |
5341 | psz++; | |
5342 | } | |
5343 | ||
5344 | if (argv[1] != NULL) | |
5345 | error (reading_file, _("$(%s ) too many arguments for octal mode"), funcname); | |
5346 | } | |
5347 | else | |
5348 | { | |
5349 | u = umask(0); | |
5350 | umask(u); | |
5351 | error (reading_file, _("$(%s ) symbol mode is not implemented"), funcname); | |
5352 | } | |
5353 | ||
5354 | umask(u); | |
5355 | ||
5356 | return o; | |
5357 | } | |
5358 | ||
5239 | 5359 | #endif /* KMK */ |
5240 | 5360 | |
5241 | 5361 | |
5425 | 5545 | #endif |
5426 | 5546 | #ifdef KMK |
5427 | 5547 | { STRING_SIZE_TUPLE("breakpoint"), 0, 0, 0, func_breakpoint}, |
5548 | { STRING_SIZE_TUPLE("set-umask"), 1, 3, 1, func_set_umask}, | |
5549 | { STRING_SIZE_TUPLE("get-umask"), 0, 0, 0, func_get_umask}, | |
5428 | 5550 | #endif |
5429 | 5551 | }; |
5430 | 5552 |
0 | 0 | #ifdef CONFIG_WITH_INCLUDEDEP |
1 | /* $Id: incdep.c 2413 2010-09-11 17:43:04Z bird $ */ | |
1 | /* $Id: incdep.c 2546 2011-10-01 19:49:54Z bird $ */ | |
2 | 2 | /** @file |
3 | 3 | * incdep - Simple dependency files. |
4 | 4 | */ |
634 | 634 | |
635 | 635 | #elif defined(__APPLE__) \ |
636 | 636 | || defined(__sun__) || defined(__SunOS__) || defined(__sun) || defined(__SunOS) \ |
637 | || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) | |
637 | || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) \ | |
638 | || defined(__HAIKU__) | |
638 | 639 | /* No broken preload libraries known to be in common use on these platforms... */ |
639 | 640 | |
640 | 641 | #elif defined(_MSC_VER) || defined(_WIN32) || defined(__OS2__) |
590 | 590 | pid = WAIT_NOHANG (&status); |
591 | 591 | else |
592 | 592 | #endif |
593 | pid = wait (&status); | |
593 | EINTRLOOP(pid, wait (&status)); | |
594 | 594 | #endif /* !VMS */ |
595 | 595 | } |
596 | 596 | else |
2052 | 2052 | static int |
2053 | 2053 | load_too_high (void) |
2054 | 2054 | { |
2055 | #if defined(__MSDOS__) || defined(VMS) || defined(_AMIGA) || defined(__riscos__) | |
2055 | #if defined(__MSDOS__) || defined(VMS) || defined(_AMIGA) || defined(__riscos__) || defined(__HAIKU__) | |
2056 | 2056 | return 1; |
2057 | 2057 | #else |
2058 | 2058 | static double last_sec; |
0 | /* $Id: kbuild-read.c 2549 2011-11-09 01:22:04Z bird $ */ | |
1 | /** @file | |
2 | * kBuild specific make functionality related to read.c. | |
3 | */ | |
4 | ||
5 | /* | |
6 | * Copyright (c) 2011 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | * | |
8 | * This file is part of kBuild. | |
9 | * | |
10 | * kBuild is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; either version 3 of the License, or | |
13 | * (at your option) any later version. | |
14 | * | |
15 | * kBuild is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with kBuild. If not, see <http://www.gnu.org/licenses/> | |
22 | * | |
23 | */ | |
24 | ||
25 | /* No GNU coding style here! */ | |
26 | ||
27 | /******************************************************************************* | |
28 | * Header Files * | |
29 | *******************************************************************************/ | |
30 | #include "make.h" | |
31 | #include "filedef.h" | |
32 | #include "variable.h" | |
33 | #include "dep.h" | |
34 | #include "debug.h" | |
35 | #include "kbuild.h" | |
36 | ||
37 | #include <assert.h> | |
38 | ||
39 | ||
40 | /******************************************************************************* | |
41 | * Defined Constants And Macros * | |
42 | *******************************************************************************/ | |
43 | #define WORD_IS(a_pszWord, a_cchWord, a_szWord2) \ | |
44 | ( (a_cchWord) == sizeof(a_szWord2) - 1 && memcmp((a_pszWord), a_szWord2, sizeof(a_szWord2) - 1) == 0) | |
45 | ||
46 | ||
47 | /******************************************************************************* | |
48 | * Structures and Typedefs * | |
49 | *******************************************************************************/ | |
50 | /** Indicate which kind of kBuild define we're working on. */ | |
51 | enum kBuildDef | |
52 | { | |
53 | kBuildDef_Invalid, | |
54 | kBuildDef_Target, | |
55 | kBuildDef_Template, | |
56 | kBuildDef_Tool, | |
57 | kBuildDef_Sdk, | |
58 | kBuildDef_Unit | |
59 | }; | |
60 | ||
61 | enum kBuildExtendBy | |
62 | { | |
63 | kBuildExtendBy_NoParent, | |
64 | kBuildExtendBy_Overriding, | |
65 | kBuildExtendBy_Appending, | |
66 | kBuildExtendBy_Prepending | |
67 | }; | |
68 | ||
69 | ||
70 | /** | |
71 | * The data we stack during eval. | |
72 | */ | |
73 | struct kbuild_eval_data | |
74 | { | |
75 | /** The kind of define. */ | |
76 | enum kBuildDef enmKind; | |
77 | /** The bare name of the define. */ | |
78 | char *pszName; | |
79 | /** The file location where this define was declared. */ | |
80 | struct floc FileLoc; | |
81 | ||
82 | /** Pointer to the next element in the global list. */ | |
83 | struct kbuild_eval_data *pGlobalNext; | |
84 | /** Pointer to the element below us on the stack. */ | |
85 | struct kbuild_eval_data *pStackDown; | |
86 | ||
87 | /** The variable set associated with this define. */ | |
88 | struct variable_set_list *pVariables; | |
89 | /** The saved current variable set, for restoring in kBuild-endef. */ | |
90 | struct variable_set_list *pVariablesSaved; | |
91 | ||
92 | /** The parent name, NULL if none. */ | |
93 | char *pszParent; | |
94 | /** The inheritance method. */ | |
95 | enum kBuildExtendBy enmExtendBy; | |
96 | /** Pointer to the parent. Resolved lazily, so it can be NULL even if we have | |
97 | * a parent. */ | |
98 | struct kbuild_eval_data *pParent; | |
99 | ||
100 | /** The template, NULL if none. Only applicable to targets. */ | |
101 | char *pszTemplate; | |
102 | /** Pointer to the template. Resolved lazily, so it can be NULL even if we have | |
103 | * a parent. */ | |
104 | struct kbuild_eval_data *pTemplate; | |
105 | ||
106 | /** The variable prefix. */ | |
107 | char *pszVarPrefix; | |
108 | /** The length of the variable prefix. */ | |
109 | size_t cchVarPrefix; | |
110 | }; | |
111 | ||
112 | ||
113 | /******************************************************************************* | |
114 | * Header Files * | |
115 | *******************************************************************************/ | |
116 | /** Linked list (LIFO) of kBuild defines. | |
117 | * @todo use a hash! */ | |
118 | struct kbuild_eval_data *g_pHeadKbDefs = NULL; | |
119 | /** Stack of kBuild defines. */ | |
120 | struct kbuild_eval_data *g_pTopKbDef = NULL; | |
121 | ||
122 | ||
123 | struct variable_set * | |
124 | get_top_kbuild_variable_set(void) | |
125 | { | |
126 | struct kbuild_eval_data *pTop = g_pTopKbDef; | |
127 | assert(pTop != NULL); | |
128 | return pTop->pVariables->set; | |
129 | } | |
130 | ||
131 | ||
132 | char * | |
133 | kbuild_prefix_variable(const char *pszName, unsigned int *pcchName) | |
134 | { | |
135 | struct kbuild_eval_data *pTop = g_pTopKbDef; | |
136 | char *pszPrefixed; | |
137 | unsigned int cchPrefixed; | |
138 | ||
139 | assert(pTop != NULL); | |
140 | ||
141 | cchPrefixed = pTop->cchVarPrefix + *pcchName; | |
142 | pszPrefixed = xmalloc(cchPrefixed + 1); | |
143 | memcpy(pszPrefixed, pTop->pszVarPrefix, pTop->cchVarPrefix); | |
144 | memcpy(&pszPrefixed[pTop->cchVarPrefix], pszName, *pcchName); | |
145 | pszPrefixed[cchPrefixed] = '\0'; | |
146 | *pcchName = cchPrefixed; | |
147 | return pszPrefixed; | |
148 | } | |
149 | ||
150 | ||
151 | static const char * | |
152 | eval_kbuild_kind_to_string(enum kBuildDef enmKind) | |
153 | { | |
154 | switch (enmKind) | |
155 | { | |
156 | case kBuildDef_Target: return "target"; | |
157 | case kBuildDef_Template: return "template"; | |
158 | case kBuildDef_Tool: return "tool"; | |
159 | case kBuildDef_Sdk: return "sdk"; | |
160 | case kBuildDef_Unit: return "unit"; | |
161 | default: | |
162 | case kBuildDef_Invalid: return "invalid"; | |
163 | } | |
164 | } | |
165 | ||
166 | static char * | |
167 | allocate_expanded_next_token(const char **ppszCursor, const char *pszEos, unsigned int *pcchToken, int fStrip) | |
168 | { | |
169 | unsigned int cchToken; | |
170 | char *pszToken = find_next_token_eos(ppszCursor, pszEos, &cchToken); | |
171 | if (pszToken) | |
172 | { | |
173 | pszToken = allocated_variable_expand_2(pszToken, cchToken, &cchToken); | |
174 | if (pszToken) | |
175 | { | |
176 | if (fStrip) | |
177 | { | |
178 | unsigned int off = 0; | |
179 | while (MY_IS_BLANK(pszToken[off])) | |
180 | off++; | |
181 | if (off) | |
182 | { | |
183 | cchToken -= off; | |
184 | memmove(pszToken, &pszToken[off], cchToken + 1); | |
185 | } | |
186 | ||
187 | while (cchToken > 0 && MY_IS_BLANK(pszToken[cchToken - 1])) | |
188 | pszToken[--cchToken] = '\0'; | |
189 | } | |
190 | ||
191 | assert(cchToken == strlen(pszToken)); | |
192 | if (pcchToken) | |
193 | *pcchToken = cchToken; | |
194 | } | |
195 | } | |
196 | return pszToken; | |
197 | } | |
198 | ||
199 | static struct kbuild_eval_data * | |
200 | eval_kbuild_resolve_parent(struct kbuild_eval_data *pData) | |
201 | { | |
202 | if ( !pData->pParent | |
203 | && pData->pszParent) | |
204 | { | |
205 | struct kbuild_eval_data *pCur = g_pHeadKbDefs; | |
206 | while (pCur) | |
207 | { | |
208 | if ( pCur->enmKind == pData->enmKind | |
209 | && !strcmp(pCur->pszName, pData->pszParent)) | |
210 | { | |
211 | if ( pCur->pszParent | |
212 | && ( pCur->pParent == pData | |
213 | || !strcmp(pCur->pszParent, pData->pszName)) ) | |
214 | fatal(&pData->FileLoc, _("'%s' and '%s' are both trying to be each other children..."), | |
215 | pData->pszName, pCur->pszName); | |
216 | ||
217 | pData->pParent = pCur; | |
218 | pData->pVariables->next = pData->pVariables; | |
219 | break; | |
220 | } | |
221 | pCur = pCur->pGlobalNext; | |
222 | } | |
223 | } | |
224 | return pData->pParent; | |
225 | } | |
226 | ||
227 | static int | |
228 | eval_kbuild_define_xxxx(struct kbuild_eval_data **ppData, const struct floc *pFileLoc, | |
229 | const char *pszLine, const char *pszEos, int fIgnoring, enum kBuildDef enmKind) | |
230 | { | |
231 | unsigned int cch; | |
232 | unsigned int cchName; | |
233 | char ch; | |
234 | char *psz; | |
235 | const char *pszPrefix; | |
236 | struct kbuild_eval_data *pData; | |
237 | ||
238 | if (fIgnoring) | |
239 | return 0; | |
240 | ||
241 | /* | |
242 | * Create a new kBuild eval data item. | |
243 | */ | |
244 | pData = xmalloc(sizeof(*pData)); | |
245 | pData->enmKind = enmKind; | |
246 | pData->pszName = NULL; | |
247 | pData->FileLoc = *pFileLoc; | |
248 | ||
249 | pData->pGlobalNext = g_pHeadKbDefs; | |
250 | g_pHeadKbDefs = pData; | |
251 | ||
252 | pData->pStackDown = *ppData; | |
253 | *ppData = g_pTopKbDef = pData; | |
254 | pData->pVariables = create_new_variable_set(); | |
255 | pData->pVariablesSaved = NULL; | |
256 | ||
257 | pData->pszParent = NULL; | |
258 | pData->enmExtendBy = kBuildExtendBy_NoParent; | |
259 | pData->pParent = NULL; | |
260 | ||
261 | pData->pszTemplate = NULL; | |
262 | pData->pTemplate = NULL; | |
263 | ||
264 | pData->pszVarPrefix = NULL; | |
265 | pData->cchVarPrefix = 0; | |
266 | ||
267 | /* | |
268 | * The first word is the name. | |
269 | */ | |
270 | pData->pszName = allocate_expanded_next_token(&pszLine, pszEos, &cchName, 1 /*strip*/); | |
271 | if (!pData->pszName || !*pData->pszName) | |
272 | fatal(pFileLoc, _("The kBuild define requires a name")); | |
273 | ||
274 | psz = pData->pszName; | |
275 | while ((ch = *psz++) != '\0') | |
276 | if (!isgraph(ch)) | |
277 | { | |
278 | error(pFileLoc, _("The 'kBuild-define-%s' name '%s' contains one or more invalid characters"), | |
279 | eval_kbuild_kind_to_string(enmKind), pData->pszName); | |
280 | break; | |
281 | } | |
282 | ||
283 | /* | |
284 | * Parse subsequent words. | |
285 | */ | |
286 | psz = find_next_token_eos(&pszLine, pszEos, &cch); | |
287 | while (psz) | |
288 | { | |
289 | if (WORD_IS(psz, cch, "extending")) | |
290 | { | |
291 | /* Inheritance directive. */ | |
292 | if (pData->pszParent != NULL) | |
293 | fatal(pFileLoc, _("'extending' can only occure once")); | |
294 | pData->pszParent = allocate_expanded_next_token(&pszLine, pszEos, &cch, 1 /*strip*/); | |
295 | if (!pData->pszParent || !*pData->pszParent) | |
296 | fatal(pFileLoc, _("'extending' requires a parent name")); | |
297 | ||
298 | pData->enmExtendBy = kBuildExtendBy_Overriding; | |
299 | ||
300 | /* optionally 'by overriding|prepending|appending' */ | |
301 | psz = find_next_token_eos(&pszLine, pszEos, &cch); | |
302 | if (psz && WORD_IS(psz, cch, "by")) | |
303 | { | |
304 | cch = 0; | |
305 | psz = find_next_token_eos(&pszLine, pszEos, &cch); | |
306 | if (WORD_IS(psz, cch, "overriding")) | |
307 | pData->enmExtendBy = kBuildExtendBy_Overriding; | |
308 | else if (WORD_IS(psz, cch, "appending")) | |
309 | pData->enmExtendBy = kBuildExtendBy_Appending; | |
310 | else if (WORD_IS(psz, cch, "prepending")) | |
311 | pData->enmExtendBy = kBuildExtendBy_Prepending; | |
312 | else | |
313 | fatal(pFileLoc, _("Unknown 'extending by' method '%.*s'"), (int)cch, psz); | |
314 | ||
315 | /* next token */ | |
316 | psz = find_next_token_eos(&pszLine, pszEos, &cch); | |
317 | } | |
318 | } | |
319 | else if (WORD_IS(psz, cch, "using")) | |
320 | { | |
321 | /* Template directive. */ | |
322 | if (enmKind != kBuildDef_Tool) | |
323 | fatal(pFileLoc, _("'using <template>' can only be used with 'kBuild-define-target'")); | |
324 | if (pData->pszTemplate != NULL) | |
325 | fatal(pFileLoc, _("'using' can only occure once")); | |
326 | ||
327 | pData->pszTemplate = allocate_expanded_next_token(&pszLine, pszEos, &cch, 1 /*fStrip*/); | |
328 | if (!pData->pszTemplate || !*pData->pszTemplate) | |
329 | fatal(pFileLoc, _("'using' requires a template name")); | |
330 | ||
331 | /* next token */ | |
332 | psz = find_next_token_eos(&pszLine, pszEos, &cch); | |
333 | } | |
334 | else | |
335 | fatal(pFileLoc, _("Don't know what '%.*s' means"), (int)cch, psz); | |
336 | } | |
337 | ||
338 | /* | |
339 | * Calc the variable prefix. | |
340 | */ | |
341 | switch (enmKind) | |
342 | { | |
343 | case kBuildDef_Target: pszPrefix = ""; break; | |
344 | case kBuildDef_Template: pszPrefix = "TEMPLATE_"; break; | |
345 | case kBuildDef_Tool: pszPrefix = "TOOL_"; break; | |
346 | case kBuildDef_Sdk: pszPrefix = "SDK_"; break; | |
347 | case kBuildDef_Unit: pszPrefix = "UNIT_"; break; | |
348 | default: | |
349 | fatal(pFileLoc, _("enmKind=%d"), enmKind); | |
350 | return -1; | |
351 | } | |
352 | cch = strlen(pszPrefix); | |
353 | pData->cchVarPrefix = cch + cchName; | |
354 | pData->pszVarPrefix = xmalloc(pData->cchVarPrefix + 1); | |
355 | memcpy(pData->pszVarPrefix, pszPrefix, cch); | |
356 | memcpy(&pData->pszVarPrefix[cch], pData->pszName, cchName); | |
357 | ||
358 | /* | |
359 | * Try resolve the parent and change the current variable set. | |
360 | */ | |
361 | eval_kbuild_resolve_parent(pData); | |
362 | pData->pVariablesSaved = current_variable_set_list; | |
363 | current_variable_set_list = pData->pVariables; | |
364 | ||
365 | return 0; | |
366 | } | |
367 | ||
368 | static int | |
369 | eval_kbuild_endef_xxxx(struct kbuild_eval_data **ppData, const struct floc *pFileLoc, | |
370 | const char *pszLine, const char *pszEos, int fIgnoring, enum kBuildDef enmKind) | |
371 | { | |
372 | struct kbuild_eval_data *pData; | |
373 | unsigned int cchName; | |
374 | char *pszName; | |
375 | ||
376 | if (fIgnoring) | |
377 | return 0; | |
378 | ||
379 | /* | |
380 | * Is there something to pop? | |
381 | */ | |
382 | pData = *ppData; | |
383 | if (!pData) | |
384 | { | |
385 | error(pFileLoc, _("kBuild-endef-%s is missing kBuild-define-%s"), | |
386 | eval_kbuild_kind_to_string(enmKind), eval_kbuild_kind_to_string(enmKind)); | |
387 | return 0; | |
388 | } | |
389 | ||
390 | /* | |
391 | * ... and does it have a matching kind? | |
392 | */ | |
393 | if (pData->enmKind != enmKind) | |
394 | error(pFileLoc, _("'kBuild-endef-%s' does not match 'kBuild-define-%s %s'"), | |
395 | eval_kbuild_kind_to_string(enmKind), eval_kbuild_kind_to_string(pData->enmKind), pData->pszName); | |
396 | ||
397 | /* | |
398 | * The endef-kbuild may optionally be followed by the target name. | |
399 | * It should match the name given to the kBuild-define. | |
400 | */ | |
401 | pszName = allocate_expanded_next_token(&pszLine, pszEos, &cchName, 1 /*fStrip*/); | |
402 | if (pszName) | |
403 | { | |
404 | if (strcmp(pszName, pData->pszName)) | |
405 | error(pFileLoc, _("'kBuild-endef-%s %s' does not match 'kBuild-define-%s %s'"), | |
406 | eval_kbuild_kind_to_string(enmKind), pszName, | |
407 | eval_kbuild_kind_to_string(pData->enmKind), pData->pszName); | |
408 | free(pszName); | |
409 | } | |
410 | ||
411 | /* | |
412 | * Pop a define off the stack. | |
413 | */ | |
414 | assert(pData == g_pTopKbDef); | |
415 | *ppData = g_pTopKbDef = pData->pStackDown; | |
416 | pData->pStackDown = NULL; | |
417 | current_variable_set_list = pData->pVariablesSaved; | |
418 | pData->pVariablesSaved = NULL; | |
419 | ||
420 | return 0; | |
421 | } | |
422 | ||
423 | int eval_kbuild_define(struct kbuild_eval_data **kdata, const struct floc *flocp, | |
424 | const char *word, unsigned int wlen, const char *line, const char *eos, int ignoring) | |
425 | { | |
426 | assert(memcmp(word, "kBuild-define", sizeof("kBuild-define") - 1) == 0); | |
427 | word += sizeof("kBuild-define") - 1; | |
428 | wlen -= sizeof("kBuild-define") - 1; | |
429 | if ( wlen > 1 | |
430 | && word[0] == '-') | |
431 | { | |
432 | if (WORD_IS(word, wlen, "-target")) | |
433 | return eval_kbuild_define_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Target); | |
434 | if (WORD_IS(word, wlen, "-template")) | |
435 | return eval_kbuild_define_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Template); | |
436 | if (WORD_IS(word, wlen, "-tool")) | |
437 | return eval_kbuild_define_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Tool); | |
438 | if (WORD_IS(word, wlen, "-sdk")) | |
439 | return eval_kbuild_define_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Sdk); | |
440 | if (WORD_IS(word, wlen, "-unit")) | |
441 | return eval_kbuild_define_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Unit); | |
442 | } | |
443 | ||
444 | error(flocp, _("Unknown syntax 'kBuild-define%.*s'"), (int)wlen, word); | |
445 | return 0; | |
446 | } | |
447 | ||
448 | int eval_kbuild_endef(struct kbuild_eval_data **kdata, const struct floc *flocp, | |
449 | const char *word, unsigned int wlen, const char *line, const char *eos, int ignoring) | |
450 | { | |
451 | assert(memcmp(word, "kBuild-endef", sizeof("kBuild-endef") - 1) == 0); | |
452 | word += sizeof("kBuild-endef") - 1; | |
453 | wlen -= sizeof("kBuild-endef") - 1; | |
454 | if ( wlen > 1 | |
455 | && word[0] == '-') | |
456 | { | |
457 | if (WORD_IS(word, wlen, "-target")) | |
458 | return eval_kbuild_endef_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Target); | |
459 | if (WORD_IS(word, wlen, "-template")) | |
460 | return eval_kbuild_endef_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Template); | |
461 | if (WORD_IS(word, wlen, "-tool")) | |
462 | return eval_kbuild_endef_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Tool); | |
463 | if (WORD_IS(word, wlen, "-sdk")) | |
464 | return eval_kbuild_endef_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Sdk); | |
465 | if (WORD_IS(word, wlen, "-unit")) | |
466 | return eval_kbuild_endef_xxxx(kdata, flocp, line, eos, ignoring, kBuildDef_Unit); | |
467 | } | |
468 | ||
469 | error(flocp, _("Unknown syntax 'kBuild-endef%.*s'"), (int)wlen, word); | |
470 | return 0; | |
471 | } | |
472 | ||
473 | void print_kbuild_data_base(void) | |
474 | { | |
475 | struct kbuild_eval_data *pCur; | |
476 | ||
477 | puts(_("\n# kBuild defines")); | |
478 | ||
479 | for (pCur = g_pHeadKbDefs; pCur; pCur = pCur->pGlobalNext) | |
480 | { | |
481 | printf("\nkBuild-define-%s %s", | |
482 | eval_kbuild_kind_to_string(pCur->enmKind), pCur->pszName); | |
483 | if (pCur->pszParent) | |
484 | { | |
485 | printf(" extending %s", pCur->pszParent); | |
486 | switch (pCur->enmExtendBy) | |
487 | { | |
488 | case kBuildExtendBy_Overriding: break; | |
489 | case kBuildExtendBy_Appending: printf(" by appending"); break; | |
490 | case kBuildExtendBy_Prepending: printf(" by prepending"); break; | |
491 | default: printf(" by ?!?"); | |
492 | } | |
493 | } | |
494 | if (pCur->pszTemplate) | |
495 | printf(" using %s", pCur->pszTemplate); | |
496 | putchar('\n'); | |
497 | ||
498 | print_variable_set(pCur->pVariables->set, ""); | |
499 | ||
500 | printf("kBuild-endef-%s %s\n", | |
501 | eval_kbuild_kind_to_string(pCur->enmKind), pCur->pszName); | |
502 | } | |
503 | /** @todo hash stats. */ | |
504 | } | |
505 | ||
506 | void print_kbuild_define_stats(void) | |
507 | { | |
508 | /* later when hashing stuff */ | |
509 | } | |
510 |
0 | /* $Id: kbuild.h 2413 2010-09-11 17:43:04Z bird $ */ | |
0 | /* $Id: kbuild.h 2549 2011-11-09 01:22:04Z bird $ */ | |
1 | 1 | /** @file |
2 | 2 | * kBuild specific make functionality. |
3 | 3 | */ |
37 | 37 | const char *get_kbuild_bin_path(void); |
38 | 38 | const char *get_default_kbuild_shell(void); |
39 | 39 | |
40 | struct kbuild_eval_data; | |
41 | extern struct kbuild_eval_data *g_pTopKbDef; | |
42 | struct variable_set *get_top_kbuild_variable_set(void); | |
43 | char *kbuild_prefix_variable(const char *pszName, unsigned int *pcchName); | |
44 | ||
45 | int eval_kbuild_define(struct kbuild_eval_data **kdata, const struct floc *flocp, | |
46 | const char *word, unsigned int wlen, const char *line, const char *eos, int ignoring); | |
47 | int eval_kbuild_endef(struct kbuild_eval_data **kdata, const struct floc *flocp, | |
48 | const char *word, unsigned int wlen, const char *line, const char *eos, int ignoring); | |
49 | ||
50 | void print_kbuild_data_base(void); | |
51 | void print_kbuild_define_stats(void); | |
52 | ||
40 | 53 | #endif |
41 | 54 |
51 | 51 | #include <stdio.h> |
52 | 52 | #include <stdlib.h> |
53 | 53 | #include <string.h> |
54 | #ifdef _MSC_VER | |
54 | #ifndef _MSC_VER | |
55 | 55 | # include <unistd.h> |
56 | 56 | #else |
57 | 57 | # include "mscfakes.h" |
58 | 58 | #endif |
59 | 59 | #ifdef __sun__ |
60 | 60 | # include "solfakes.h" |
61 | #endif | |
62 | #ifdef __HAIKU__ | |
63 | # include "haikufakes.h" | |
61 | 64 | #endif |
62 | 65 | #include "getopt.h" |
63 | 66 | #include "kmkbuiltin.h" |
34 | 34 | #endif |
35 | 35 | #endif /* not lint */ |
36 | 36 | |
37 | #define MSC_DO_64_BIT_IO | |
37 | 38 | #include "config.h" |
38 | 39 | #ifndef _MSC_VER |
39 | 40 | # include <sys/param.h> |
51 | 52 | #include <stdio.h> |
52 | 53 | #include <stdlib.h> |
53 | 54 | #include <signal.h> |
54 | #include <sysexits.h> | |
55 | #ifndef __HAIKU__ | |
56 | # include <sysexits.h> | |
57 | #endif | |
55 | 58 | #include <unistd.h> |
56 | 59 | #ifdef __sun__ |
57 | 60 | # include "solfakes.h" |
58 | 61 | #endif |
62 | #ifdef __HAIKU__ | |
63 | # include "haikufakes.h" | |
64 | #endif | |
59 | 65 | #ifdef _MSC_VER |
60 | # define MSC_DO_64_BIT_IO | |
61 | 66 | # include "mscfakes.h" |
62 | 67 | #else |
63 | 68 | # include <sys/time.h> |
74 | 74 | #endif |
75 | 75 | |
76 | 76 | #if ! HAVE_NBTOOL_CONFIG_H |
77 | # if !defined(__sun__) && !defined(__gnu_linux__) | |
77 | # if !defined(__sun__) && !defined(__gnu_linux__) && !defined(__HAIKU__) | |
78 | 78 | # define HAVE_STRUCT_DIRENT_D_NAMLEN 1 |
79 | 79 | # endif |
80 | 80 | #endif |
0 | /* $Id: haikufakes.c 2546 2011-10-01 19:49:54Z bird $ */ | |
1 | /** @file | |
2 | * Fake Unix/BSD stuff for Haiku. | |
3 | */ | |
4 | ||
5 | /* | |
6 | * Copyright (c) 2005-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | * | |
8 | * This file is part of kBuild. | |
9 | * | |
10 | * kBuild is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; either version 3 of the License, or | |
13 | * (at your option) any later version. | |
14 | * | |
15 | * kBuild is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with kBuild. If not, see <http://www.gnu.org/licenses/> | |
22 | * | |
23 | */ | |
24 | ||
25 | /******************************************************************************* | |
26 | * Header Files * | |
27 | *******************************************************************************/ | |
28 | #include "config.h" | |
29 | #include <errno.h> | |
30 | #include <stdio.h> | |
31 | #include <stdarg.h> | |
32 | #include <stdlib.h> | |
33 | #include <sys/stat.h> | |
34 | #include "haikufakes.h" | |
35 | ||
36 | ||
37 | int haiku_lchmod(const char *pszPath, mode_t mode) | |
38 | { | |
39 | /* | |
40 | * Weed out symbolic links. | |
41 | */ | |
42 | struct stat s; | |
43 | if ( !lstat(pszPath, &s) | |
44 | && S_ISLNK(s.st_mode)) | |
45 | { | |
46 | errno = -ENOSYS; | |
47 | return -1; | |
48 | } | |
49 | ||
50 | return chmod(pszPath, mode); | |
51 | } | |
52 |
0 | /* $Id: haikufakes.h 2546 2011-10-01 19:49:54Z bird $ */ | |
1 | /** @file | |
2 | * Unix/BSD fakes for Haiku. | |
3 | */ | |
4 | ||
5 | /* | |
6 | * Copyright (c) 2005-2010 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | * | |
8 | * This file is part of kBuild. | |
9 | * | |
10 | * kBuild is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; either version 3 of the License, or | |
13 | * (at your option) any later version. | |
14 | * | |
15 | * kBuild is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with kBuild. If not, see <http://www.gnu.org/licenses/> | |
22 | * | |
23 | */ | |
24 | ||
25 | #ifndef ___haikufakes_h | |
26 | #define ___haikufakes_h | |
27 | ||
28 | #define EX_OK 0 | |
29 | #define EX_OSERR 1 | |
30 | #define EX_NOUSER 1 | |
31 | #define EX_USAGE 1 | |
32 | #define EX_TEMPFAIL 1 | |
33 | #define EX_SOFTWARE 1 | |
34 | ||
35 | #define lutimes(path, tvs) utimes(path, tvs) | |
36 | #define lchmod haiku_lchmod | |
37 | ||
38 | #endif | |
39 |
51 | 51 | # ifdef USE_MMAP |
52 | 52 | # include <sys/mman.h> |
53 | 53 | # endif |
54 | # include <sys/mount.h> | |
54 | # ifndef __HAIKU__ | |
55 | # include <sys/mount.h> | |
56 | # endif | |
55 | 57 | # include <sys/wait.h> |
56 | 58 | # include <sys/time.h> |
57 | 59 | #endif /* !_MSC_VER */ |
67 | 69 | #include <stdio.h> |
68 | 70 | #include <stdlib.h> |
69 | 71 | #include <string.h> |
70 | #include <sysexits.h> | |
72 | #ifndef __HAIKU__ | |
73 | # include <sysexits.h> | |
74 | #endif | |
71 | 75 | #include <unistd.h> |
72 | 76 | #if defined(__EMX__) || defined(_MSC_VER) |
73 | 77 | # include <process.h> |
78 | 82 | #endif |
79 | 83 | #ifdef _MSC_VER |
80 | 84 | # include "mscfakes.h" |
85 | #endif | |
86 | #ifdef __HAIKU__ | |
87 | # include "haikufakes.h" | |
81 | 88 | #endif |
82 | 89 | #include "kmkbuiltin.h" |
83 | 90 |
52 | 52 | #include <stdio.h> |
53 | 53 | #include <stdlib.h> |
54 | 54 | #include <string.h> |
55 | #include <sysexits.h> | |
55 | #ifndef __HAIKU__ | |
56 | # include <sysexits.h> | |
57 | #endif | |
56 | 58 | #include <unistd.h> |
57 | 59 | #ifdef HAVE_ALLOCA_H |
58 | 60 | # include <alloca.h> |
59 | 61 | #endif |
60 | 62 | #include "getopt.h" |
63 | #ifdef __HAIKU__ | |
64 | # include "haikufakes.h" | |
65 | #endif | |
61 | 66 | #ifdef _MSC_VER |
62 | 67 | # include <malloc.h> |
63 | 68 | # include "mscfakes.h" |
54 | 54 | # include <sys/param.h> |
55 | 55 | # include <sys/time.h> |
56 | 56 | # include <sys/wait.h> |
57 | # include <sys/mount.h> | |
57 | # ifndef __HAIKU__ | |
58 | # include <sys/mount.h> | |
59 | # endif | |
58 | 60 | #endif |
59 | 61 | #include <sys/stat.h> |
60 | 62 | |
68 | 70 | #include <stdio.h> |
69 | 71 | #include <stdlib.h> |
70 | 72 | #include <string.h> |
71 | #include <sysexits.h> | |
73 | #ifndef __HAIKU__ | |
74 | # include <sysexits.h> | |
75 | #endif | |
72 | 76 | #include <unistd.h> |
73 | 77 | #include "getopt.h" |
74 | 78 | #ifdef __sun__ |
75 | 79 | # include "solfakes.h" |
80 | #endif | |
81 | #ifdef __HAIKU__ | |
82 | # include "haikufakes.h" | |
76 | 83 | #endif |
77 | 84 | #ifdef _MSC_VER |
78 | 85 | # include "mscfakes.h" |
42 | 42 | |
43 | 43 | #include "config.h" |
44 | 44 | #include <sys/stat.h> |
45 | #ifndef _MSC_VER | |
45 | #if !defined(_MSC_VER) && !defined(__HAIKU__) | |
46 | 46 | # include <sys/param.h> |
47 | 47 | # include <sys/mount.h> |
48 | 48 | #endif |
56 | 56 | #include <stdio.h> |
57 | 57 | #include <stdlib.h> |
58 | 58 | #include <string.h> |
59 | #include <sysexits.h> | |
59 | #ifndef __HAIKU__ | |
60 | # include <sysexits.h> | |
61 | #endif | |
60 | 62 | #include <unistd.h> |
61 | 63 | #include <ctype.h> |
62 | 64 | #include "getopt.h" |
65 | #ifdef __HAIKU__ | |
66 | # include "haikufakes.h" | |
67 | #endif | |
63 | 68 | #ifdef _MSC_VER |
64 | 69 | # include "mscfakes.h" |
65 | 70 | #endif |
53 | 53 | # ifdef __OS2__ |
54 | 54 | # define INCL_BASE |
55 | 55 | # include <os2.h> |
56 | # endif | |
57 | # ifdef __HAIKU__ | |
58 | # include <OS.h> | |
56 | 59 | # endif |
57 | 60 | #endif /* KMK*/ |
58 | 61 | |
834 | 837 | if (process_affinity) |
835 | 838 | if (!SetProcessAffinityMask (GetCurrentProcess (), process_affinity)) |
836 | 839 | fprintf (stderr, "warning: SetPriorityClass (,%#x) failed with last error %d\n", |
837 | process_affinity, GetLastError()); | |
840 | process_affinity, GetLastError ()); | |
838 | 841 | |
839 | 842 | switch (process_priority) |
840 | 843 | { |
844 | 847 | case 3: dwPriority = NORMAL_PRIORITY_CLASS; break; |
845 | 848 | case 4: dwPriority = HIGH_PRIORITY_CLASS; break; |
846 | 849 | case 5: dwPriority = REALTIME_PRIORITY_CLASS; break; |
847 | default: fatal(NILF, _("invalid priority %d\n"), process_priority); | |
850 | default: fatal (NILF, _("invalid priority %d\n"), process_priority); | |
848 | 851 | } |
849 | 852 | if (!SetPriorityClass (GetCurrentProcess (), dwPriority)) |
850 | 853 | fprintf (stderr, "warning: SetPriorityClass (,%#x) failed with last error %d\n", |
851 | 854 | dwPriority, GetLastError ()); |
855 | ||
856 | #elif defined(__HAIKU__) | |
857 | int32 iNewPriority; | |
858 | status_t error; | |
859 | ||
860 | switch (process_priority) | |
861 | { | |
862 | case 0: return; | |
863 | case 1: iNewPriority = B_LOWEST_ACTIVE_PRIORITY; break; | |
864 | case 2: iNewPriority = B_LOW_PRIORITY; break; | |
865 | case 3: iNewPriority = B_NORMAL_PRIORITY; break; | |
866 | case 4: iNewPriority = B_URGENT_DISPLAY_PRIORITY; break; | |
867 | case 5: iNewPriority = B_REAL_TIME_DISPLAY_PRIORITY; break; | |
868 | default: fatal (NILF, _("invalid priority %d\n"), process_priority); | |
869 | } | |
870 | error = set_thread_priority (find_thread (NULL), iNewPriority); | |
871 | if (error != B_OK) | |
872 | fprintf (stderr, "warning: set_thread_priority (,%d) failed: %s\n", | |
873 | newPriority, strerror (error)); | |
852 | 874 | |
853 | 875 | # else /*#elif HAVE_NICE */ |
854 | 876 | int nice_level = 0; |
860 | 882 | case 3: nice_level = 0; break; |
861 | 883 | case 4: nice_level = -10; break; |
862 | 884 | case 5: nice_level = -19; break; |
863 | default: fatal(NILF, _("invalid priority %d\n"), process_priority); | |
885 | default: fatal (NILF, _("invalid priority %d\n"), process_priority); | |
864 | 886 | } |
865 | 887 | errno = 0; |
866 | 888 | if (nice (nice_level) == -1 && errno != 0) |
3695 | 3717 | print_rule_data_base (); |
3696 | 3718 | print_file_data_base (); |
3697 | 3719 | print_vpath_data_base (); |
3720 | #ifdef KMK | |
3721 | print_kbuild_data_base (); | |
3722 | #endif | |
3698 | 3723 | #ifndef CONFIG_WITH_STRCACHE2 |
3699 | 3724 | strcache_print_stats ("#"); |
3700 | 3725 | #else |
3719 | 3744 | |
3720 | 3745 | print_variable_stats (); |
3721 | 3746 | print_file_stats (); |
3747 | # ifdef KMK | |
3748 | print_kbuild_define_stats (); | |
3749 | # endif | |
3722 | 3750 | # ifndef CONFIG_WITH_STRCACHE2 |
3723 | 3751 | strcache_print_stats ("#"); |
3724 | 3752 | # else |
499 | 499 | char *find_next_token (const char **, unsigned int *); |
500 | 500 | char *next_token (const char *); |
501 | 501 | char *end_of_token (const char *); |
502 | #ifdef KMK | |
503 | char *find_next_token_eos (const char **ptr, const char *eos, unsigned int *lengthptr); | |
504 | #endif | |
502 | 505 | #ifndef CONFIG_WITH_VALUE_LENGTH |
503 | 506 | void collapse_continuations (char *); |
504 | 507 | #else |
718 | 718 | return (char *)p; |
719 | 719 | #endif |
720 | 720 | } |
721 | #ifdef KMK | |
722 | ||
723 | /* Same as find_next_token with two exception: | |
724 | - The string ends at EOS or '\0'. | |
725 | - We keep track of $() and ${}, allowing functions to be used. */ | |
726 | ||
727 | char * | |
728 | find_next_token_eos (const char **ptr, const char *eos, unsigned int *lengthptr) | |
729 | { | |
730 | const char *p = *ptr; | |
731 | const char *e; | |
732 | int level = 0; | |
733 | ||
734 | /* skip blanks */ | |
735 | for (; p != eos; p++) | |
736 | { | |
737 | unsigned char ch = *p; | |
738 | if (!MY_IS_BLANK(ch)) | |
739 | { | |
740 | if (!ch) | |
741 | return NULL; | |
742 | break; | |
743 | } | |
744 | } | |
745 | if (p == eos) | |
746 | return NULL; | |
747 | ||
748 | /* skip ahead until EOS or blanks. */ | |
749 | for (e = p; e != eos; e++) | |
750 | { | |
751 | unsigned char ch = *e; | |
752 | if (MY_IS_BLANK_OR_EOS(ch)) | |
753 | { | |
754 | if (!ch || level == 0) | |
755 | break; | |
756 | } | |
757 | else if (ch == '$') | |
758 | { | |
759 | if (&e[1] != eos && (e[1] == '(' || e[1] == '{')) | |
760 | { | |
761 | level++; | |
762 | e++; | |
763 | } | |
764 | } | |
765 | else if ((ch == ')' || ch == '}') && level > 0) | |
766 | level--; | |
767 | } | |
768 | ||
769 | *ptr = e; | |
770 | if (lengthptr != 0) | |
771 | *lengthptr = e - p; | |
772 | ||
773 | return (char *)p; | |
774 | } | |
775 | ||
776 | #endif /* KMK */ | |
721 | 777 | |
722 | 778 | |
723 | 779 | /* Allocate a new `struct dep' with all fields initialized to 0. */ |
587 | 587 | #ifdef CONFIG_WITH_VALUE_LENGTH |
588 | 588 | unsigned int tmp_len; |
589 | 589 | #endif |
590 | #ifdef KMK | |
591 | struct kbuild_eval_data *kdata = 0; | |
592 | int krc; | |
593 | #endif | |
590 | 594 | |
591 | 595 | #define record_waiting_files() \ |
592 | 596 | do \ |
890 | 894 | can appear in the middle of a rule. */ |
891 | 895 | continue; |
892 | 896 | |
897 | #ifdef KMK | |
898 | /* Check for the kBuild language extensions. */ | |
899 | if ( wlen >= sizeof("kBuild-define") - 1 | |
900 | && strneq (p, "kBuild-define", sizeof("kBuild-define") - 1)) | |
901 | krc = eval_kbuild_define (&kdata, fstart, p, wlen, p2, eol, ignoring); | |
902 | else if ( wlen >= sizeof("kBuild-endef") - 1 | |
903 | && strneq (p, "kBuild-endef", sizeof("kBuild-endef") - 1)) | |
904 | krc = eval_kbuild_endef (&kdata, fstart, p, wlen, p2, eol, ignoring); | |
905 | else | |
906 | krc = 42; | |
907 | if (krc != 42) | |
908 | { | |
909 | if (krc != 0) | |
910 | error (fstart, _("krc=%d"), krc); | |
911 | continue; | |
912 | } | |
913 | ||
914 | #endif /* KMK */ | |
893 | 915 | if (word1eq ("export")) |
894 | 916 | { |
895 | 917 | /* 'export' by itself causes everything to be exported. */ |
1640 | 1662 | |
1641 | 1663 | if (conditionals->if_cmds) |
1642 | 1664 | fatal (fstart, _("missing `endif'")); |
1665 | #ifdef KMK | |
1666 | ||
1667 | if (kdata != NULL) | |
1668 | fatal (fstart, _("missing `kBuild-endef-*'")); | |
1669 | #endif | |
1643 | 1670 | |
1644 | 1671 | /* At eof, record the last rule. */ |
1645 | 1672 | record_waiting_files (); |
0 | # $Id: testcase-kBuild-define.kmk 2549 2011-11-09 01:22:04Z bird $ | |
1 | ## @file | |
2 | # kBuild - testcase for the kBuild-define-* directives. | |
3 | # | |
4 | ||
5 | # | |
6 | # Copyright (c) 2011 knut st. osmundsen <bird-kBuild-spamx@anduin.net> | |
7 | # | |
8 | # This file is part of kBuild. | |
9 | # | |
10 | # kBuild is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 3 of the License, or | |
13 | # (at your option) any later version. | |
14 | # | |
15 | # kBuild is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | # | |
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with kBuild. If not, see <http://www.gnu.org/licenses/> | |
22 | # | |
23 | # | |
24 | ||
25 | DEPTH = ../.. | |
26 | #include $(PATH_KBUILD)/header.kmk | |
27 | ||
28 | kBuild-define-target MyTarget | |
29 | ||
30 | _TEMPLATE = MyTemplate | |
31 | _SOURCES = MySourceFile.c | |
32 | ||
33 | kBuild-endef-target MyTarget | |
34 | $(if "$(MyTarget_TEMPLATE)" == "MyTemplate",,$(error MyTarget's _TEMPLATE wasn't set correctly in the global space)) | |
35 | $(if "$(MyTarget_SOURCES)" == "MySourceFile.c",,$(error MyTarget's _TEMPLATE wasn't set correctly in the global space)) | |
36 | ||
37 | ||
38 | INDIRECT_NAME = MyTarget$(strip $1) | |
39 | kBuild-define-target $(call INDIRECT_NAME, 2) | |
40 | ||
41 | local _TEMPLATE = MyTemplate2 | |
42 | _SOURCES = MySourceFile2.c | |
43 | ||
44 | kBuild-endef-target $(call INDIRECT_NAME, 2) | |
45 | $(if "$(_TEMPLATE)" == "",,$(error _TEMPLATE has leaked out into the global space)) | |
46 | ||
47 | ||
48 | ||
49 | ||
50 | all_recursive: | |
51 | #$(ECHO) "kBuild-define-xxxx works fine" | |
52 | ||
53 | ||
54 | ||
55 |
211 | 211 | struct variable **var_slot; |
212 | 212 | struct variable var_key; |
213 | 213 | |
214 | #ifndef KMK | |
214 | 215 | if (set == NULL) |
215 | 216 | set = &global_variable_set; |
217 | #else | |
218 | if (set == NULL) | |
219 | { | |
220 | /* underscore prefixed variables are automatically local in | |
221 | kBuild-define-* scopes. They also get a global definition with | |
222 | the current scope prefix. */ | |
223 | if (g_pTopKbDef && length > 0 && name[0] == '_') | |
224 | { | |
225 | char *prefixed_nm; | |
226 | unsigned int prefixed_nm_len; | |
227 | ||
228 | set = get_top_kbuild_variable_set(); | |
229 | v = define_variable_in_set(name, length, value, value_len, | |
230 | 1 /* duplicate_value */, | |
231 | origin, recursive, set, flocp); | |
232 | ||
233 | prefixed_nm_len = length; | |
234 | prefixed_nm = kbuild_prefix_variable(name, &prefixed_nm_len); | |
235 | define_variable_in_set(prefixed_nm, prefixed_nm_len, | |
236 | value, value_len, duplicate_value, | |
237 | origin, recursive, &global_variable_set, | |
238 | flocp); | |
239 | free(prefixed_nm); | |
240 | return v; | |
241 | } | |
242 | set = &global_variable_set; | |
243 | } | |
244 | #endif | |
216 | 245 | |
217 | 246 | #ifndef CONFIG_WITH_STRCACHE2 |
218 | 247 | var_key.name = (char *) name; |
1267 | 1296 | && defined (CONFIG_WITH_ABSPATHEX) \ |
1268 | 1297 | && defined (CONFIG_WITH_TOUPPER_TOLOWER) \ |
1269 | 1298 | && defined (CONFIG_WITH_DEFINED) \ |
1270 | && defined (CONFIG_WITH_VALUE_LENGTH) && defined (CONFIG_WITH_COMPARE) \ | |
1299 | && defined (CONFIG_WITH_VALUE_LENGTH) \ | |
1300 | && defined (CONFIG_WITH_COMPARE) \ | |
1271 | 1301 | && defined (CONFIG_WITH_STACK) \ |
1272 | 1302 | && defined (CONFIG_WITH_MATH) \ |
1273 | 1303 | && defined (CONFIG_WITH_XARGS) \ |
1289 | 1319 | && defined (CONFIG_WITH_DEFINED_FUNCTIONS) \ |
1290 | 1320 | && defined (KMK_HELPERS) |
1291 | 1321 | (void) define_variable ("KMK_FEATURES", 12, |
1292 | "append-dash-n abspath includedep-queue install-hard-linking" | |
1322 | "append-dash-n abspath includedep-queue install-hard-linking umask" | |
1323 | " kBuild-define" | |
1293 | 1324 | " rsort" |
1294 | 1325 | " abspathex" |
1295 | 1326 | " toupper tolower" |
1314 | 1345 | " for while" |
1315 | 1346 | " root" |
1316 | 1347 | " length insert pos lastpos substr translate" |
1317 | " kb-src-tool kb-obj-base kb-obj-suff kb-src-prop kb-src-one kb-exp-tmpl " | |
1318 | " firstdefined lastdefined " | |
1348 | " kb-src-tool kb-obj-base kb-obj-suff kb-src-prop kb-src-one kb-exp-tmpl" | |
1349 | " firstdefined lastdefined" | |
1319 | 1350 | , o_default, 0); |
1320 | 1351 | # else /* MSC can't deal with strings mixed with #if/#endif, thus the slow way. */ |
1321 | 1352 | # error "All features should be enabled by default!" |
1322 | strcpy (buf, "append-dash-n abspath includedep-queue install-hard-linking"); | |
1353 | strcpy (buf, "append-dash-n abspath includedep-queue install-hard-linking umask" | |
1354 | " kBuild-define"); | |
1323 | 1355 | # if defined (CONFIG_WITH_RSORT) |
1324 | 1356 | strcat (buf, " rsort"); |
1325 | 1357 | # endif |
41 | 41 | #define K_OS_DRAGONFLY 2 |
42 | 42 | /** FreeBSD. */ |
43 | 43 | #define K_OS_FREEBSD 3 |
44 | /** Haiku. */ | |
45 | #define K_OS_HAIKU 4 | |
44 | 46 | /** Linux. */ |
45 | #define K_OS_LINUX 4 | |
47 | #define K_OS_LINUX 5 | |
46 | 48 | /** NetBSD. */ |
47 | #define K_OS_NETBSD 5 | |
49 | #define K_OS_NETBSD 6 | |
48 | 50 | /** NT (native). */ |
49 | #define K_OS_NT 6 | |
51 | #define K_OS_NT 7 | |
50 | 52 | /** OpenBSD*/ |
51 | #define K_OS_OPENBSD 7 | |
53 | #define K_OS_OPENBSD 8 | |
52 | 54 | /** OS/2 */ |
53 | #define K_OS_OS2 8 | |
55 | #define K_OS_OS2 9 | |
54 | 56 | /** Solaris */ |
55 | #define K_OS_SOLARIS 9 | |
57 | #define K_OS_SOLARIS 10 | |
56 | 58 | /** Windows. */ |
57 | #define K_OS_WINDOWS 10 | |
59 | #define K_OS_WINDOWS 11 | |
58 | 60 | /** The max K_OS_* value (exclusive). */ |
59 | #define K_OS_MAX 11 | |
61 | #define K_OS_MAX 12 | |
60 | 62 | /** @} */ |
61 | 63 | |
62 | 64 | /** @def K_OS |
77 | 79 | # define K_OS K_OS_DRAGONFLY |
78 | 80 | # elif defined(__FreeBSD__) /*??*/ |
79 | 81 | # define K_OS K_OS_FREEBSD |
82 | # elif defined(__HAIKU__) | |
83 | # define K_OS K_OS_HAIKU | |
80 | 84 | # elif defined(__gnu_linux__) |
81 | 85 | # define K_OS K_OS_LINUX |
82 | 86 | # elif defined(__NetBSD__) /*??*/ |
0 | /* $Id: kmk_time.c 2413 2010-09-11 17:43:04Z bird $ */ | |
0 | /* $Id: kmk_time.c 2546 2011-10-01 19:49:54Z bird $ */ | |
1 | 1 | /** @file |
2 | 2 | * kmk_time - Time program execution. |
3 | 3 | * |
362 | 362 | printf(" - normal exit: %d\n", WEXITSTATUS(rc)); |
363 | 363 | rc = WEXITSTATUS(rc); |
364 | 364 | } |
365 | # ifndef __HAIKU__ /**@todo figure how haiku signals that a core was dumped. */ | |
365 | 366 | else if (WIFSIGNALED(rc) && WCOREDUMP(rc)) |
366 | 367 | { |
367 | 368 | printf(" - dumped core: %s (%d)\n", my_strsignal(WTERMSIG(rc)), WTERMSIG(rc)); |
368 | 369 | rc = 10; |
369 | 370 | } |
371 | # endif | |
370 | 372 | else if (WIFSIGNALED(rc)) |
371 | 373 | { |
372 | 374 | printf(" - killed by: %s (%d)\n", my_strsignal(WTERMSIG(rc)), WTERMSIG(rc)); |
0 | # $Id: Makefile.kmk 2506 2011-07-23 10:58:06Z bird $ | |
0 | # $Id: Makefile.kmk 2546 2011-10-01 19:49:54Z bird $ | |
1 | 1 | ## @file |
2 | 2 | # Sub-Makefile for kmk_sed. |
3 | 3 | # |
68 | 68 | lib/strverscmp.c \ |
69 | 69 | lib/obstack.c \ |
70 | 70 | lib/getline.c |
71 | kmk_sed_SOURCES.haiku = \ | |
72 | lib/strverscmp.c \ | |
73 | lib/obstack.c | |
71 | 74 | kmk_sed_SOURCES.openbsd = \ |
72 | 75 | lib/strverscmp.c \ |
73 | 76 | lib/obstack.c \ |
74 | 77 | lib/getline.c |
75 | 78 | kmk_sed_SOURCES.solaris = \ |
76 | 79 | lib/strverscmp.c \ |
77 | lib/obstack.c | |
80 | lib/obstack.c | |
78 | 81 | ifdef KBUILD_SOLARIS_10 |
79 | 82 | kmk_sed_SOURCES.solaris += \ |
80 | 83 | lib/getline.c |