]> git.sur5r.net Git - cc65/blob - src/ld65/make/watcom.mak
Suppress wine debug output
[cc65] / src / ld65 / make / watcom.mak
1 #
2 # ld65 Makefile for the Watcom compiler (using GNU make)
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 WSTRIP  = $(WINE) WSTRIP
21
22 LNKCFG  = ld.tmp
23
24 # Program arguments
25 CFLAGS  = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common
26
27 # Target files
28 EXE     = ld65.exe
29
30 # Create NT programs by default
31 ifndef TARGET
32 TARGET = NT
33 endif
34
35 # --------------------- OS2 ---------------------
36 ifeq ($(TARGET),OS2)
37 SYSTEM  = os2v2
38 CFLAGS  += -bt=$(TARGET)
39 endif
40
41 # -------------------- DOS4G --------------------
42 ifeq ($(TARGET),DOS32)
43 SYSTEM  = dos4g
44 CFLAGS  += -bt=$(TARGET)
45 endif
46
47 # --------------------- NT ----------------------
48 ifeq ($(TARGET),NT)
49 SYSTEM  = nt
50 CFLAGS  += -bt=$(TARGET)
51 endif
52
53 # ------------------------------------------------------------------------------
54 # Implicit rules
55
56 %.obj:  %.c
57         $(CC) $(CFLAGS) $^
58
59
60 # ------------------------------------------------------------------------------
61 # All OBJ files
62
63 OBJS =  asserts.obj     \
64         bin.obj         \
65         binfmt.obj      \
66         condes.obj      \
67         config.obj      \
68         dbgfile.obj     \
69         dbginfo.obj     \
70         dbgsyms.obj     \
71         error.obj       \
72         exports.obj     \
73         expr.obj        \
74         extsyms.obj     \
75         fileinfo.obj    \
76         fileio.obj      \
77         filepath.obj    \
78         fragment.obj    \
79         global.obj      \
80         library.obj     \
81         lineinfo.obj    \
82         main.obj        \
83         mapfile.obj     \
84         o65.obj         \
85         objdata.obj     \
86         objfile.obj     \
87         scanner.obj     \
88         segments.obj    \
89         spool.obj       \
90         tgtcfg.obj
91
92 LIBS = ../common/common.lib
93
94
95 # ------------------------------------------------------------------------------
96 # Main targets
97
98 all:            $(EXE)
99
100
101 # ------------------------------------------------------------------------------
102 # Other targets
103
104
105 $(EXE):         $(OBJS) $(LIBS)
106         @echo "DEBUG ALL" > $(LNKCFG)
107         @echo "OPTION QUIET" >> $(LNKCFG)
108         @echo "NAME $@" >> $(LNKCFG)
109         @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG)
110         @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG)
111         @$(LD) system $(SYSTEM) @$(LNKCFG)
112         @rm $(LNKCFG)
113
114 clean:
115         @rm -f *~ core
116
117 zap:    clean
118         @rm -f *.obj $(EXE)
119
120 strip:
121         @-$(WSTRIP) $(EXE)
122