]> git.sur5r.net Git - cc65/blob - src/common/make/watcom.mak
New shift module, comment fixes
[cc65] / src / common / make / watcom.mak
1 #
2 # CC65 Makefile for the Watcom compiler (using GNU make) and wine
3 #
4
5 # ------------------------------------------------------------------------------
6 # Generic stuff
7
8 # Environment variables for the watcom compiler
9 export WATCOM  = c:\\watcom
10 export INCLUDE = $(WATCOM)\\h
11
12 # We will use the windows compiler under linux (define as empty for windows)
13 WINE = wine --
14
15 # Programs
16 AR      = $(WINE) WLIB
17 CC      = $(WINE) WCC386
18 LD      = $(WINE) WLINK
19 LIB     = common.lib
20
21 # Program arguments
22 CFLAGS  = -d1 -onatx -zp4 -5 -zq -w2
23
24 # Create NT programs by default
25 ifndef TARGET
26 TARGET = NT
27 endif
28
29 # --------------------- OS2 ---------------------
30 ifeq ($(TARGET),OS2)
31 SYSTEM  = os2v2
32 CFLAGS  += -bt=$(TARGET)
33 endif
34
35 # -------------------- DOS4G --------------------
36 ifeq ($(TARGET),DOS32)
37 SYSTEM  = dos4g
38 CFLAGS  += -bt=$(TARGET)
39 endif
40
41 # --------------------- NT ----------------------
42 ifeq ($(TARGET),NT)
43 SYSTEM  = nt
44 CFLAGS  += -bt=$(TARGET)
45 endif
46
47 # ------------------------------------------------------------------------------
48 # Implicit rules
49
50 %.obj:  %.c
51         $(CC) $(CFLAGS) $^
52
53
54 # ------------------------------------------------------------------------------
55 # All library OBJ files
56
57 OBJS =  abend.obj       \
58         addrsize.obj    \
59         bitops.obj      \
60         chartype.obj    \
61         check.obj       \
62         cmdline.obj     \
63         coll.obj        \
64         cpu.obj         \
65         debugflag.obj   \
66         exprdefs.obj    \
67         filepos.obj     \
68         filetype.obj    \
69         fname.obj       \
70         hashstr.obj     \
71         hashtab.obj     \
72         matchpat.obj    \
73         print.obj       \
74         searchpath.obj  \
75         segdefs.obj     \
76         segnames.obj    \
77         shift.obj       \
78         strbuf.obj      \
79         strpool.obj     \
80         strutil.obj     \
81         target.obj      \
82         tgttrans.obj    \
83         xmalloc.obj     \
84         xsprintf.obj
85
86
87 # ------------------------------------------------------------------------------
88 # Main targets
89
90 all:    lib
91
92 lib:    $(LIB)
93
94 $(LIB): $(OBJS)
95         @echo Creating library...
96         $(AR) -q -b -P=32 $(LIB) $(foreach OBJ, $(OBJS), +-$(OBJ))
97         @echo Done!
98
99 clean:
100         @rm -f *~ core
101
102 zap:    clean
103         @rm -f *.obj $(LIB)
104
105 strip:
106         @true
107
108
109
110