1*8b26181fSAndroid Build Coastguard Worker# 2*8b26181fSAndroid Build Coastguard Worker# Watcom Makefile for dos-libpcap. 3*8b26181fSAndroid Build Coastguard Worker# 4*8b26181fSAndroid Build Coastguard Worker# Specify MODEL = `3r' or `3s' 5*8b26181fSAndroid Build Coastguard Worker# Specify TARGET = `pharlap' or `dos4g' 6*8b26181fSAndroid Build Coastguard Worker# 7*8b26181fSAndroid Build Coastguard Worker# Use this makefile from the libpcap root directory. 8*8b26181fSAndroid Build Coastguard Worker# E.g. like this: 9*8b26181fSAndroid Build Coastguard Worker# 10*8b26181fSAndroid Build Coastguard Worker# c:\net\pcap> wmake -f msdos\makefile.wc 11*8b26181fSAndroid Build Coastguard Worker# 12*8b26181fSAndroid Build Coastguard Worker 13*8b26181fSAndroid Build Coastguard WorkerMODEL = 3s 14*8b26181fSAndroid Build Coastguard WorkerTARGET = dos4g 15*8b26181fSAndroid Build Coastguard Worker 16*8b26181fSAndroid Build Coastguard WorkerOBJDIR = msdos\$(TARGET).w$(MODEL) 17*8b26181fSAndroid Build Coastguard WorkerLIB = $(OBJDIR)\pcap.lib 18*8b26181fSAndroid Build Coastguard Worker 19*8b26181fSAndroid Build Coastguard Worker.EXTENSIONS: .l .y 20*8b26181fSAndroid Build Coastguard Worker 21*8b26181fSAndroid Build Coastguard WorkerDEFS = -dDEBUG -dNDIS_DEBUG -d_U_= -dHAVE_LIMITS_H -dHAVE_STRERROR & 22*8b26181fSAndroid Build Coastguard Worker -dHAVE_SNPRINTF -dHAVE_VSNPRINTF 23*8b26181fSAndroid Build Coastguard Worker 24*8b26181fSAndroid Build Coastguard WorkerCC = wcc386.exe 25*8b26181fSAndroid Build Coastguard WorkerASM = wasm.exe -$(MODEL) $(DEFS) -dDOSX -dDOS4GW -zq -bt=dos -fr=nul -d3 -s 26*8b26181fSAndroid Build Coastguard Worker 27*8b26181fSAndroid Build Coastguard WorkerOBJS = $(OBJDIR)\grammar.obj $(OBJDIR)\scanner.obj $(OBJDIR)\pcap.obj & 28*8b26181fSAndroid Build Coastguard Worker $(OBJDIR)\bpf_filter.obj $(OBJDIR)\bpf_imag.obj $(OBJDIR)\bpf_dump.obj & 29*8b26181fSAndroid Build Coastguard Worker $(OBJDIR)\etherent.obj $(OBJDIR)\gencode.obj $(OBJDIR)\nametoad.obj & 30*8b26181fSAndroid Build Coastguard Worker $(OBJDIR)\pcap-dos.obj $(OBJDIR)\pktdrvr.obj $(OBJDIR)\optimize.obj & 31*8b26181fSAndroid Build Coastguard Worker $(OBJDIR)\savefile.obj $(OBJDIR)\ndis2.obj 32*8b26181fSAndroid Build Coastguard Worker 33*8b26181fSAndroid Build Coastguard WorkerCFLAGS = $(DEFS) $(YYDEFS) -I. -I$(%watt_root)\inc -I.\msdos\pm_drvr & 34*8b26181fSAndroid Build Coastguard Worker -$(MODEL) -mf -zff -zgf -zq -bt=dos -fr=nul -w6 -fpi & 35*8b26181fSAndroid Build Coastguard Worker -oilrtf -zm 36*8b26181fSAndroid Build Coastguard Worker 37*8b26181fSAndroid Build Coastguard WorkerTEMPBIN = tmp.bin 38*8b26181fSAndroid Build Coastguard Worker 39*8b26181fSAndroid Build Coastguard Workerall: $(OBJDIR) $(OBJDIR)\pcap.lib 40*8b26181fSAndroid Build Coastguard Worker 41*8b26181fSAndroid Build Coastguard Worker$(OBJDIR): 42*8b26181fSAndroid Build Coastguard Worker - mkdir $(OBJDIR) 43*8b26181fSAndroid Build Coastguard Worker 44*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\pcap.lib: $(OBJS) wlib.arg 45*8b26181fSAndroid Build Coastguard Worker wlib -q -b -c $(OBJDIR)\pcap.lib @wlib.arg 46*8b26181fSAndroid Build Coastguard Worker 47*8b26181fSAndroid Build Coastguard Workerwlib.arg: msdos\makefile.wc 48*8b26181fSAndroid Build Coastguard Worker %create $^@ 49*8b26181fSAndroid Build Coastguard Worker for %f in ($(OBJS)) do %append $^@ +- %f 50*8b26181fSAndroid Build Coastguard Worker 51*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\pktdrvr.obj: msdos\pkt_stub.inc msdos\pktdrvr.c & 52*8b26181fSAndroid Build Coastguard Worker pcap-dos.h pcap-int.h pcap.h msdos\pktdrvr.h 53*8b26181fSAndroid Build Coastguard Worker *$(CC) $(CFLAGS) msdos\pktdrvr.c -fo=$@ 54*8b26181fSAndroid Build Coastguard Worker 55*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\bpf_filter.obj: bpf\net\bpf_filter.c 56*8b26181fSAndroid Build Coastguard Worker *$(CC) $(CFLAGS) bpf\net\bpf_filter.c -fo=$@ 57*8b26181fSAndroid Build Coastguard Worker 58*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\ndis2.obj: msdos\ndis2.c 59*8b26181fSAndroid Build Coastguard Worker *$(CC) $(CFLAGS) msdos\ndis2.c -fo=$@ 60*8b26181fSAndroid Build Coastguard Worker 61*8b26181fSAndroid Build Coastguard Worker.ERASE 62*8b26181fSAndroid Build Coastguard Worker.c{$(OBJDIR)}.obj: 63*8b26181fSAndroid Build Coastguard Worker *$(CC) $(CFLAGS) $[@ -fo=$@ 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 $[@ 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 Workerscanner.c: scanner.l 73*8b26181fSAndroid Build Coastguard Worker flex -Ppcap_ -7 -o$@ $[@ 74*8b26181fSAndroid Build Coastguard Worker 75*8b26181fSAndroid Build Coastguard Workermsdos\pkt_stub.inc: bin2c.exe msdos\pkt_rx1.S 76*8b26181fSAndroid Build Coastguard Worker nasm -fbin -dDEBUG -o $(TEMPBIN) -lmsdos\pkt_rx1.lst msdos\pkt_rx1.S 77*8b26181fSAndroid Build Coastguard Worker bin2c.exe $(TEMPBIN) > $@ 78*8b26181fSAndroid Build Coastguard Worker @del $(TEMPBIN) 79*8b26181fSAndroid Build Coastguard Worker 80*8b26181fSAndroid Build Coastguard Workerbin2c.exe: msdos\bin2c.c 81*8b26181fSAndroid Build Coastguard Worker wcl $[@ 82*8b26181fSAndroid Build Coastguard Worker 83*8b26181fSAndroid Build Coastguard Workerclean realclean vclean: .SYMBOLIC 84*8b26181fSAndroid Build Coastguard Worker for %f in (dos4g.w3r dos4g.w3s pharlap.w3r pharlap.w3s) do & 85*8b26181fSAndroid Build Coastguard Worker @del %f\*.obj 86*8b26181fSAndroid Build Coastguard Worker @del grammar.c 87*8b26181fSAndroid Build Coastguard Worker @del tokdefs.h 88*8b26181fSAndroid Build Coastguard Worker @del scanner.c 89*8b26181fSAndroid Build Coastguard Worker @del bin2c.exe 90*8b26181fSAndroid Build Coastguard Worker @del bin2c.obj 91*8b26181fSAndroid Build Coastguard Worker @del msdos\pkt_stub.inc 92*8b26181fSAndroid Build Coastguard Worker @echo Cleaned 93*8b26181fSAndroid Build Coastguard Worker 94*8b26181fSAndroid Build Coastguard Worker# 95*8b26181fSAndroid Build Coastguard Worker# dependencies 96*8b26181fSAndroid Build Coastguard Worker# 97*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\bpf_filter.obj: bpf\net\bpf_filter.c pcap-int.h pcap.h pcap-bpf.h 98*8b26181fSAndroid Build Coastguard Worker 99*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\bpf_imag.obj: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h 100*8b26181fSAndroid Build Coastguard Worker 101*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\bpf_dump.obj: bpf_dump.c pcap.h pcap-bpf.h 102*8b26181fSAndroid Build Coastguard Worker 103*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\etherent.obj: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h 104*8b26181fSAndroid Build Coastguard Worker 105*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\optimize.obj: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h 106*8b26181fSAndroid Build Coastguard Worker 107*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\savefile.obj: savefile.c pcap-int.h pcap.h pcap-bpf.h 108*8b26181fSAndroid Build Coastguard Worker 109*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\pcap.obj: pcap.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h 110*8b26181fSAndroid Build Coastguard Worker 111*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\grammar.obj: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h & 112*8b26181fSAndroid Build Coastguard Worker pcap-namedb.h 113*8b26181fSAndroid Build Coastguard Worker 114*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\scanner.obj: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h & 115*8b26181fSAndroid Build Coastguard Worker pcap-namedb.h tokdefs.h 116*8b26181fSAndroid Build Coastguard Worker 117*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\gencode.obj: gencode.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h & 118*8b26181fSAndroid Build Coastguard Worker ethertyp.h nlpid.h llc.h gencode.h atmuni31.h sunatmpo.h ppp.h sll.h & 119*8b26181fSAndroid Build Coastguard Worker arcnet.h pcap-namedb.h 120*8b26181fSAndroid Build Coastguard Worker 121*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\nametoad.obj: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h & 122*8b26181fSAndroid Build Coastguard Worker pcap-namedb.h ethertyp.h 123*8b26181fSAndroid Build Coastguard Worker 124*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\pcap-dos.obj: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h & 125*8b26181fSAndroid Build Coastguard Worker msdos\pktdrvr.h 126*8b26181fSAndroid Build Coastguard Worker 127*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\pktdrvr.obj: msdos\pktdrvr.c pcap-dos.h pcap-int.h & 128*8b26181fSAndroid Build Coastguard Worker pcap.h pcap-bpf.h msdos\pktdrvr.h msdos\pkt_stub.inc 129*8b26181fSAndroid Build Coastguard Worker 130*8b26181fSAndroid Build Coastguard Worker$(OBJDIR)\ndis2.obj: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h & 131*8b26181fSAndroid Build Coastguard Worker msdos\ndis2.h 132*8b26181fSAndroid Build Coastguard Worker 133