Subversion Repositories DevTools

Rev

Rev 267 | Rev 303 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
# -*- mode: mak; -*-
2
###############################################################################
3
# File:         TOOLSET/vcwin32.rul[e]
4
# Contents:     Visual C/C++ WIN32 rules
5
#
6
# Version   Who      Date        Description#
7
#           APY      xx/08/99    Created
8
#                    22/03/00    NODEPDIRS
9
#                    30/06/01    V/C++ 6.0/CL 12.xx support
10
#                    23/08/01    Import INCLUDE and LIB
11
#                    12/03/04    mkdepend -b -o -p
12
#                    20/05/04    armerge -t
13
#                    04/10/04    PCLINT support
14
#
15
# $Source: /cvsroot/etm/devl/CFG/TOOLSET/VCWIN32.RUL,v $
16
# $Revision: 1.11 $ $Date: 2004/10/08 03:07:03 $ $State: Exp $
17
# $Author: ayoung $ $Locker:  $
18
#............................................................................#
19
 
20
###############################################################################
21
#..     Remove "undef" warnings
22
#
23
cc_includes	+=
24
cc_defines	+=
25
cxx_includes	+=
26
cxx_defines	+=
27
purecov_ld_flags +=
28
 
29
###############################################################################
30
#..     Parse user options
31
#       Global options already parsed
32
#       These options extend the global options
33
#
34
 
35
ifdef OPTIONS
36
 
37
ifneq "$(findstring purify,$(OPTIONS))" ""      # Enable purify
38
else
39
ifneq "$(findstring purecov,$(OPTIONS))" ""     # Enable pure coverage
40
purecov_ld_flags += FIXED:NO
41
endif
42
endif
43
 
44
ifneq "$(findstring ccdepend,$(OPTIONS))" ""    # Build depends using CC
45
endif
46
 
47
ifneq "$(findstring wall,$(OPTIONS))" ""        # Enable all warnings
48
USE_WALL	= 1
49
endif
50
 
51
ifneq "$(findstring gensbr,$(OPTIONS))" ""     # Generate Source Browser Files
52
GEN_SBR_FILES	= 1
53
endif
54
 
55
endif
56
 
255 dpurdie 57
################################################################################
58
#   Define a macro to assist in selecting compiler options based on the
59
#   type of compiler being being used. New versions of compilers will deprecate
60
#   options or replace some
61
#
62
#   select_co	- Select Compiler Option
63
#		- Arguments are for the different compilers as defined by VSCOMPILER
64
#		  VSCOMPILER in the range 1.. as defined in the .PL file
65
#
66
#		  Current usage
67
#			1 - vc6
68
#			2 - vc7
291 dpurdie 69
#			3 - vc8,vc9
255 dpurdie 70
#
71
$(if $(VSCOMPILER),,$(error VCWIN32 toolset requires VSCOMPILER to be defined))
72
select_co = $(subst --,,$(word $(VSCOMPILER),$1 $2 $3))
73
 
227 dpurdie 74
###############################################################################
75
#   Standard library paths
76
#   Export LIB as this is used by the compiler (#import) as well as the
77
#   librarian and the linker. It is also used by the library generation
78
#   process.
79
#
255 dpurdie 80
#	VC_LIB	    - Lib paths from Compiler toolkit
81
#		    - ';' seperated path list
82
#		    - Uses \ or / as a dir sep
83
#		    - Uses real spaces in pathnames
84
#		    - Should be Absolute Paths
85
#                   
86
#	LIBDIRS	    - Lib paths from JATS
87
#		    - Space seperated path list
88
#		    - Uses / as dir sep
89
#		    - Must not contain spaces
90
#		    - Will be Relative
91
#
92
#	ALL_LIBDIRS and LIB
93
#		    - Only contain valid paths
94
#		      VS2005 will complain about bad LIB entries
95
#		      Use $(wildcard ...) to limit to test for existence
96
#		    - Contain absolute paths
97
#		      msdev/devenv don't work with relative paths
98
#		      Use $(abspath ...) to convert
99
#
100
#	ALL_LIBDIRS - Used internally
101
#		    - Space seperated path list
102
#		    - Uses / as dir sep
103
#		    - Uses %20 as a altspace in pathnames
104
#                   
105
#	LIB         - Exported to tools
106
#		    - ';' seperated path list
107
#		    - Uses \ as a dir sep
108
#		    - Uses real spaces in pathnames
227 dpurdie 109
#..
110
 
