]> git.sur5r.net Git - cc65/blob - src/od65/make/watcom.mak
Use "override" when appending to CFLAGS, so this works even when CFLAGS is
[cc65] / src / od65 / make / watcom.mak
1 #
2 # OD65 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 -onatx -zp4 -5 -zq -w2 -i=..\\common
26
27 # Target files
28 EXE     = od65.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 =  dump.obj        \
64         error.obj       \
65         fileio.obj      \
66         global.obj      \
67         main.obj
68
69 LIBS = ../common/common.lib
70
71
72 # ------------------------------------------------------------------------------
73 # Main targets
74
75 all:            $(EXE)
76
77
78 # ------------------------------------------------------------------------------
79 # Other targets
80
81
82 $(EXE):         $(OBJS) $(LIBS)
83         @echo "DEBUG ALL" > $(LNKCFG)
84         @echo "OPTION QUIET" >> $(LNKCFG)
85         @echo "NAME $@" >> $(LNKCFG)
86         @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG)
87         @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG)
88         @$(LD) system $(SYSTEM) @$(LNKCFG)
89         @rm $(LNKCFG)
90
91 clean:
92         @rm -f *~ core
93
94 zap:    clean
95         @rm -f *.obj $(EXE)
96
97 strip:
98         @-$(WSTRIP) $(EXE)
99