xref: /illumos-gate/usr/src/tools/svc/svccfg/Makefile (revision 9b9d39d2a32ff806d2431dbcc50968ef1e6d46b2)
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#
23# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24# Copyright 2020 Joyent, Inc.
25#
26
27include $(SRC)/tools/Makefile.tools
28include $(SRC)/cmd/svc/svccfg/Makefile.shared.com
29
30SRCDIR = $(SRC)/cmd/svc/svccfg
31COMDIR = $(SRC)/cmd/svc/common
32
33CPPFLAGS +=	-I. -I$(SRC)/cmd/svc/svccfg -I$(SRC)/cmd/svc/common	\
34		-I$(NATIVE_ADJUNCT)/include/libxml2			\
35		-DNATIVE_BUILD						\
36		-I$(LIBSCF)/inc						\
37		-I$(LIBTECLA)						\
38		-I$(LIBUUTIL)/common
39
40LIBTECLA	= $(SRC)/lib/libtecla		# just for the header
41LIBUUTIL	= $(SRC)/lib/libuutil
42
43SVCCFG_EXTRA_LIBS += -lxml2 -lscf -ll -luutil -lumem -lmd \
44	-lnvpair
45NATIVE_LIBS += libxml2.so libl.so libumem.so libmd.so libnvpair.so libc.so
46
47LDLIBS += \
48	-L$(SRC)/tools/svc/libscf -R '$$ORIGIN/../../lib/$(MACH)' \
49	-L$(NATIVE_ADJUNCT)/lib -R$(NATIVE_ADJUNCT)/lib -L$(ROOTONBLDLIBMACH) \
50	$(SVCCFG_EXTRA_LIBS)
51
52include $(SRC)/Makefile.native
53
54.KEEP_STATE:
55.PARALLEL: $(OBJS)
56
57all debug: $(PROG)
58
59$(PROG): $(OBJS) $(MAPFILES)
60	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
61	$(POST_PROCESS)
62
63install: all $(ROOTONBLDMACHPROG)
64
65clean:
66	$(RM) $(OBJS)
67
68include ../../Makefile.targ
69include $(SRC)/cmd/svc/svccfg/Makefile.shared.targ
70