]> git.sur5r.net Git - cc65/blob - src/ar65/make/watcom.mak
No output when using wstrip
[cc65] / src / ar65 / make / watcom.mak
1 #
2 # ar65 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     = ar65.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 library OBJ files
62
63 OBJS =  add.obj         \
64         del.obj         \
65         error.obj       \
66         exports.obj     \
67         extract.obj     \
68         fileio.obj      \
69         global.obj      \
70         library.obj     \
71         list.obj        \
72         main.obj        \
73         objdata.obj     \
74         objfile.obj
75
76 LIBS = ../common/common.lib
77
78
79 # ------------------------------------------------------------------------------
80 # Main targets
81
82 all:            $(EXE)
83
84 # ------------------------------------------------------------------------------
85 # Other targets
86
87
88 $(EXE):         $(OBJS) $(LIBS)
89         @echo "DEBUG ALL" > $(LNKCFG)
90         @echo "OPTION QUIET" >> $(LNKCFG)
91         @echo "NAME $@" >> $(LNKCFG)
92         @for i in $(OBJS); do echo "FILE $${i}"; done >> $(LNKCFG)
93         @for i in $(LIBS); do echo "LIBRARY $${i}"; done >> $(LNKCFG)
94         @$(LD) system $(SYSTEM) @$(LNKCFG)
95         @rm $(LNKCFG)
96
97 clean:
98         @rm -f *~ core
99
100 zap:    clean
101         @rm -f *.obj $(EXE)
102
103 strip:
104         @-$(WSTRIP) $(EXE)
105