]> git.sur5r.net Git - cc65/blob - src/ld65/make/watcom.mak
Removed unneeded include files.
[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 -q
21
22 LNKCFG  = ld.tmp
23
24 # Program arguments
25 CFLAGS  = -d1 -obeilr -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) -fo=$@ $^
58
59
60 # ------------------------------------------------------------------------------
61 # All OBJ files
62
63 OBJS =  asserts.obj     \
64         bin.obj         \
65         binfmt.obj      \
66         cfgexpr.obj     \
67         condes.obj      \
68         config.obj      \
69         dbgfile.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         memarea.obj     \
85         o65.obj         \
86         objdata.obj     \
87         objfile.obj     \
88         scanner.obj     \
89         scopes.obj      \
90         segments.obj    \
91         span.obj        \
92         spool.obj       \
93         tgtcfg.obj      \
94         tpool.obj
95
96 LIBS = ../common/common.lib
97
98
99 # ------------------------------------------------------------------------------
100 # Main targets
101
102 all:            $(EXE)
103
104
105 # ------------------------------------------------------------------------------
106 # Other targets
107
108
109 $(EXE):         $(OBJS) $(LIBS)
110         @echo "DEBUG ALL" > $(LNKCFG)
111         @echo "OPTION QUIET" >> $(LNKCFG)
112         @echo "OPTION MAP" >> $(LNKCFG)
113         @echo "OPTION STACK=65536" >> $(LNKCFG)
114         @echo "NAME $@" >> $(LNKCFG)
115         @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG)
116         @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG)
117         @$(LD) system $(SYSTEM) @$(LNKCFG)
118         @rm $(LNKCFG)
119
120 clean:
121         @rm -f *~ core
122
123 zap:    clean
124         @rm -f $(OBJS) $(EXE) $(EXE:.exe=.map)
125
126 strip:
127         @-$(WSTRIP) $(EXE)
128