]> git.sur5r.net Git - cc65/blob - src/od65/make/watcom.mak
Converted all Watcom makefiles to use GNU make
[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 AR      = WLIB
9 LD      = WLINK
10 LNKCFG  = ld.tmp
11
12 # --------------------- OS2 ---------------------
13 ifeq ($(TARGET),OS2)
14 SYSTEM  = os2v2
15 CC      = WCC386
16 CFLAGS  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
17 endif
18
19 # -------------------- DOS4G --------------------
20 ifeq ($(TARGET),DOS32)
21 SYSTEM  = dos4g
22 CC      = WCC386
23 CFLAGS  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
24 endif
25
26 # --------------------- NT ----------------------
27 ifeq ($(TARGET),NT)
28 SYSTEM  = nt
29 CC      = WCC386
30 CFLAGS  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
31 endif
32
33 # Add the include dir
34 CFLAGS  += -i=..\common
35
36 # ------------------------------------------------------------------------------
37 # Implicit rules
38
39 %.obj:  %.c
40         $(CC) $(CFLAGS) $^
41
42
43 # ------------------------------------------------------------------------------
44 # All library OBJ files
45
46 OBJS =  dump.obj        \
47         error.obj       \
48         fileio.obj      \
49         global.obj      \
50         main.obj
51
52 LIBS = ..\common\common.lib
53
54
55 # ------------------------------------------------------------------------------
56 # Main targets
57
58 all:            od65
59
60 .PHONY:         od65
61
62 od65:           od65.exe
63
64
65 # ------------------------------------------------------------------------------
66 # Other targets
67
68
69 od65.exe:       $(OBJS) $(LIBS)
70         @echo DEBUG ALL > $(LNKCFG)
71         @echo OPTION QUIET >> $(LNKCFG)
72         @echo NAME $@ >> $(LNKCFG)
73         @for %%i in ($(OBJS)) do echo FILE %%i >> $(LNKCFG)
74         @for %%i in ($(LIBS)) do echo LIBRARY %%i >> $(LNKCFG)
75         $(LD) system $(SYSTEM) @$(LNKCFG)
76         @rm $(LNKCFG)
77
78 clean:
79         @if exist *.obj del *.obj
80         @if exist od65.exe del od65.exe
81
82 strip:
83         @-wstrip od65.exe
84