Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
# -*- mode: mak; -*-
2
###############################################################################
3
# File:         TOOLSET/wcdos.rul[e]
4
# Contents:     WATCOM/DOS rules
5
#
6
# Revision History:
7
#       xx/08/99 APY    Created
8
#       22/03/00 APY    NODEPDIRS
9
#       08/06/00 APY    TS_TASM_AS
10
#       14/06/00 APY    LDDEPEND
11
#       13/11/01 APY    ; appended to several directives, forcing use of
12
#                       'sh.exe' during execution.  Required by WIN32
13
#                       toolsets,
14
###############################################################################
15
# Additional options above those supported by the basic build
16
# environment are...
17
#
18
# TS_MASM_AS:
19
#       If this variable is defined then the masm assembler will be
20
#       used rather than the watcom one.
21
#
22
# TS_TASM_AS:
23
#       If this variable is defined then the tasm assembler will be
24
#       used rather than the watcom one.
25
#
26
###############################################################################
27
 
28
###############################################################################
29
#..     Remove "undef" warnings
30
#
31
cc_includes     +=
32
cc_defines      +=
33
cxx_includes	+=
34
cxx_defines     +=
35
 
36
###############################################################################
37
#..     C Compiler definition
38
#
39
cc		= @export INCLUDE; INCLUDE='\
40
			$(patsubst %,%;,$(INCDIRS))\
41
			$(patsubst %,%;,$(cc_includes))\
42
			$(patsubst %,%;,$(wc_includes))';\
43
		  export WCC; WCC='\
44
			$(patsubst %, %,$(CFLAGS))\
45
			$(patsubst %, -d%,$(cc_defines))\
46
			$(patsubst %, %,$(wc_flags))';\
47
		  wcc
48
cc_init         =
49
cc_o_switch	= $(subst /,\\,-fo=$@)
50
cc_source	= $(subst /,\\,$<) > $(subst /,\\,$(basename $<)).err 2>&1
51
cc_cmdfile	=
52
cc_flags	=
53
cc_term 	= ;				# ; force use of 'sh.exe'
54
 
55
wc_includes	+= $(watcom)/h
56
 
57
wc_flags	= -ml -ei -zq -fpi
58
#wc_flags	+= -s
59
ifeq "$(DEBUG)" "1"
60
wc_flags	+= -dDEBUG -d2
61
else
62
wc_flags	+= -ox
63
endif
64
ifdef ALVL
65
wc_flags	+= -dALVL=$(ALVL)
66
endif
67
ifdef DLVL
68
wc_flags	+= -dDLVL=$(DLVL)
69
endif
70
 
71
define cc_pre
6177 dpurdie 72
	@echo '[$<] compiling..'
227 dpurdie 73
endef
74
 
75
define cc_post
76
endef
77
 
78
###############################################################################
79
#..     C/C++ dependencies
80
#       depend and depend.err
81
#
82
wc_depend	=  -D__STDC__ -D__WATCOMC__=1000 -D__LARGE__ -DMSDOS
83
ifeq "$(DEBUG)" "1"
84
wc_depend	+= -DDEBUG
85
endif
86
ifdef ALVL
87
wc_depend       += -DALVL=$(ALVL)
88
endif
89
ifdef DLVL
90
wc_depend       += -DDLVL=$(DLVL)
91
endif
92
 
93
ccdep           = @$(SCM_BIN)/mkdepend
94
ccdep_init      =
95
ccdep_o_switch	= -f -
96
ccdep_source	= $(filter %.c %.cc %.cpp, $+) > $(subst /,\\,$@) 2> $@.err
97
ccdep_flags     = -MM \
98
                $(patsubst %,%,$(CFLAGS)) \
99
		$(patsubst %,-D%,$(cc_defines)) \
100
		$(patsubst %,%,$(wc_depend)) \
101
		$(patsubst %,-I %,$(INCDIRS)) \
102
		$(patsubst %,-Y %,$(cc_includes)) \
103
		$(patsubst %,-Y %,$(wc_includes)) \
104
                $(patsubst %,-Y %,$(NODEPDIRS))
105
ccdep_pre       =
106
ccdep_post      =
107
 
108
#..     C++ Compiler definition
109
#
110
cxx		= @export INCLUDE; INCLUDE='\
111
			$(patsubst %,%;,$(INCDIRS))\
112
			$(patsubst %,%;,$(cc_includes))\
113
			$(patsubst %,%;,$(wc_includes))';\
114
		  export WCC; WCC='\
115
			$(patsubst %, %,$(CXXFLAGS))\
116
			$(patsubst %, -d%,$(cc_defines))\
117
			$(patsubst %, %,$(wc_flags))';\
118
		  wcc
119
cxx_init	=
120
cxx_o_switch	= $(subst /,\\,-fo=$@)
121
cxx_source	= $(subst /,\\,$<) > $(subst /,\\,$(basename $<)).err 2>&1
122
cxx_cmdfile	=
123
cxx_flags	=
124
cxx_term 	= ;				# ; force use of 'sh.exe'
125
 
126
define cxx_pre
6177 dpurdie 127
	@echo '[$<] compiling..'
227 dpurdie 128
endef
129
 
130
define cxx_post
131
endef
132
 
133
 
134
###############################################################################
135
#..     Assembler definition
136
#
137
 
138
ifdef TS_TASM_AS
139
#..     Assembler (TASM)
140
#
141
as		= tasm
142
as_init         =
143
as_i_switch     = -i
144
as_flags	=
145
as_o_switch	=
146
as_source	= $(subst /,\\,$<), $(subst /,\\,$@) @$(as_cmdfile)
147
as_cmdfile	= $(subst /,\\,$(basename $@).cmd)
148
as_term 	= ;				# ; force use of 'sh.exe'
149
 
