]> git.sur5r.net Git - cc65/blob - src/common/make/watcom.mak
abcf831ab9dc9ac90c8f3b1e38d092de45dee9ff
[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         intstack.obj    \
73         matchpat.obj    \
74         mmodel.obj      \
75         print.obj       \
76         searchpath.obj  \
77         segdefs.obj     \
78         segnames.obj    \
79         shift.obj       \
80         strbuf.obj      \
81         strpool.obj     \
82         strstack.obj    \
83         strutil.obj     \
84         target.obj      \
85         tgttrans.obj    \
86         xmalloc.obj     \
87         xsprintf.obj
88
89
90 # ------------------------------------------------------------------------------
91 # Main targets
92
93 all:    lib
94
95 lib:    $(LIB)
96
97 $(LIB): $(OBJS)
98         @echo Creating library...
99         $(AR) -q -b -P=32 $(LIB) $(foreach OBJ, $(OBJS), +-$(OBJ))
100         @echo Done!
101
102 clean:
103         @rm -f *~ core
104
105 zap:    clean
106         @rm -f *.obj $(LIB)
107
108 strip:
109         @true
110
111
112
113