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