150
as_includes	+=
151
as_defines      +=
152
 
153
tasm_flags	= -mx -t -w2
154
ifeq "$(DEBUG)" "1"
155
tasm_flags	+= -zi /dDEBUG
156
endif
157
ifdef DLVL
158
tasm_flags	+= -dDLVL=$(DLVL)
159
endif
160
ifdef ALVL
161
tasm_flags	+= -dALVL=$(ALVL)
162
endif
163
as_defines      := $(addprefix -d,$(as_defines))
164
as_defines	+= $(tasm_flags)
165
 
166
else
167
ifdef TS_MASM_AS
168
#..     Assembler (Microsoft 6.11)
169
#
170
as		= ml
171
as_init         =
172
as_i_switch     = /I
173
as_flags	= @$(as_cmdfile)
174
as_o_switch	= /Fo$(subst /,\\,$@)
175
as_source	= $(subst /,\\,$<)
176
as_cmdfile	= $(subst /,\\,$(basename $@).cmd)
177
as_term 	= ;				# ; force use of 'sh.exe'
178
 
179
as_includes	+= $(masm)/include
180
as_defines      +=
181
 
182
ml_flags	= /c /Zm /Cp /X /nologo
183
ifeq "$(DEBUG)" "1"
184
ml_flags	+= /W2 /Zd /DDEBUG
185
endif
186
ifdef DLVL
187
ml_flags	+= /DDLVL=$(DLVL)
188
endif
189
ifdef ALVL
190
ml_flags	+= /DALVL=$(ALVL)
191
endif
192
as_defines      := $(addprefix /D,$(as_defines))
193
as_defines	+= $(ml_flags)
194
 
195
else
196
#...    WASM (default)
197
#
198
ifndef TS_WASM_AS
199
TS_WASM_AS	= 1
200
endif
201
as		= wasm
202
as_init		=
203
as_i_switch     = -i=
204
as_flags	= @$(as_cmdfile)
205
as_o_switch	= /fo=$(subst /,\\,$@)
206
as_source	= $(subst /,\\,$<)
207
as_cmdfile	= $(subst /,\\,$(basename $@).cmd)
208
as_term 	= ;				# ; force use of 'sh.exe'
209
 
210
as_includes	+=
211
as_defines      +=
212
 
213
wasm_flags      = /we /zq
214
ifdef DLVL
215
wasm_flags 	+= -dDLVL=$(DLVL)
216
endif
217
ifdef ALVL
218
wasm_flags 	+= -dALVL=$(ALVL)
219
endif
220
ifeq "$(DEBUG)" "1"
221
wasm_flags      += /dDEBUG /d2
222
endif
223
as_defines      := $(addprefix /d,$(as_defines))
224
as_defines      += $(wasm_flags)
225
 
226
endif	        #MASM
227
endif	        #TASM
228
 
229
define as_pre
230
	@$(cmdfile) -ko$(as_cmdfile) "\
231
		$(patsubst %,%\\n,$(ASFLAGS)) \
232
		$(patsubst %,%\\n,$(as_defines)) \
233
		$(patsubst %,$(as_i_switch)%\\n,$(subst /,\\\\,$(INCDIRS))) \
234
		$(patsubst %,$(as_i_switch)%\\n,$(subst /,\\\\,$(as_includes)))"
235
endef
236
 
237
ifndef LEAVETMP
238
define as_post
239
	@$(rm) -f $(as_cmdfile)
240
endef
241
else
242
define as_post
243
endef
244
endif		#LEAVETMP
245
 
246
 
247
#..     Archiver
248
#
249
ar		= wlib
250
ar_init         =
251
ar_cmdfile	= $(subst /,\\,$(basename $@).ar)
252
ar_flags	= -b -c -n -q -p=512
253
ar_o_switch	= $(subst /,\\,$@) @$(ar_cmdfile)
254
ar_term 	= ;				# ; force use of 'sh.exe'
255
 
256
define ar_pre
257
	@$(cmdfile) -ko$(ar_cmdfile) \
258
		"$(patsubst %,%\\n,$(subst /,\\\\,$^))"
259
endef
260
 
261
ifndef LEAVETMP
262
define ar_post
263
	@$(rm) -f $(ar_cmdfile)
264
endef
265
else
266
define ar_post
267
endef
268
endif
269
 
270
#..     Linker
271
#
272
ld		= wlink
273
ld_cmdfile	= $(subst /,\\,$(basename $@).ld)
274
ld_flags	= @$(ld_cmdfile)
275
ld_o_switch	=
276
ld_term 	= ;				# ; force use of 'sh.exe'
277
 
278
define ld_pre
279
	@export WCX86_LIB; \
280
		WCX86_LIB="$(subst $(space),;,$(LIBDIRS))"; \
281
	$(cmdfile) -ko$(ld_cmdfile) "$($(notdir $(basename $@))_ld)"
282
endef
283
 
284
ifndef LEAVETMP
285
define ld_post
286
	@$(rm) -f $(ld_cmdfile)
287
endef
288
else
289
define ld_post
290
endef
291
endif
292
 
293
define LDDEPEND
294
	@export WCX86_LIB; \
295
		WCX86_LIB="$(subst $(space),;,$(LIBDIRS))"; \
296
	$(cmdfile) -ko$(BINDIR)/$(notdir $(basename $@)).dep "$($(notdir $(basename $@))_dp)"
297
endef
298
 
299
#