]> git.sur5r.net Git - cc65/blob - src/cc65/make/watcom.mak
New store optimization.
[cc65] / src / cc65 / make / watcom.mak
1 #
2 # CC65 Makefile for the Watcom compiler
3 #
4
5 # ------------------------------------------------------------------------------
6 # Generic stuff
7
8 .AUTODEPEND
9 .SUFFIXES       .ASM .C .CC .CPP
10 .SWAP
11
12 AR      = WLIB
13 LD      = WLINK
14
15 !if !$d(TARGET)
16 !if $d(__OS2__)
17 TARGET = OS2
18 !else
19 TARGET = NT
20 !endif
21 !endif
22
23 # target specific macros.
24 !if $(TARGET)==OS2
25
26 # --------------------- OS2 ---------------------
27 SYSTEM = os2v2
28 CC = WCC386
29 CCCFG  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
30
31 !elif $(TARGET)==DOS32
32
33 # -------------------- DOS4G --------------------
34 SYSTEM = dos4g
35 CC = WCC386
36 CCCFG  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
37
38 !elif $(TARGET)==DOS
39
40 # --------------------- DOS ---------------------
41 SYSTEM = dos
42 CC = WCC
43 CCCFG  = -bt=$(TARGET) -d1 -onatx -zp2 -2 -ml -zq -w2
44
45 !elif $(TARGET)==NT
46
47 # --------------------- NT ----------------------
48 SYSTEM = nt
49 CC = WCC386
50 CCCFG  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
51
52 !else
53 !error
54 !endif
55
56 # Add the include dir
57 CCCFG   = $(CCCFG) -i=..\common
58
59
60 # ------------------------------------------------------------------------------
61 # Implicit rules
62
63 .c.obj:
64   $(CC) $(CCCFG) $<
65
66
67 # ------------------------------------------------------------------------------
68 # All library OBJ files
69
70 OBJS =  anonname.obj    \
71         asmcode.obj     \
72         asmlabel.obj    \
73         asmstmt.obj     \
74         casenode.obj    \
75         codeent.obj     \
76         codegen.obj     \
77         codelab.obj     \
78         codeinfo.obj    \
79         codeopt.obj     \
80         codeseg.obj     \
81         compile.obj     \
82         coptadd.obj     \
83         coptc02.obj     \
84         coptcmp.obj     \
85         coptind.obj     \
86         coptneg.obj     \
87         coptpush.obj    \
88         coptsize.obj    \
89         coptstop.obj    \
90         coptstore.obj   \
91         coptsub.obj     \
92         copttest.obj    \
93         cpu.obj         \
94         dataseg.obj     \
95         datatype.obj    \
96         declare.obj     \
97         declattr.obj    \
98         error.obj       \
99         expr.obj        \
100         exprheap.obj    \
101         exprnode.obj    \
102         funcdesc.obj    \
103         function.obj    \
104         global.obj      \
105         goto.obj        \
106         hexval.obj      \
107         ident.obj       \
108         incpath.obj     \
109         input.obj       \
110         lineinfo.obj    \
111         litpool.obj     \
112         locals.obj      \
113         loop.obj        \
114         macrotab.obj    \
115         main.obj        \
116         opcodes.obj     \
117         preproc.obj     \
118         pragma.obj      \
119         reginfo.obj     \
120         scanner.obj     \
121         scanstrbuf.obj  \
122         segments.obj    \
123         stdfunc.obj     \
124         stmt.obj        \
125         swstmt.obj      \
126         symentry.obj    \
127         symtab.obj      \
128         textseg.obj     \
129         typecmp.obj     \
130         util.obj
131
132 LIBS = ..\common\common.lib
133
134 .PRECIOUS $(OBJS:.obj=.c)
135
136 # ------------------------------------------------------------------------------
137 # Main targets
138
139 all:            cc65
140
141 cc65:           cc65.exe
142
143
144 # ------------------------------------------------------------------------------
145 # Other targets
146
147
148 cc65.exe:       $(OBJS) $(LIBS)
149         $(LD) system $(SYSTEM) @&&|
150 DEBUG ALL
151 OPTION QUIET
152 NAME $<
153 FILE anonname.obj
154 FILE asmcode.obj
155 FILE asmlabel.obj
156 FILE asmstmt.obj
157 FILE casenode.obj
158 FILE codeent.obj
159 FILE codegen.obj
160 FILE codelab.obj
161 FILE codeinfo.obj
162 FILE codeopt.obj
163 FILE codeseg.obj
164 FILE compile.obj
165 FILE coptadd.obj
166 FILE coptc02.obj
167 FILE coptcmp.obj
168 FILE coptind.obj
169 FILE coptneg.obj
170 FILE coptpush.obj
171 FILE coptsize.obj
172 FILE coptstop.obj
173 FILE coptstore.obj
174 FILE coptsub.obj
175 FILE copttest.obj
176 FILE cpu.obj
177 FILE dataseg.obj
178 FILE datatype.obj
179 FILE declare.obj
180 FILE declattr.obj
181 FILE error.obj
182 FILE expr.obj
183 FILE exprheap.obj
184 FILE exprnode.obj
185 FILE funcdesc.obj
186 FILE function.obj
187 FILE global.obj
188 FILE goto.obj
189 FILE hexval.obj
190 FILE ident.obj
191 FILE incpath.obj
192 FILE input.obj
193 FILE lineinfo.obj
194 FILE litpool.obj
195 FILE locals.obj
196 FILE loop.obj
197 FILE macrotab.obj
198 FILE main.obj
199 FILE opcodes.obj
200 FILE preproc.obj
201 FILE pragma.obj
202 FILE reginfo.obj
203 FILE scanner.obj
204 FILE scanstrbuf.obj
205 FILE segments.obj
206 FILE stdfunc.obj
207 FILE stmt.obj
208 FILE swstmt.obj
209 FILE symentry.obj
210 FILE symtab.obj
211 FILE textseg.obj
212 FILE typecmp.obj
213 FILE util.obj
214 LIBRARY ..\common\common.lib
215 |
216
217 clean:
218         @if exist *.obj del *.obj
219         @if exist cc65.exe del cc65.exe
220
221 strip:
222         @-wstrip cc65.exe
223
224