Makefile revision 251139
1#
2# $FreeBSD: head/tools/tools/netmap/Makefile 251139 2013-05-30 14:07:14Z luigi $
3#
4# For multiple programs using a single source file each,
5# we can just define 'progs' and create custom targets.
6PROGS	=	pkt-gen bridge vale-ctl testpcap libnetmap.so
7
8CLEANFILES = $(PROGS) pcap.o nm_util.o
9NO_MAN=
10CFLAGS += -Werror -Wall -nostdinc -I/usr/include -I../../../sys
11CFLAGS += -Wextra
12
13LDFLAGS += -lpthread -lpcap
14
15.include <bsd.prog.mk>
16.include <bsd.lib.mk>
17
18all: $(PROGS)
19
20pkt-gen bridge: nm_util.o
21	$(CC) $(CFLAGS) -o ${.TARGET} ${.TARGET:=.c} nm_util.o $(LDFLAGS)
22
23testpcap: pcap.c libnetmap.so
24	$(CC) $(CFLAGS) -DTEST -L. -lnetmap -o ${.TARGET} pcap.c
25	
26libnetmap.so:	pcap.c nm_util.c
27	$(CC) $(CFLAGS) -fpic -c ${.ALLSRC}
28	$(CC) -shared -o ${.TARGET} ${.ALLSRC:.c=.o}
29