]> git.sur5r.net Git - cc65/blob - src/cl65/make/watcom.mak
Converted all Watcom makefiles to use GNU make
[cc65] / src / cl65 / make / watcom.mak
1 #
2 # CL65 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 =  error.obj       \
47         global.obj      \
48         main.obj
49
50 LIBS = ..\common\common.lib
51
52 # ------------------------------------------------------------------------------
53 # Main targets
54
55 all:            cl65
56
57 cl65:           cl65.exe
58
59
60 # ------------------------------------------------------------------------------
61 # Other targets
62
63
64 cl65.exe:       $(OBJS) $(LIBS)
65         @echo DEBUG ALL > $(LNKCFG)
66         @echo OPTION QUIET >> $(LNKCFG)
67         @echo NAME $@ >> $(LNKCFG)
68         @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG)
69         @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG)
70         $(LD) system $(SYSTEM) @$(LNKCFG)
71         @rm $(LNKCFG)
72
73 clean:
74         @if exist *.obj del *.obj
75         @if exist cl65.exe del cl65.exe
76
77 strip:
78         @-wstrip cl65.exe
79
80