]> git.sur5r.net Git - cc65/blob - src/ld65/make/watcom.mak
Watcom fixes
[cc65] / src / ld65 / make / watcom.mak
1 #
2 # ld65 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 OBJ files
69
70 OBJS =  bin.obj         \
71         binfmt.obj      \
72         condes.obj      \
73         config.obj      \
74         dbgsyms.obj     \
75         error.obj       \
76         exports.obj     \
77         expr.obj        \
78         extsyms.obj     \
79         fileio.obj      \
80         fragment.obj    \
81         global.obj      \
82         library.obj     \
83         main.obj        \
84         mapfile.obj     \
85         o65.obj         \
86         objdata.obj     \
87         objfile.obj     \
88         scanner.obj     \
89         segments.obj    \
90         tgtcfg.obj
91
92 LIBS = ..\common\common.lib
93
94
95 # ------------------------------------------------------------------------------
96 # Main targets
97
98 all:            ld65
99
100 ld65:           ld65.exe
101
102
103 # ------------------------------------------------------------------------------
104 # Other targets
105
106
107 ld65.exe:       $(OBJS) $(LIBS)
108         $(LD) system $(SYSTEM) @&&|
109 DEBUG ALL
110 OPTION QUIET
111 NAME $<
112 FILE bin.obj
113 FILE binfmt.obj
114 FILE condes.obj
115 FILE config.obj
116 FILE dbgsyms.obj
117 FILE error.obj
118 FILE exports.obj
119 FILE expr.obj
120 FILE extsyms.obj
121 FILE fileio.obj
122 FILE fragment.obj
123 FILE global.obj
124 FILE library.obj
125 FILE main.obj
126 FILE mapfile.obj
127 FILE o65.obj
128 FILE objdata.obj
129 FILE objfile.obj
130 FILE scanner.obj
131 FILE segments.obj
132 FILE tgtcfg.obj
133 LIBRARY ..\common\common.lib
134 |
135
136 clean:
137         @if exist *.obj del *.obj
138         @if exist *.obj del ld65.exe
139
140 strip:
141         @-wstrip ld65.exe
142