]> git.sur5r.net Git - cc65/blob - src/grc/make/watcom.mak
Convert the watcom makefiles for use with wine under Linux
[cc65] / src / grc / make / watcom.mak
1 #
2 # GRC 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 WINE = wine --
14
15 # Programs
16 AR      = $(WINE) WLIB
17 CC      = $(WINE) WCC386
18 LD      = $(WINE) WLINK
19 WSTRIP  = $(WINE) WSTRIP
20
21 LNKCFG  = ld.tmp
22
23 # Program arguments
24 CFLAGS  = -d1 -onatx -zp4 -5 -zq -w2 -i=..\\common
25
26 # Target files
27 EXE     = grc.exe
28
29 # Create NT programs by default
30 ifndef TARGET
31 TARGET = NT
32 endif
33
34 # --------------------- OS2 ---------------------
35 ifeq ($(TARGET),OS2)
36 SYSTEM  = os2v2
37 CFLAGS  += -bt=$(TARGET)
38 endif
39
40 # -------------------- DOS4G --------------------
41 ifeq ($(TARGET),DOS32)
42 SYSTEM  = dos4g
43 CFLAGS  += -bt=$(TARGET)
44 endif
45
46 # --------------------- NT ----------------------
47 ifeq ($(TARGET),NT)
48 SYSTEM  = nt
49 CFLAGS  += -bt=$(TARGET)
50 endif
51
52 # ------------------------------------------------------------------------------
53 # Implicit rules
54
55 %.obj:  %.c
56         $(CC) $(CFLAGS) $^
57
58
59 # ------------------------------------------------------------------------------
60 # All OBJ files
61
62 OBJS =  grc.obj
63
64 LIBS = ../common/common.lib
65
66
67 # ------------------------------------------------------------------------------
68 # Main targets
69
70 all:            $(EXE)
71
72
73 # ------------------------------------------------------------------------------
74 # Other targets
75
76
77 $(EXE):         $(OBJS) $(LIBS)
78         @echo "DEBUG ALL" > $(LNKCFG)
79         @echo "OPTION QUIET" >> $(LNKCFG)
80         @echo "NAME $@" >> $(LNKCFG)
81         @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG)
82         @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG)
83         @$(LD) system $(SYSTEM) @$(LNKCFG)
84         @rm $(LNKCFG)
85
86 clean:
87         @rm -f *~ core
88
89 zap:    clean
90         @rm -f *.obj $(EXE)
91
92 strip:
93         @-$(WSTRIP) $(EXE)
94