255 dpurdie 111
#
112
#   Work around for a bug in make 3.81 where abspath assumes that the input
113
#   is a relative path. The work around checks for paths that have a : or start
114
#   with a '/ - and assumes these are absolute.
115
#   It will only call makes 'abspath' for relative paths.
116
#
117
myabspath = $(foreach dir,$1,$(call myabs1path,$(dir)))
118
myabs1path = $(if $(or $(findstring :,$1),$(filter /%,$1)),$1,$(abspath $1))
227 dpurdie 119
 
255 dpurdie 120
vc_libs     := $(subst ;,$(space),$(subst \,/,$(subst $(space),$(spacealt),$(VC_LIB))))
121
ALL_LIBDIRS := $(wildcard $(call myabspath,$(LIBDIRS))) $(vc_libs)
122
LIB         := $(subst $(spacealt),$(space),$(subst $(space),$(empty),$(patsubst %,%;,$(subst /,\,$(ALL_LIBDIRS)))))
227 dpurdie 123
export LIB
124
 
255 dpurdie 125
#one_per_line = $(foreach aa,$2,$(info $1 :: $(subst $(spacealt),$(space),$(aa))))
126
#$(call one_per_line,Good LIBDIRS,$(ALL_LIBDIRS))
127
 
227 dpurdie 128
###############################################################################
129
#..     Compiler definitions
130
#
131
 
132
#..     C Compiler definition
133
#
134
 
135
	# Standard defines
136
	#
137
	#..
138
vc_defines	+= -DWIN32 -D_WIN32
139
 
140
ifdef USE_JATS_V1
141
#.. These are the swicthes used by Jats Version-1
142
#
143
vc_defines  += -D_WIN32_IE=0x0300 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
144
endif
145
 
146
 
147
#.. vc_defines	+= -D_WIN32_WINNT=0x0400	# force use of winsock2.h
148
#.. vc_defines	+= -DWINVER=0x0400		# default
149
#.. vc_defines	+= -D_WIN32_IE=0x0300		# default is 0400
150
#.. vc_defines	+= -DCRTAPI1=_cdecl		# default
151
#.. vc_defines	+= -DCRTAPI2=_cdecl		# default
152
#..
153
#.. if (TARGET) == NT
154
#.. vc_defines	+= -D_WINNT -D_WIN32_WINNT=0x0400
155
#.. elif (TARGET) == 95
156
#.. vc_defines	+= -D_WIN95 -D_WIN32_WINDOWS=0x400
157
#.. else GENERIC (default)
158
#.. endif
159
#.. if (CONSOLE)
160
#.. vc_defines	+= -D_CONSOLE -D_MBCS
161
#.. endif
162
 
163
#vc_defines	+= -D_MT			    # implied via -MD
164
vc_defines	+= -D_X86_=1			# assume target
165
 
166
ifdef ALVL
167
vc_defines	+= -DALVL=$(ALVL)
168
endif
169
ifdef DLVL
170
vc_defines	+= -DDLVL=$(DLVL)
171
endif
267 dpurdie 172
 
173
#
174
#	__SOURCE__ interferes with Windows Precompiled headers
175
#	It can be disabled, but its not for backward compatability
176
#
177
ifndef DISABLE__SOURCE__
227 dpurdie 178
vc_defines	+= -D__SOURCE__=\"$(notdir $<)\"
267 dpurdie 179
endif
227 dpurdie 180
 
