wm: dnsparser

ref: 272dec2602bfb557af9464d21426d195b8e8e1a5
dir: /Makefile/

View raw version
CC=cc 
CFLAGS += -O0 -pg -g -Wall -lcrypto -lssl -lpcap -Wno-pointer-sign -Wno-discarded-qualifiers
NROFF=mandoc

Lib=\
	common.o\
	ether.o\
	pkt.o\
	udp.o\
	tcp.o\
	dns.o\
	tls.o\
	der.o\

DnsParser=	dnsparser.o
TlsParser=	tlsparser.o
TlsCertParser= tlscertparser.o

all:
	@echo 'make dnsparser, tlsparser, tests or docs'

%.o: %.c %.h
	$(CC) $(CFLAGS) -c $< -o $@

tests: ${Lib} dnsparser tlsparser
	tests/tests.sh

dnsparser: ${Lib} ${DnsParser}
	$(CC) $(CFLAGS) -o $@ ${DnsParser} ${Lib}

tlsparser: ${Lib} ${TlsParser}
	$(CC) $(CFLAGS) -o $@ ${TlsParser} ${Lib}

tlscertparser: ${Lib} ${TlsCertParser} cert.o
	$(CC) $(CFLAGS) -o $@ ${TlsCertParser} ${Lib} cert.o

tlsparser.v2: ${Lib} tlsparser.v2.o cert.o
	$(CC) $(CFLAGS) -o $@ tlsparser.v2.o ${Lib} cert.o

tlsparser.v3: ${Lib} tlsparser.v3.o cert.o
	$(CC) $(CFLAGS) -o $@ tlsparser.v3.o ${Lib} cert.o

docs:
	$(NROFF) docs/parser.man | col -b > docs/parser.txt
	
clean:
	rm -f *.o dnsparser tlsparser tlscertparser