10Sstevel@tonic-gate# 20Sstevel@tonic-gate# CDDL HEADER START 30Sstevel@tonic-gate# 40Sstevel@tonic-gate# The contents of this file are subject to the terms of the 54271Srie# Common Development and Distribution License (the "License"). 64271Srie# You may not use this file except in compliance with the License. 70Sstevel@tonic-gate# 80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate# See the License for the specific language governing permissions 110Sstevel@tonic-gate# and limitations under the License. 120Sstevel@tonic-gate# 130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate# 190Sstevel@tonic-gate# CDDL HEADER END 200Sstevel@tonic-gate# 214271Srie 220Sstevel@tonic-gate# 23*12967Sgavin.maltby@oracle.com# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 240Sstevel@tonic-gate# 250Sstevel@tonic-gate 260Sstevel@tonic-gateMYPROG = svccfg 270Sstevel@tonic-gatePROG = $(MYPROG) 280Sstevel@tonic-gate 290Sstevel@tonic-gateSRCS = svccfg_main.c \ 300Sstevel@tonic-gate svccfg_engine.c \ 310Sstevel@tonic-gate svccfg_internal.c \ 320Sstevel@tonic-gate svccfg_libscf.c \ 337887SLiane.Praza@Sun.COM svccfg_tmpl.c \ 340Sstevel@tonic-gate svccfg_xml.c \ 350Sstevel@tonic-gate svccfg_help.c 360Sstevel@tonic-gate 370Sstevel@tonic-gateLNTS = $(SRCS:%.c=%.ln) \ 3811996SThomas.Whitten@Sun.COM manifest_find.ln \ 390Sstevel@tonic-gate manifest_hash.ln 400Sstevel@tonic-gate 410Sstevel@tonic-gateMYOBJS = $(SRCS:%.c=%.o) \ 420Sstevel@tonic-gate svccfg_grammar.o \ 430Sstevel@tonic-gate svccfg_lex.o \ 4411996SThomas.Whitten@Sun.COM manifest_find.o \ 45*12967Sgavin.maltby@oracle.com manifest_hash.o \ 46*12967Sgavin.maltby@oracle.com notify_params.o 470Sstevel@tonic-gateOBJS = $(MYOBJS) 480Sstevel@tonic-gate 490Sstevel@tonic-gatePOFILES = $(SRCS:%.c=%.po) \ 500Sstevel@tonic-gate svccfg_grammar.po \ 510Sstevel@tonic-gate svccfg_lex.po \ 5211996SThomas.Whitten@Sun.COM ../common/manifest_find.po \ 530Sstevel@tonic-gate ../common/manifest_hash.po 540Sstevel@tonic-gate 550Sstevel@tonic-gateinclude ../../Makefile.cmd 5610889SJonathan.Adams@Sun.COMinclude ../../Makefile.ctf 570Sstevel@tonic-gate 580Sstevel@tonic-gatePOFILE = $(PROG)_all.po 590Sstevel@tonic-gate 600Sstevel@tonic-gateNATIVE_BUILD=$(POUND_SIGN) 610Sstevel@tonic-gate$(NATIVE_BUILD)NOT_NATIVE=$(POUND_SIGN) 620Sstevel@tonic-gate 630Sstevel@tonic-gate$(NATIVE_BUILD)PROG = $(MYPROG:%=%-native) 640Sstevel@tonic-gate$(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o) 650Sstevel@tonic-gate 664947Srie# svccfg has a name clash with main() and libl.so.1. However, svccfg must 674947Srie# still export a number of "yy*" (libl) interfaces. Reduce all other symbols 684947Srie# to local scope. 694947SrieMAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB) 704947SrieMAPOPTS = $(MAPFILES:%=-M%) 714947Srie 720Sstevel@tonic-gateMYCPPFLAGS = -I ../common -I/usr/include/libxml2 730Sstevel@tonic-gateCPPFLAGS += $(MYCPPFLAGS) 744947SrieLDFLAGS += $(MAPOPTS) 750Sstevel@tonic-gate 760Sstevel@tonic-gateLFLAGS = -t 770Sstevel@tonic-gateYFLAGS = -d 780Sstevel@tonic-gate 790Sstevel@tonic-gateCLOBBERFILES += svccfg_lex.c svccfg_grammar.c svccfg_grammar.h \ 800Sstevel@tonic-gate $(MYPROG:%=%-native) 810Sstevel@tonic-gate 82*12967Sgavin.maltby@oracle.comSVCCFG_EXTRA_LIBS = -lxml2 -lscf -ll -luutil -lumem -lmd5 -lnvpair 830Sstevel@tonic-gate$(NOT_NATIVE)SVCCFG_EXTRA_LIBS += -ltecla 840Sstevel@tonic-gate 850Sstevel@tonic-gateLIBSCF = $(SRC)/lib/libscf 860Sstevel@tonic-gateLIBTECLA = $(SRC)/lib/libtecla # just for the header 870Sstevel@tonic-gateLIBUUTIL = $(SRC)/lib/libuutil 880Sstevel@tonic-gate 890Sstevel@tonic-gatedebug := COPTFLAG = -g 900Sstevel@tonic-gate 910Sstevel@tonic-gatelint := LINTFLAGS = -mux 92*12967Sgavin.maltby@oracle.comlint := SVCCFG_EXTRA_LIBS = -lscf -ll -luutil -lumem -lmd5 -lnvpair 930Sstevel@tonic-gate 940Sstevel@tonic-gateLDLIBS += $(SVCCFG_EXTRA_LIBS) 950Sstevel@tonic-gate 960Sstevel@tonic-gate$(NATIVE_BUILD)CC = $(NATIVECC) 970Sstevel@tonic-gate$(NATIVE_BUILD)LD = $(NATIVELD) 980Sstevel@tonic-gate$(NATIVE_BUILD)CFLAGS = $(NATIVE_CFLAGS) 990Sstevel@tonic-gate$(NATIVE_BUILD)CPPFLAGS = \ 1000Sstevel@tonic-gate -DNATIVE_BUILD \ 1010Sstevel@tonic-gate $(MYCPPFLAGS) \ 1020Sstevel@tonic-gate -I$(LIBSCF)/inc \ 1030Sstevel@tonic-gate -I$(LIBTECLA) \ 1040Sstevel@tonic-gate -I$(LIBUUTIL)/common 1050Sstevel@tonic-gate$(NATIVE_BUILD)LDFLAGS = 1060Sstevel@tonic-gate$(NATIVE_BUILD)LDLIBS = \ 1070Sstevel@tonic-gate -L$(LIBUUTIL)/native -R $(LIBUUTIL)/native \ 1080Sstevel@tonic-gate -L$(LIBSCF)/native -R $(LIBSCF)/native \ 10910314SRod.Evans@Sun.COM $(SVCCFG_EXTRA_LIBS) 1100Sstevel@tonic-gate 1110Sstevel@tonic-gatesvccfg_lex.o svccfg_grammar.o := CCVERBOSE = 1120Sstevel@tonic-gate 1130Sstevel@tonic-gatesvccfg_help.po := XGETFLAGS = -a 1140Sstevel@tonic-gate 1150Sstevel@tonic-gate.KEEP_STATE: 1160Sstevel@tonic-gate.PARALLEL: $(OBJS) $(LNTS) 1170Sstevel@tonic-gate 1180Sstevel@tonic-gateall debug: $(PROG) 1190Sstevel@tonic-gate 1200Sstevel@tonic-gatenative: FRC 1210Sstevel@tonic-gate @cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install 1220Sstevel@tonic-gate @cd $(LIBSCF)/native; pwd; $(MAKE) $(MFLAGS) install 1230Sstevel@tonic-gate @NATIVE_BUILD= $(MAKE) $(MFLAGS) all 1240Sstevel@tonic-gate 1254947Srie$(PROG): $(OBJS) $(MAPFILES) 12610889SJonathan.Adams@Sun.COM $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 1270Sstevel@tonic-gate $(POST_PROCESS) 1280Sstevel@tonic-gate 1290Sstevel@tonic-gate$(POFILE): $(POFILES) 1300Sstevel@tonic-gate cat $(POFILES) > $(POFILE) 1310Sstevel@tonic-gate 1320Sstevel@tonic-gateinstall: all $(ROOTUSRSBINPROG) 1330Sstevel@tonic-gate 1340Sstevel@tonic-gatesvccfg_lex.c: svccfg.l svccfg_grammar.h 1350Sstevel@tonic-gate $(LEX) $(LFLAGS) svccfg.l > $@ 1360Sstevel@tonic-gate 1370Sstevel@tonic-gatesvccfg_help.o: svccfg_grammar.h 1380Sstevel@tonic-gatesvccfg_help-native.o: svccfg_grammar.h 1390Sstevel@tonic-gate 1400Sstevel@tonic-gatesvccfg_grammar.h svccfg_grammar.c: svccfg.y 1410Sstevel@tonic-gate $(YACC) $(YFLAGS) svccfg.y 1420Sstevel@tonic-gate @$(MV) y.tab.h svccfg_grammar.h 1430Sstevel@tonic-gate @$(MV) y.tab.c svccfg_grammar.c 1440Sstevel@tonic-gate 1450Sstevel@tonic-gateclean: FRC 1460Sstevel@tonic-gate $(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o) $(LNTS) 1470Sstevel@tonic-gate 1480Sstevel@tonic-gatelint: $(LNTS) 1490Sstevel@tonic-gate $(LINT.c) $(LINTFLAGS) $(LNTS) $(LDLIBS) 1500Sstevel@tonic-gate 1510Sstevel@tonic-gate%-native.o: %.c 15210889SJonathan.Adams@Sun.COM $(COMPILE.c) -o $@ $< 1530Sstevel@tonic-gate $(POST_PROCESS_O) 1540Sstevel@tonic-gate 1550Sstevel@tonic-gate%-native.o: ../common/%.c 15610889SJonathan.Adams@Sun.COM $(COMPILE.c) -o $@ $< 1570Sstevel@tonic-gate $(POST_PROCESS_O) 1580Sstevel@tonic-gate 1590Sstevel@tonic-gate%.o: ../common/%.c 16010889SJonathan.Adams@Sun.COM $(COMPILE.c) $(OUTPUT_OPTION) $< 1610Sstevel@tonic-gate $(POST_PROCESS_O) 1620Sstevel@tonic-gate 1630Sstevel@tonic-gate%.ln: ../common/%.c 1640Sstevel@tonic-gate $(LINT.c) $(OUTPUT_OPTION) -c $< 1650Sstevel@tonic-gate 1660Sstevel@tonic-gateinclude ../../Makefile.targ 1670Sstevel@tonic-gate 1680Sstevel@tonic-gateFRC: 169