181
	# Standard flags
182
	#
183
	# Both compilers now use the same front end - you must still define either
184
	# _X86_ or _ALPHA_.  These have replaced the i386 and ALPHA definitions
185
	# which are not ANSI compliant.
186
	#
187
	# Common compiler flags:
255 dpurdie 188
	#   -c    - compile without linking
189
	#   -W3   - Set warning level to level 3
190
	#   -Zi   - generate debugging information
191
	#   -Zd   - generate only public symbols and line numbers for debugging
192
	#   -Od   - disable all optimizations
193
	#   -Ox   - use maximum optimizations
194
	#   -Ge   - enable stack checks
195
	#   -Gm   - enable min builds
196
	#   -GX   - (Deprecated: Use -EHsc) Enables synchronous exception handling (C++)
197
        #   -EHsc - Enables synchronous exception handling (C++)
198
	#   -YX   - (Deprecated: Don't use) Automatically generate precompiled headers
199
	#   -Yd   - Place debug info within objects.
200
	#   -GZ   - (Deprecated: Use -RTC1)Enable runtime debug checks
201
	#   -GR   - Enables run-time type information (RTTI)
202
	#   -MD   - Creates a multithreaded DLL, using MSVCRT.LIB
203
	#   -MDd  - Creates a debug multithreaded DLL, using MSVCRTD.LIB
227 dpurdie 204
	#
205
	# Output options:
206
	#   -Fo<file>      name object file
207
	#   -Fp<file>      name precompiled header file
208
	#   -Fd[file]      name .PDB file
209
	#   -Fm[file]      name map file
210
	#   -FR[file]      name source browser file (Complete)
211
	#   -Fr[file]      name source browser file (No locals)
212
	#
213
	# i386 specific compiler flags:
214
	#   -Gz  - stdcall
215
	#   -Gd  - cdecl
216
	#
217
	# Plus:
218
	#   -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl
219
	#   _X86_ | _MIPS_ | _PPC_
220
	#   WINNT | WIN95
221
	#   WINVER=0x0500 (5.0) | WINVER=0x0400 (4.0) | WINVER=0x030A (3.51)
222
	#   _MT
223
	#
224
	# Linker
225
	#   -MT[d]  using MT safe C library
226
	#
227
	# ! Warning !
228
	#   If you are going to call C run-time routines from a program
229
	#   built with LIBCMT.LIB, you must start your threads with the
230
	#   _beginthread function.  Do not use the Win32 functions
231
	#   ExitThread and CreateThread.  Using SuspendThread can lead to
232
	#   a deadlock when more than one thread is blocked waiting for
233
	#   the suspend thread to complete its access to a C run-time
234
	#   data structure.
235
	#..
236
vc_flags	+= -c -nologo
237
vc_flags	+= -GR
238
vc_flags	+= -Gd
255 dpurdie 239
vc_flags	+= $(call select_co,-GX,-GX,-EHsc)
227 dpurdie 240
ifdef USE_WALL
241
vc_flags	+= -W4
242
else
243
vc_flags	+= -W3
244
endif
245
 
246
vc_compile_flags = -TC          # Force C unless otherwise demanded
247
ifdef FORCE_C_COMPILE
248
vc_compile_flags = -TC
249
endif
250
 
251
ifdef FORCE_CC_COMPILE
252
vc_compile_flags = -TP
253
endif
254
 
255
ifdef USE_OPTIMISE				# default for production
256
vc_flags	+= -Od              # Don't optimise production code. Too many problems. Ship what we test
257
else
258
vc_flags	+= -Od
259
endif
260
 
261
ifdef USE_DEBUGINFO				# default for debug
255 dpurdie 262
vc_flags	+= $(call select_co,-GZ,-GZ,-RTC1)
227 dpurdie 263
vc_defines	+= -DDEBUG
264
else
265
vc_flags	+=
266
endif
267
 
