Home | History | Annotate | Download | only in msdos
      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 
     17 WATT_INC = $(WATT_ROOT)\inc
     18 
     19 DEFS   = -DMSDOS -DDEBUG -DNDIS_DEBUG -D_U_= -Dinline= \
     20          -DHAVE_STRERROR -DHAVE_LIMITS_H
     21 
     22 ASM    = tasm.exe -t -l -mx -m2 -DDEBUG
     23 
     24 SOURCE = 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 
     29 BORLAND_OBJ = $(SOURCE:.c=.obj) msdos\pkt_rx0.obj msdos\ndis_0.obj
     30 
     31 HIGHC_OBJ   = $(SOURCE:.c=.o32) msdos\pkt_rx0.o32
     32 
     33 all:
     34             @echo Usage: make pcap_bc.lib or pcap_hc.lib
     35 
     36 
     37 pcap_bc.lib: bcc.arg $(BORLAND_OBJ) pcap_bc
     38 
     39 
     40 pcap_hc.lib: hc386.arg $(HIGHC_OBJ)
     41             386lib $< @&&|
     42                -nowarn -nobackup -twocase -replace $(HIGHC_OBJ)
     43 |
     44 
     45 pcap_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 
     62 scanner.c: scanner.l
     63             flex -Ppcap_ -7 -oscanner.c scanner.l
     64 
     65 grammar.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 
     72 bcc.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 
     78 hc386.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 
     90 clean:
     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 #             

    105 pkt_rx0.obj:  msdos\pkt_rx0.asm
    106 
    107 bpf_filt.obj: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h gnuc.h
    108 
    109 bpf_imag.obj: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h
    110 
    111 bpf_dump.obj: bpf_dump.c pcap.h pcap-bpf.h
    112 
    113 etherent.obj: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h
    114 
    115 optimize.obj: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h
    116 
    117 savefile.obj: savefile.c pcap-int.h pcap.h pcap-bpf.h
    118 
    119 pcap.obj: pcap.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h
    120 
    121 inet.obj: inet.c pcap-int.h pcap.h pcap-bpf.h
    122 
    123 grammar.obj: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
    124   pf.h pcap-namedb.h
    125 
    126 scanner.obj: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
    127   pcap-namedb.h tokdefs.h
    128 
    129 gencode.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 
    133 nametoad.obj: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
    134   pcap-namedb.h ethertype.h
    135 
    136 pcap-dos.obj: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h \
    137   msdos\pktdrvr.h
    138 
    139 pktdrvr.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 
    142 ndis2.obj: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \
    143   msdos\ndis2.h
    144 
    145 pkt_rx0.o32:  msdos\pkt_rx0.asm
    146 
    147 bpf_filt.o32: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h gnuc.h
    148 
    149 bpf_imag.o32: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h
    150 
    151 bpf_dump.o32: bpf_dump.c pcap.h pcap-bpf.h
    152 
    153 etherent.o32: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h
    154 
    155 optimize.o32: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h
    156 
    157 savefile.o32: savefile.c pcap-int.h pcap.h pcap-bpf.h
    158 
    159 pcap.o32: pcap.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h
    160 
    161 inet.o32: inet.c pcap-int.h pcap.h pcap-bpf.h
    162 
    163 grammar.o32: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
    164   pf.h pcap-namedb.h
    165 
    166 scanner.o32: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
    167   pcap-namedb.h tokdefs.h
    168 
    169 gencode.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 
    173 nametoad.o32: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h \
    174   pcap-namedb.h ethertype.h
    175 
    176 pcap-dos.o32: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h \
    177   msdos\pktdrvr.h
    178 
    179 pktdrvr.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 
    182 ndis2.o32: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h \
    183   msdos\ndis2.h
    184 
    185