xref: /illumos-gate/usr/src/cmd/svc/svccfg/Makefile (revision 9b9d39d2a32ff806d2431dbcc50968ef1e6d46b2)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
524da5b34Srie# Common Development and Distribution License (the "License").
624da5b34Srie# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
2124da5b34Srie
227c478bd9Sstevel@tonic-gate#
23f6e214c7SGavin Maltby# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
243e3015ceSJohn Levon# Copyright 2020 Joyent, Inc.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate
27*9b9d39d2SRichard Loweinclude Makefile.shared.com
28*9b9d39d2SRichard Loweinclude $(SRC)/cmd/Makefile.ctf
297c478bd9Sstevel@tonic-gate
30*9b9d39d2SRichard LowePOFILES =				\
31*9b9d39d2SRichard Lowe	$(SRCS:%.c=%.po)		\
327c478bd9Sstevel@tonic-gate	svccfg_grammar.po		\
337c478bd9Sstevel@tonic-gate	svccfg_lex.po			\
349444c26fSTom Whitten	../common/manifest_find.po	\
357c478bd9Sstevel@tonic-gate	../common/manifest_hash.po
367c478bd9Sstevel@tonic-gate
37*9b9d39d2SRichard LoweSRCDIR = .
38*9b9d39d2SRichard LoweCOMDIR = ../common
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gatePOFILE =	$(PROG)_all.po
417c478bd9Sstevel@tonic-gate
42df4628cbSrie# svccfg has a name clash with main() and libl.so.1.  However, svccfg must
43df4628cbSrie# still export a number of "yy*" (libl) interfaces.  Reduce all other symbols
44df4628cbSrie# to local scope.
45df4628cbSrieMAPFILES +=	$(MAPFILE.LEX) $(MAPFILE.NGB)
4685f4cb87SRichard LoweMAPOPTS =	$(MAPFILES:%=-Wl,-M%)
47df4628cbSrie
48*9b9d39d2SRichard LoweCPPFLAGS +=	-I ../common -I$(ADJUNCT_PROTO)/usr/include/libxml2
49df4628cbSrieLDFLAGS +=	$(MAPOPTS)
507c478bd9Sstevel@tonic-gate
51*9b9d39d2SRichard LoweLDLIBS += -lxml2 -lscf -ll -luutil -lumem -lmd -lnvpair -ltecla
52*9b9d39d2SRichard LoweNATIVE_LIBS += libxml2.so
537c478bd9Sstevel@tonic-gate
547c478bd9Sstevel@tonic-gatesvccfg_lex.o svccfg_grammar.o := CCVERBOSE =
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gatesvccfg_help.po := XGETFLAGS =	-a
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate.KEEP_STATE:
5985f4cb87SRichard Lowe.PARALLEL: $(OBJS)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gateall debug: $(PROG)
627c478bd9Sstevel@tonic-gate
63df4628cbSrie$(PROG): $(OBJS) $(MAPFILES)
64e0ad97e3SJonathan Adams	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
657c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
667c478bd9Sstevel@tonic-gate
679e01f109SJason King$(POFILES): svccfg_grammar.h
689e01f109SJason King
697c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES)
707c478bd9Sstevel@tonic-gate	cat $(POFILES) > $(POFILE)
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gateinstall: all $(ROOTUSRSBINPROG)
737c478bd9Sstevel@tonic-gate
74*9b9d39d2SRichard Loweclean:
75*9b9d39d2SRichard Lowe	$(RM) $(OBJS)
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gateinclude ../../Makefile.targ
78*9b9d39d2SRichard Loweinclude Makefile.shared.targ
797c478bd9Sstevel@tonic-gate
80