From 78c896b3b3127515478090c19447e27dc406427e Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Mon, 18 Nov 2019 06:59:50 +0000 Subject: TLDKv2 Signed-off-by: Jianfeng Tan Signed-off-by: Jielong Zhou Signed-off-by: Jian Zhang Signed-off-by: Chen Zhao Change-Id: I55c39de4c6cd30f991f35631eb507f770230f08e --- test/packetdrill/Makefile.common | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 test/packetdrill/Makefile.common (limited to 'test/packetdrill/Makefile.common') diff --git a/test/packetdrill/Makefile.common b/test/packetdrill/Makefile.common new file mode 100644 index 0000000..b614d08 --- /dev/null +++ b/test/packetdrill/Makefile.common @@ -0,0 +1,63 @@ +all: binaries + +CFLAGS = -g -Wall -Werror + +parser.o: parser.y + bison --output=parser.c --defines=parser.h --report=state parser.y + $(CC) $(CFLAGS) -c parser.c + +lexer.o: lexer.l parser.o + flex -olexer.c lexer.l + $(CC) -O2 -g -Wall -c lexer.c + +packetdrill-lib := \ + checksum.o code.o config.o hash.o hash_map.o ip_address.o ip_prefix.o \ + netdev.o net_utils.o \ + packet.o packet_socket_linux.o packet_socket_pcap.o \ + packet_checksum.o packet_parser.o packet_to_string.o \ + symbols_linux.o \ + symbols_freebsd.o \ + symbols_openbsd.o \ + symbols_netbsd.o \ + gre_packet.o icmp_packet.o ip_packet.o tcp_packet.o udp_packet.o \ + mpls_packet.o \ + run.o run_command.o run_packet.o run_system_call.o \ + script.o socket.o system.o \ + tcp_options.o tcp_options_iterator.o tcp_options_to_string.o \ + logging.o types.o lexer.o parser.o \ + fmemopen.o open_memstream.o \ + link_layer.o wire_conn.o wire_protocol.o \ + wire_client.o wire_client_netdev.o \ + wire_server.o wire_server_netdev.o \ + epoll.o pipe.o file.o so_testing.o wrap.o + +packetdrill-objs := packetdrill.o $(packetdrill-lib) + +packetdrill: $(packetdrill-objs) + $(CC) -o packetdrill -g $(packetdrill-objs) $(packetdrill-ext-libs) + +test-bins := checksum_test packet_parser_test packet_to_string_test +tests: $(test-bins) + ./checksum_test + ./packet_parser_test + ./packet_to_string_test + +binaries: packetdrill $(test-bins) + +checksum_test-objs := $(packetdrill-lib) checksum_test.o +checksum_test: $(checksum_test-objs) + $(CC) -o checksum_test $(checksum_test-objs) $(packetdrill-ext-libs) + +packet_parser_test-objs := $(packetdrill-lib) packet_parser_test.o +packet_parser_test: $(packet_parser_test-objs) + $(CC) -o packet_parser_test $(packet_parser_test-objs) \ + $(packetdrill-ext-libs) + +packet_to_string_test-objs := $(packetdrill-lib) packet_to_string_test.o +packet_to_string_test: $(packet_to_string_test-objs) + $(CC) -o packet_to_string_test $(packet_to_string_test-objs) \ + $(packetdrill-ext-libs) + +clean: + /bin/rm -f *.o packetdrill lexer.c parser.c parser.h parser.output \ + $(test-bins) -- cgit 1.2.3-korg