268
ifdef LEAVETMP                  # Create an assembly listing
269
vc_flags       += -FAs  -Fa$(subst /,\\,$(basename $@).src)
270
endif
271
 
272
ifndef THREADMODE
273
    THREADMODE = "D"
274
endif
275
 
276
ifeq "$(DEBUG)" "1"				# debug/prod specific
277
vc_flags	+= -M$(THREADMODE)d
278
vc_defines	+= -D_DEBUG
279
else
280
vc_flags	+= -M$(THREADMODE)
281
vc_defines	+= -DNDEBUG
282
endif
283
 
284
ifdef USE_STRICT_ANSI				# default OFF
285
vc_flags	+= -Za
286
else
287
vc_flags	+=
288
endif
289
 
290
ifdef USE_RTTI
291
vc_flags	+= -GR
292
endif
293
 
294
ifndef PDB_NONE                 		# Supress PDB generation
295
vc_flags	+= -Zi
296
endif
297
 
298
ifdef PRECOMPILEHDRS                           	# Precompile headers
255 dpurdie 299
vc_flags	+= $(call select_co,-YX,-YX,--)
227 dpurdie 300
endif
301
 
302
vc_flags	+= -Fp$(subst /,\\,$(OBJDIR)/)
303
vc_flags	+= -Fd$(subst /,\\,$(PDB))
304
 
305
ifdef GEN_SBR_FILES
306
vc_flags	+= -FR$(subst /,\\,$(basename $@).sbr)
307
endif
308
 
309
SHCFLAGS	+= -GD
310
SHCXXFLAGS	+= -GD
311
 
312
	# Standard includes
255 dpurdie 313
	# INCLUDE    - a ';' seperated list of paths
314
        # vc_include - a 'space' seperated list of paths
315
        #            - Using / for path sep
316
        #            - Using 'spacealt'(%20) for 'space' placeholder
227 dpurdie 317
	#..
318
vc_includes	=\
319
		$(subst ;,$(space),$(subst \,/,$(subst $(space),$(spacealt),$(INCLUDE))))
320
 
321
	# Command
322
	#
323
	#..
324
cc		= $(CC_PRE) cl
325
cc_init		=
326
cc_o_switch	= $(subst /,\\,-Fo$@)
327
cc_source	= $(subst /,\\,$<)
328
# CFLAGS must follow vc_flags to build with netbula headers
329
# these should be the ONLY c files that must be built with the C compiler
330
# until netbula support the C++ compiler
331
cc_flags	= \
332
		$(strip $(vc_compile_flags)) \
333
		$(strip $(patsubst %,%,$(vc_flags))) \
334
		$(strip $(patsubst %,%,$(vc_defines))) \
335
		$(patsubst %,%,$(CFLAGS)) \
336
		$(patsubst %,-D%,$(cc_defines)) \
255 dpurdie 337
		$(subst $(spacealt),$(space),$(patsubst %,"-I%",$(subst /,\,$(INCDIRS)))) \
338
		$(subst $(spacealt),$(space),$(patsubst %,"-I%",$(subst /,\,$(cc_includes)))) \
339
		$(subst $(spacealt),$(space),$(patsubst %,"-I%",$(subst /,\,$(vc_includes))))
227 dpurdie 340
cc_term		=
341
 
342
define cc_pre
343
	@$(echo) [$<] Compiling..
344
endef
345
 
346
	# Note:  The compiler gets the case of the PDB file
347
	#        wrong, force to be mixed case.  Also generating of the
348
	#        PDB image is optional based on debugging options, must
349
	#        test if file exists.
350
	#
351
	#        Leave the $(PDB).tmp file otherwise clearaudit gets upset
352
	#
353
define cc_post
354
	@if [ -f $(PDB) ]; then \
