xref: /freebsd/contrib/libpcap/msdos/makefile (revision 87b759f0fa1f7554d50ce640c40138512bbded44)
1#
2#  Makefile for dos-libpcap. NB. This makefile requires a Borland
3#  compatible make tool.
4#
5#  Targets:
6#    Borland C 4.0+      (DOS large model)
7#    Metaware HighC 3.3+ (PharLap 386|DosX)
8#
9
10.AUTODEPEND
11.SWAP
12
13!if "$(WATT_ROOT)" == ""
14!error Environment variable "WATT_ROOT" not set.
15!endif
16
17WATT_INC = $(WATT_ROOT)\inc
18
19DEFS   = -DMSDOS -DDEBUG -DNDIS_DEBUG -D_U_= -Dinline= \
20         -DHAVE_STRERROR -DHAVE_LIMITS_H
21
22ASM    = tasm.exe -t -l -mx -m2 -DDEBUG
23
24SOURCE = grammar.c  scanner.c bpf_filt.c bpf_imag.c bpf_dump.c \
25         etherent.c gencode.c nametoad.c pcap-dos.c optimize.c \
26         savefile.c pcap.c msdos\ndis2.c msdos\pktdrvr.c \
27         missing\snprintf.c
28
29BORLAND_OBJ = $(SOURCE:.c=.obj) msdos\pkt_rx0.obj msdos\ndis_0.obj
30
31HIGHC_OBJ   = $(SOURCE:.c=.o32) msdos\pkt_rx0.o32
32
33all:
34            @echo Usage: make pcap_bc.lib or pcap_hc.lib
35
36
37pcap_bc.lib: bcc.arg $(BORLAND_OBJ) pcap_bc
38
39
40pcap_hc.lib: hc386.arg $(HIGHC_OBJ)
41            386lib $< @&&|
42               -nowarn -nobackup -twocase -replace $(HIGHC_OBJ)
43|
44
45pcap_bc:    $(BORLAND_OBJ)
46            @tlib pcap_bc.lib /C @&&|
47               -+$(**:.obj=-+)
48|
49
50.c.obj:
51            bcc.exe @bcc.arg -o$*.obj $*.c
52
53.c.o32:
54            hc386.exe @hc386.arg -o $*.o32 $*.c
55
56.asm.obj:
57            $(ASM) $*.asm, $*.obj
58
59.asm.o32:
60            $(ASM) -DDOSX=1 $*.asm, $*.o32
61
62scanner.c: scanner.l
63            flex -Ppcap_ -7 -oscanner.c scanner.l
64
65grammar.c tokdefs.h: grammar.y
66            bison --name-prefix=pcap_ --yacc --defines grammar.y
67            - @del grammar.c
68            - @del tokdefs.h
69            ren y_tab.c grammar.c
70            ren y_tab.h tokdefs.h
71
72bcc.arg:    msdos\Makefile
73            @copy &&|
74              $(DEFS) -ml -c -v -3 -O2 -po -RT- -w-
75              -I$(WATT_INC) -I. -I.\msdos\pm_drvr -H=$(TEMP)\bcc.sym
76| $<
77
78hc386.arg:  msdos\Makefile
79            @copy &&|
80            # -DUSE_32BIT_DRIVERS
81              $(DEFS) -DDOSX=1 -w3 -c -g -O5
82              -I$(WATT_INC) -I. -I.\msdos\pm_drvr
83              -Hsuffix=.o32
84              -Hnocopyr
85              -Hpragma=Offwarn(491,553,572)
86              -Hon=Recognize_library  # make memcpy/strlen etc. inline
87              -Hoff=Behaved           # turn off some optimizer warnings
88| $<
89
90clean:
91            @del *.obj
92            @del *.o32
93            @del *.lst
94            @del *.map
95            @del bcc.arg
96            @del hc386.arg
97            @del grammar.c
98            @del tokdefs.h
99            @del scanner.c
100            @echo Cleaned
101
102#
103# dependencies
104#
105pkt_rx0.obj:  msdos\pkt_rx0.asm
106
107bpf_filt.obj: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h
108
109bpf_imag.obj: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h
110
111bpf_dump.obj: bpf_dump.c pcap.h pcap-bpf.h
112
113etherent.obj: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h
114
115optimize.obj: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h
116
117savefile.obj: savefile.c pcap-int.h pcap.h pcap-bpf.h
118
119pcap.obj: pcap.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h
120
121grammar.obj: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
122  pf.h pcap-namedb.h
123
124scanner.obj: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
125  pcap-namedb.h tokdefs.h
126
127gencode.obj: gencode.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \
128  ethertype.h nlpid.h llc.h gencode.h atmuni31.h sunatmpos.h ppp.h sll.h \
129  arcnet.h pf.h pcap-namedb.h
130
131nametoad.obj: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
132  pcap-namedb.h ethertype.h
133
134pcap-dos.obj: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h \
135  msdos\pktdrvr.h
136
137pktdrvr.obj: msdos\pktdrvr.c pcap-dos.h pcap-int.h \
138  pcap.h pcap-bpf.h msdos\pktdrvr.h msdos\pkt_stub.inc
139
140ndis2.obj: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \
141  msdos\ndis2.h
142
143pkt_rx0.o32:  msdos\pkt_rx0.asm
144
145bpf_filt.o32: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h
146
147bpf_imag.o32: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h
148
149bpf_dump.o32: bpf_dump.c pcap.h pcap-bpf.h
150
151etherent.o32: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h
152
153optimize.o32: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h
154
155savefile.o32: savefile.c pcap-int.h pcap.h pcap-bpf.h
156
157pcap.o32: pcap.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h
158
159grammar.o32: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
160  pf.h pcap-namedb.h
161
162scanner.o32: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
163  pcap-namedb.h tokdefs.h
164
165gencode.o32: gencode.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \
166  ethertype.h nlpid.h llc.h gencode.h atmuni31.h sunatmpos.h ppp.h sll.h \
167  arcnet.h pf.h pcap-namedb.h
168
169nametoad.o32: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
170  pcap-namedb.h ethertype.h
171
172pcap-dos.o32: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h \
173  msdos\pktdrvr.h
174
175pktdrvr.o32: msdos\pktdrvr.c pcap-dos.h pcap-int.h \
176  pcap.h pcap-bpf.h msdos\pktdrvr.h msdos\pkt_stub.inc
177
178ndis2.o32: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \
179  msdos\ndis2.h
180
181