xref: /illumos-gate/usr/src/cmd/rcap/rcapd/Makefile (revision da3b00f42ac14fc3d37aa0e149de7e9832c37b6d)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# Copyright 2025 Hans Rosenfeld
26
27include ../../Makefile.cmd
28include ../../Makefile.cmd.64
29
30.KEEP_STATE:
31
32PROG				= rcapd
33ROOTUSRLIBRCAP			= $(ROOT)/usr/lib/rcap
34ROOTUSRLIBRCAPPROG		= $(ROOTUSRLIBRCAP)/$(PROG)
35
36COMMON_DIR=	../common
37
38MANIFEST = rcap.xml
39ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
40$(ROOTSVCSYSTEM)/rcap.xml := FILEMODE = 0444
41
42
43SRCS =	rcapd_main.c \
44	rcapd_collection.c \
45	rcapd_collection_project.c \
46	rcapd_collection_zone.c \
47	rcapd_mapping.c \
48	rcapd_rfd.c \
49	rcapd_scanner.c
50
51COMMON_SRCS = rcapd_stat.c utils.c rcapd_conf.c
52
53$(NOT_RELEASE_BUILD)CPPFLAGS	+= -DDEBUG
54CPPFLAGS			+= -DDEBUG_MSG
55CPPFLAGS			+= -I$(COMMON_DIR)
56LDLIBS			+= -lkstat -lproc -lproject -lzonecfg -lumem -lscf
57LDLIBS			+= $(EXTRA_LDLIBS)
58
59OBJS =			$(SRCS:%.c=%.o) $(COMMON_SRCS:%.c=%.o)
60
61POFILES =		$(OBJS:%.o=%.po)
62POFILE =		$(PROG).po
63
64CLEANFILES =		$(OBJS) $(COMMON_SRCS)
65
66include ../Makefile.com
67
68all: $(PROG)
69
70install: all $(ROOTUSRLIBRCAPPROG) $(ROOTUSRLIBRCAP) $(ROOTMANIFEST)
71
72$(PROG): $(OBJS)
73	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
74	$(POST_PROCESS)
75
76check: $(CHKMANIFEST)
77
78clean:
79	$(RM) $(CLEANFILES)
80
81$(POFILE): $(POFILES)
82	$(RM) $@
83	$(CAT) $(POFILES) > $@
84
85$(ROOTUSRLIBRCAP)/%: $(ROOTUSRLIBRCAP) %
86	$(INS.file)
87
88include ../../Makefile.targ
89