1 #
2 # CDDL HEADER START
3 #
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
8 #
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
12 #
13 # CDDL HEADER END
14 #
15 #
16 # Copyright (c) 2015 by Delphix. All rights reserved.
17 #
18
19 PROG= connstat
20 OBJS= connstat_main.o connstat_mib.o connstat_tcp.o
21 SRCS= $(OBJS:%.o=%.c)
22 POFILES= connstat_main.po connstat_tcp.po connstat_mib.po
23 POFILE= connstat.po
24
25 include ../Makefile.cmd
26
27 CSTD= $(CSTD_GNU99)
28 C99LMODE= -Xc99=%all
29 LDLIBS += -lsocket -lnsl -linetutil -lumem
30 XGETFLAGS += -a -x $(PROG).xcl
31
32 #
33 # Instrument connstat with CTF data to ease debugging.
34 #
35 CTFCONVERT_HOOK = && $(CTFCONVERT_O)
36 CTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(OBJS)
37 $(OBJS) := CFLAGS += $(CTF_FLAGS)
38
39 .KEEP_STATE:
40
41 all: $(PROG)
42
43 $(PROG): $(OBJS)
44 $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
45 $(POST_PROCESS)
46
47 $(POFILE): $(POFILES)
48 $(RM) $@
49 cat $(POFILES) > $@
50
51 install: all $(ROOTPROG)
52
53 clean:
54 $(RM) $(OBJS)
55
56 lint: lint_SRCS
57
58 include ../Makefile.targ