355
	$(rm) -f $(PDB).tmp; \
356
	$(mv) $(PDB) $(PDB).tmp; \
357
	$(cp) $(PDB).tmp $(PDB); \
358
	fi
359
endef
360
 
361
cc_filter	:= "$(notdir $(wildcard $(GBE_ROOT)/warnings.visualc))"
362
ifeq ($(strip $(cc_filter)), "warnings.visualc")
363
cc_filter	= $(GBE_ROOT)/warnings.visualc
364
else
365
cc_filter	=
366
endif
367
 
368
ifdef cc_filter
369
cc_redirect_stderr = 1
370
cc_error_filter = $(awk) -f $(cc_filter)
371
endif
372
 
373
 
374
###############################################################################
375
#..     C/C++ dependencies
376
#       depend and depend.err
377
#
378
vc_depend	=  -D_MSC_VER=1200 -D_MSC_EXTENSIONS=1
379
vc_depend	+= -D_MT
380
vc_depend	+= -D_X86_=1 -D_M_IX86=300
381
vc_depend	+= -D_INTEGRAL_MAX_BITS=64
382
 
383
ccdep		= $(XX_PRE) $(GBE_BIN)/mkdepend
384
ccdep_init	=
385
ccdep_o_switch	= -f -
386
ccdep_source	= $(filter %.c %.cc %.cpp, $+) > $@ 2> $@.err
387
ccdep_flags	= -MM -b -We -p '$$(OBJDIR)/' \
388
		$(foreach shname,$(SHNAMES),-p '$$(OBJDIR)/$(shname)/') \
389
		-o ".$(o)" \
390
		$(patsubst %,%,$(vc_depend)) \
391
		$(patsubst %,%,$(vc_defines)) \
392
		$(patsubst %,%,$(CFLAGS)) \
393
		$(patsubst %,%,$(CXXFLAGS)) \
394
		$(patsubst %,-D%,$(cc_defines)) \
395
		$(patsubst %,-D%,$(cxx_defines)) \
396
		$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(INCDIRS)))) \
397
		$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(cc_includes)))) \
398
		$(subst $(spacealt),$(space),$(patsubst %,-Y"%",$(subst /,\,$(vc_includes)))) \
399
		$(patsubst %,-Y %,$(NODEPDIRS))
400
 
401
ccdep_pre	=
402
ccdep_post	=
403
 
404
#..     C/C++ Lint definitions
405
#       -D Definition is not allowed: PCLINT does not like the space
406
#
407
lint_flags	+= \
408
	$(patsubst %,%,$(vc_depend)) \
409
	$(subst -D$(space),-D,$(patsubst %,%,$(vc_defines))) \
410
	$(patsubst %,%,$(CLINTFLAGS)) \
411
	$(patsubst %,-D%,$(cc_defines)) \
412
	$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(INCDIRS))) \
413
	$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(cc_includes))) \
414
	$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(vc_includes)))
415
 
416
lint_libpath	= $(LIB)
417
 
418
#..     C++ Compiler definitions
419
#
420
cxx		= $(CC_PRE) cl
421
cxx_init	=
422
cxx_o_switch	= $(subst /,\\,-Fo$@)
423
cxx_source	= $(subst /,\\,$<)
424
# CXXFLAGS must follow vc_flags to build with netbula headers
425
# these should be the ONLY c files that must be built with the C compiler
426
# until netbula support the C++ compiler
427
cxx_flags	= -TP \
428
		$(patsubst %,%,$(vc_flags)) \
429
		$(patsubst %,%,$(vc_defines)) \
430
		$(patsubst %,%,$(CXXFLAGS)) \
431
		$(patsubst %,-D%,$(cxx_defines)) \
432
		$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(INCDIRS)))) \
433
		$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(cxx_includes)))) \
434
		$(subst $(spacealt),$(space),$(patsubst %,-I"%",$(subst /,\,$(vc_includes))))
