]> git.sur5r.net Git - cc65/blob - src/ld65/make/watcom.mak
Added assertions
[cc65] / src / ld65 / make / watcom.mak
1 #
2 # ld65 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 OBJ files
45
46 OBJS =  asserts.obj     \
47         bin.obj         \
48         binfmt.obj      \
49         condes.obj      \
50         config.obj      \
51         dbginfo.obj     \
52         dbgsyms.obj     \
53         error.obj       \
54         exports.obj     \
55         expr.obj        \
56         extsyms.obj     \
57         fileinfo.obj    \
58         fileio.obj      \
59         filepath.obj    \
60         fragment.obj    \
61         global.obj      \
62         library.obj     \
63         lineinfo.obj    \
64         main.obj        \
65         mapfile.obj     \
66         o65.obj         \
67         objdata.obj     \
68         objfile.obj     \
69         scanner.obj     \
70         segments.obj    \
71         spool.obj       \
72         tgtcfg.obj
73
74 LIBS = ..\common\common.lib
75
76
77 # ------------------------------------------------------------------------------
78 # Main targets
79
80 all:            ld65
81
82 ld65:           ld65.exe
83
84
85 # ------------------------------------------------------------------------------
86 # Other targets
87
88
89 ld65.exe:       $(OBJS) $(LIBS)
90         @echo DEBUG ALL > $(LNKCFG)
91         @echo OPTION QUIET >> $(LNKCFG)
92         @echo NAME $@ >> $(LNKCFG)
93         @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG)
94         @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG)
95         $(LD) system $(SYSTEM) @$(LNKCFG)
96         @rm $(LNKCFG)
97
98
99 clean:
100         @if exist *.obj del *.obj
101         @if exist *.obj del ld65.exe
102
103 strip:
104         @-wstrip ld65.exe
105