Subversion Repositories DevTools

Rev

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