xref: /illumos-gate/usr/src/cmd/svc/svccfg/Makefile (revision 9adf2ea6d6cc9c5ea216e001c804a4beda729c2a)
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 Makefile.shared.com
28include $(SRC)/cmd/Makefile.ctf
29
30POFILES =				\
31	$(SRCS:%.c=%.po)		\
32	svccfg_grammar.po		\
33	svccfg_lex.po			\
34	../common/manifest_find.po	\
35	../common/manifest_hash.po
36
37SRCDIR = .
38COMDIR = ../common
39
40POFILE =	$(PROG)_all.po
41
42# svccfg has a name clash with main() and libl.so.1.  However, svccfg must
43# still export a number of "yy*" (libl) interfaces.  Reduce all other symbols
44# to local scope.
45MAPFILES +=	$(MAPFILE.LEX) $(MAPFILE.NGB)
46MAPOPTS =	$(MAPFILES:%=-Wl,-M%)
47
48CPPFLAGS +=	-I ../common -I$(ADJUNCT_PROTO)/usr/include/libxml2
49LDFLAGS +=	$(MAPOPTS)
50
51LDLIBS += -lxml2 -lscf -ll -luutil -lumem -lmd -lnvpair -ltecla
52NATIVE_LIBS += libxml2.so
53
54svccfg_lex.o svccfg_grammar.o := CCVERBOSE =
55
56svccfg_help.po := XGETFLAGS =	-a
57
58.KEEP_STATE:
59.PARALLEL: $(OBJS)
60
61all debug: $(PROG)
62
63$(PROG): $(OBJS) $(MAPFILES)
64	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
65	$(POST_PROCESS)
66
67$(POFILES): svccfg_grammar.h
68
69$(POFILE): $(POFILES)
70	cat $(POFILES) > $(POFILE)
71
72install: all $(ROOTUSRSBINPROG)
73
74clean:
75	$(RM) $(OBJS)
76
77include ../../Makefile.targ
78include Makefile.shared.targ
79
80