]> git.sur5r.net Git - cc65/blob - src/ca65/make/watcom.mak
Changed the object file and library format. There is now an additional
[cc65] / src / ca65 / make / watcom.mak
1 #
2 # CA65 Makefile for the Watcom compiler (using GNU make)
3 #
4
5 # ------------------------------------------------------------------------------
6 # Generic stuff
7
8 AR      = WLIB
9 LD      = WLINK
10 LNKCFG  = ld.tmp
11
12 # --------------------- OS2 ---------------------
13 ifeq ($(TARGET),OS2)
14 SYSTEM  = os2v2
15 CC      = WCC386
16 CFLAGS  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
17 endif
18
19 # -------------------- DOS4G --------------------
20 ifeq ($(TARGET),DOS32)
21 SYSTEM  = dos4g
22 CC      = WCC386
23 CFLAGS  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
24 endif
25
26 # --------------------- NT ----------------------
27 ifeq ($(TARGET),NT)
28 SYSTEM  = nt
29 CC      = WCC386
30 CFLAGS  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
31 endif
32
33 # Add the include dir
34 CFLAGS  += -i=..\common
35
36 # ------------------------------------------------------------------------------
37 # Implicit rules
38
39 %.obj:  %.c
40         $(CC) $(CFLAGS) $^
41
42
43 # ------------------------------------------------------------------------------
44 # All library OBJ files
45
46 OBJS =  condasm.obj     \
47         dbginfo.obj     \
48         ea.obj          \
49         error.obj       \
50         expr.obj        \
51         feature.obj     \
52         filetab.obj     \
53         fragment.obj    \
54         global.obj      \
55         incpath.obj     \
56         instr.obj       \
57         istack.obj      \
58         lineinfo.obj    \
59         listing.obj     \
60         macpack.obj     \
61         macro.obj       \
62         main.obj        \
63         nexttok.obj     \
64         objcode.obj     \
65         objfile.obj     \
66         options.obj     \
67         pseudo.obj      \
68         repeat.obj      \
69         scanner.obj     \
70         spool.obj       \
71         symtab.obj      \
72         toklist.obj     \
73         ulabel.obj
74
75 LIBS = ..\common\common.lib
76
77
78 # ------------------------------------------------------------------------------
79 # Main targets
80
81 all:            ca65
82
83 ca65:           ca65.exe
84
85
86 # ------------------------------------------------------------------------------
87 # Other targets
88
89
90 ca65.exe:       $(OBJS) $(LIBS)
91         @echo DEBUG ALL > $(LNKCFG)
92         @echo OPTION QUIET >> $(LNKCFG)
93         @echo NAME $@ >> $(LNKCFG)
94         @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG)
95         @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG)
96         $(LD) system $(SYSTEM) @$(LNKCFG)
97         @rm $(LNKCFG)
98
99 clean:
100         @if exist *.obj del *.obj
101         @if exist ca65.exe del ca65.exe
102
103 strip:
104         @-wstrip ca65.exe
105