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