435
cxx_term	=
436
 
437
define cxx_pre
438
	@echo [$<] compiling..
439
endef
440
 
441
define cxx_post
442
endef
443
 
444
 
445
###############################################################################
446
#..     Assembler definition
447
#
448
 
449
#..     Assembler (Microsoft 6.11)
450
#
451
as		= $(XX_PRE) ml
452
as_init 	=
453
as_i_switch	= /I
454
as_o_switch	= /Fo$(subst /,\\,$@)
455
as_source	= $(subst /,\\,$<)
456
as_cmdfile	= $(subst /,\\,$(basename $@).cmd)
457
as_flags	= @$(as_cmdfile)
458
as_term		=
459
 
460
as_includes	+= $(masm)/include
461
as_defines	+=
462
 
463
ml_flags	= /c /Zm /Cp /X
464
ifeq "$(DEBUG)" "1"
465
ml_flags	+= /W2 /Zd /DDEBUG
466
endif
467
ifdef DLVL
468
ml_flags	+= /DDLVL=$(DLVL)
469
endif
470
ifdef ALVL
471
ml_flags	+= /DALVL=$(ALVL)
472
endif
473
as_defines	:= $(addprefix /D,$(as_defines))
474
as_defines	+= $(ml_flags)
475
 
476
define as_pre
477
	@$(cmdfile) -wko$(as_cmdfile) "\
478
		$(patsubst %,%\\n,$(ASFLAGS)) \
479
		$(patsubst %,%\\n,$(as_defines)) \
480
		$(patsubst %,$(as_i_switch)%\\n,$(subst /,\\\\,$(INCLUDES))) \
481
		$(patsubst %,$(as_i_switch)%\\n,$(subst /,\\\\,$(as_includes)))"
482
endef
483
 
484
ifndef LEAVETMP
485
define as_post
486
	@$(rm) -f $(as_cmdfile)
487
endef
488
else
489
define as_post
490
endef
491
endif
492
 
493
 
494
###############################################################################
495
#..     Archiver definition
496
#
497
 
498
#..     Archiver
499
#
500
ar		= $(XX_PRE)lib
501
ar_init 	=
502
ar_flags	= -nologo -machine:IX86
503
ifeq "$(DEBUG)" "1"
504
ar_flags	+= -debugtype:cv
505
endif
506
 
507
LIBDEF		+=
508
ar_flags	+= $(patsubst %,-def:%,$(LIBDEF))
509
LIBNAME     +=
510
ar_flags	+= $(patsubst %,-name:%,$(LIBNAME))
511
ar_o_switch	= -out:$(subst /,\\,$@) $(subst /,\\,$(filter %.obj,$^)) $(subst /,\\,$(filter %.res,$^))
512
ar_term		=
513
 
514
define ar_pre
515
	echo [$@] Building library ..;
516
endef
517
 
518
define ar_post
519
endef
520
 
521
 
522
#..     Archive Merge
523
#
524
armerge		= $(XX_PRE) $(GBE_TOOLS)/armerge
525
armerge_init	=
526
armerge_cmdfile =
261 dpurdie 527
armerge_flags	= -d $(MLIBDIR) -t MSVC
227 dpurdie 528
armerge_o_switch= $(subst /,\\,$@) $(subst /,\\,$^)
529
 
530
define armerge_pre
531
	-echo [$@] Merging library ..; $(rm) -f $@
532
endef
533
armerge_post	=
534
 
535
###############################################################################
536
#..     Linker
537
#
538
 
539
	# Standard flags
540
	#
541
	#..
542
vc_ldflags	= \
543
		-nologo\\n\
544
		-incremental:no\\n\
255 dpurdie 545
		-debug\\n\
