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