]> git.sur5r.net Git - cc65/blob - src/common/make/watcom.mak
Converted the makefile to use wine under Linux
[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         bitops.obj      \
59         chartype.obj    \
60         check.obj       \
61         cmdline.obj     \
62         coll.obj        \
63         cpu.obj         \
64         debugflag.obj   \
65         exprdefs.obj    \
66         filepos.obj     \
67         filetype.obj    \
68         fname.obj       \
69         hashstr.obj     \
70         hashtab.obj     \
71         matchpat.obj    \
72         print.obj       \
73         searchpath.obj  \
74         segdefs.obj     \
75         segnames.obj    \
76         strbuf.obj      \
77         strpool.obj     \
78         strutil.obj     \
79         target.obj      \
80         tgttrans.obj    \
81         xmalloc.obj     \
82         xsprintf.obj
83
84
85 # ------------------------------------------------------------------------------
86 # Main targets
87
88 all:    lib
89
90 lib:    $(LIB)
91
92 $(LIB): $(OBJS)
93         @echo Creating library...
94         $(AR) -q -b -P=32 $(LIB) $(foreach OBJ, $(OBJS), +-$(OBJ))
95         @echo Done!
96
97 clean:
98         @if exist *.obj del *.obj
99         @if exist $(LIB) del $(LIB)
100
101
102