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 inet.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 optimiser 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 gnuc.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 121inet.obj: inet.c pcap-int.h pcap.h pcap-bpf.h 122 123grammar.obj: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h \ 124 pf.h pcap-namedb.h 125 126scanner.obj: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h \ 127 pcap-namedb.h tokdefs.h 128 129gencode.obj: gencode.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \ 130 ethertype.h nlpid.h llc.h gencode.h atmuni31.h sunatmpos.h ppp.h sll.h \ 131 arcnet.h pf.h pcap-namedb.h 132 133nametoad.obj: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h \ 134 pcap-namedb.h ethertype.h 135 136pcap-dos.obj: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h \ 137 msdos\pktdrvr.h 138 139pktdrvr.obj: msdos\pktdrvr.c gnuc.h pcap-dos.h pcap-int.h \ 140 pcap.h pcap-bpf.h msdos\pktdrvr.h msdos\pkt_stub.inc 141 142ndis2.obj: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \ 143 msdos\ndis2.h 144 145pkt_rx0.o32: msdos\pkt_rx0.asm 146 147bpf_filt.o32: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h gnuc.h 148 149bpf_imag.o32: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h 150 151bpf_dump.o32: bpf_dump.c pcap.h pcap-bpf.h 152 153etherent.o32: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h 154 155optimize.o32: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h 156 157savefile.o32: savefile.c pcap-int.h pcap.h pcap-bpf.h 158 159pcap.o32: pcap.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h 160 161inet.o32: inet.c pcap-int.h pcap.h pcap-bpf.h 162 163grammar.o32: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h \ 164 pf.h pcap-namedb.h 165 166scanner.o32: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h \ 167 pcap-namedb.h tokdefs.h 168 169gencode.o32: gencode.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \ 170 ethertype.h nlpid.h llc.h gencode.h atmuni31.h sunatmpos.h ppp.h sll.h \ 171 arcnet.h pf.h pcap-namedb.h 172 173nametoad.o32: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h \ 174 pcap-namedb.h ethertype.h 175 176pcap-dos.o32: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h \ 177 msdos\pktdrvr.h 178 179pktdrvr.o32: msdos\pktdrvr.c gnuc.h pcap-dos.h pcap-int.h \ 180 pcap.h pcap-bpf.h msdos\pktdrvr.h msdos\pkt_stub.inc 181 182ndis2.o32: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \ 183 msdos\ndis2.h 184 185