546
		$(subst $(spacealt),$(space),$(patsubst %,-libpath:\"%\"\\n,$(subst /,\\\\,$(ALL_LIBDIRS))))\
227 dpurdie 547
		$(patsubst %,-%\\n,$(LDFLAGS))\
548
		$(patsubst %,-%\\n,$(purecov_ld_flags))
549
 
550
ifdef LDSUBSYSTEM
551
vc_ldflags += -subsystem:$(LDSUBSYSTEM)\\n
552
endif
553
 
554
#..     Shared library (dll)
555
#
556
 
557
shld		= $(CC_PRE) link
558
shld_cmdfile	= $(subst /,\\,$(basename $@).ld)
559
shld_flags	=
560
shld_o_switch	= @$(shld_cmdfile)
561
shld_term	=
562
 
563
define shld_pre
564
	@$(cmdfile) -wkWeo$(shld_cmdfile) \
565
		"$(vc_ldflags) $($(notdir $(SHBASE))_shld)"; \
566
	echo [$@] Linking shared library ..;
567
endef
568
 
569
ifndef LEAVETMP
570
define shld_post
571
	@$(rm) -f $(shld_cmdfile)
572
endef
573
else
574
define shld_post
575
endef
576
endif
577
 
578
define SHLDDEPEND
579
	@$(cmdfile) -wkWeo$(@) \
580
		"$($(notdir $(SHNAME))_shdp)";
581
endef
582
 
583
#..      Application
584
#
585
 
586
ld		= $(CC_PRE) link
587
ld_cmdfile	= $(subst /,\\,$(basename $@).ld)
588
ld_depfile	= $(subst /,\\,$(basename $@).dep)
589
ld_flags	=
590
ld_o_switch	= @$(ld_cmdfile)
591
ld_term		=
592
 
593
define ld_pre
594
	@$(cmdfile) -wkWeo$(ld_cmdfile) \
595
		"$(vc_ldflags) $($(notdir $(basename $@))_ld)"; \
596
	echo [$@] Linking application ..
597
endef
598
 
599
ifndef LEAVETMP
600
define ld_post
601
	@$(rm) -f $(ld_cmdfile)
602
endef
603
else
604
define ld_post
605
endef
606
endif
607
 
608
define LDDEPEND
609
	@$(cmdfile) -wkWeo$(ld_depfile) \
610
		"$($(notdir $(basename $@))_dp)";
611
endef
612
 
613
#.. Resource Compiler
614
#   Convert a .rc file into a .res file
615
#       Set up the INCLUDE envar to conatin the path to locate required
616
#       files and the local and interface directories then the compiler directories
617
#
618
#       Currently RC has a limit of 100 include paths to seach
619
#       Simply limit the list to the system paths and the directories
620
#       required by the prerequisite files
621
#
622
rc_defines = $(subst -D,/d ,$(vc_defines))
623
rc_dirs = $(subst /,\,$(sort $(dir $^)))
624
rc_dirs += $(LINCDIRS)
625
rc_dirs += $(vc_includes)
626
rc_include = $(subst $(spacealt),$(space),$(subst $(space),$(empty),$(patsubst %,%;,$(subst /,\,$(rc_dirs)))))
627
rc_include1 = $(subst \;,;,$(rc_include))
628
 
629
define RC
630
	@$(echo) [$@] Compile Resource File ..
631
	@$(show_environment)
632
	$(XX_PRE) export INCLUDE; INCLUDE="$(rc_include1)"; \
633
	RC /l 0xC09 $(rc_defines) /fo $(subst /,\\,$@) $(subst /,\\,$<)
634
endef
635
 
636
#.. Browser Information
637
#   Create a .BSC file from many .SBR files
638
#   Filter out non .SBR files to assist in rule creation
639
#
640
define BSCMAKE
641
	@$(echo) [$@] Create Source Browser Information ..
642
	@$(show_environment)
643
	$(XX_PRE) bscmake -nologo -n -o $(subst /,\\,$@) $(subst /,\\,$(filter %.sbr,$^))
644
endef
645
 
646
#