]> git.sur5r.net Git - cc65/blob - src/common/make/watcom.mak
Moved the segdefs module to ca65, since it was used only there and renamed it
[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 export WINEDEBUG=fixme-all
14 WINE    = wine
15
16 # Programs
17 AR      = $(WINE) wlib
18 CC      = $(WINE) wcc386
19 LD      = $(WINE) wlink
20 LIB     = common.lib
21
22 # Program arguments
23 CFLAGS  = -d1 -obeilr -zp4 -5 -zq -w2
24
25 # Create NT programs by default
26 ifndef TARGET
27 TARGET = NT
28 endif
29
30 # --------------------- OS2 ---------------------
31 ifeq ($(TARGET),OS2)
32 SYSTEM  = os2v2
33 CFLAGS  += -bt=$(TARGET)
34 endif
35
36 # -------------------- DOS4G --------------------
37 ifeq ($(TARGET),DOS32)
38 SYSTEM  = dos4g
39 CFLAGS  += -bt=$(TARGET)
40 endif
41
42 # --------------------- NT ----------------------
43 ifeq ($(TARGET),NT)
44 SYSTEM  = nt
45 CFLAGS  += -bt=$(TARGET)
46 endif
47
48 # ------------------------------------------------------------------------------
49 # Implicit rules
50
51 %.obj:  %.c
52         $(CC) $(CFLAGS) -fo=$@ $^
53
54
55 # ------------------------------------------------------------------------------
56 # All library OBJ files
57
58 OBJS =  abend.obj       \
59         addrsize.obj    \
60         alignment.obj   \
61         assertion.obj   \
62         bitops.obj      \
63         chartype.obj    \
64         check.obj       \
65         cmdline.obj     \
66         coll.obj        \
67         cpu.obj         \
68         debugflag.obj   \
69         exprdefs.obj    \
70         filepos.obj     \
71         filetype.obj    \
72         fname.obj       \
73         fp.obj          \
74         gentype.obj     \
75         hashfunc.obj    \
76         hashtab.obj     \
77         intstack.obj    \
78         matchpat.obj    \
79         mmodel.obj      \
80         print.obj       \
81         searchpath.obj  \
82         segnames.obj    \
83         shift.obj       \
84         strbuf.obj      \
85         strpool.obj     \
86         strstack.obj    \
87         strutil.obj     \
88         target.obj      \
89         tgttrans.obj    \
90         version.obj     \
91         wildargv.obj    \
92         xmalloc.obj     \
93         xsprintf.obj
94
95
96 # ------------------------------------------------------------------------------
97 # Main targets
98
99 all:    lib
100
101 lib:    $(LIB)
102
103 $(LIB): $(OBJS)
104         @echo Creating library...
105         $(AR) -q -b -P=32 $(LIB) $(foreach OBJ, $(OBJS), +-$(OBJ))
106         @echo Done!
107
108 wildargv.obj:
109         $(CC) $(CFLAGS) -fo=$@ $(WATCOM)\\src\\startup\\wildargv.c
110
111 clean:
112         @rm -f *~ core
113
114 zap:    clean
115         @rm -f *.obj $(LIB)
116
117 strip:
118         @true
119
120
121
122