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