Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
325N/A#
325N/A# CDDL HEADER START
325N/A#
325N/A# The contents of this file are subject to the terms of the
325N/A# Common Development and Distribution License (the "License").
325N/A# You may not use this file except in compliance with the License.
325N/A#
325N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
325N/A# or http://www.opensolaris.org/os/licensing.
325N/A# See the License for the specific language governing permissions
325N/A# and limitations under the License.
325N/A#
325N/A# When distributing Covered Code, include this CDDL HEADER in each
325N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
325N/A# If applicable, add the following below this CDDL HEADER, with the
325N/A# fields enclosed by brackets "[]" replaced with your own identifying
325N/A# information: Portions Copyright [yyyy] [name of copyright owner]
325N/A#
325N/A# CDDL HEADER END
325N/A#
325N/A
325N/A#
325N/A# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
325N/A#
325N/A
325N/AMYPROG = svccfg
325N/APROG = $(MYPROG)
325N/A
325N/ASRCS = svccfg_main.c \
325N/A svccfg_engine.c \
325N/A svccfg_internal.c \
325N/A svccfg_libscf.c \
325N/A svccfg_tmpl.c \
325N/A svccfg_xml.c \
325N/A svccfg_help.c
325N/A
325N/ALNTS = $(SRCS:%.c=%.ln) \
325N/A manifest_find.ln \
325N/A manifest_hash.ln
325N/A
325N/AMYOBJS = $(SRCS:%.c=%.o) \
325N/A svccfg_grammar.o \
325N/A svccfg_lex.o \
325N/A manifest_find.o \
325N/A manifest_hash.o \
325N/A notify_params.o
325N/AOBJS = $(MYOBJS)
325N/A
325N/APOFILES = $(SRCS:%.c=%.po) \
325N/A svccfg_grammar.po \
325N/A svccfg_lex.po \
325N/A ../common/manifest_find.po \
325N/A ../common/manifest_hash.po
325N/A
325N/Ainclude ../../Makefile.cmd
325N/Ainclude ../../Makefile.ctf
325N/A
325N/APOFILE = $(PROG)_all.po
325N/A
325N/ANATIVE_BUILD=$(POUND_SIGN)
325N/A$(NATIVE_BUILD)NOT_NATIVE=$(POUND_SIGN)
325N/A
325N/A$(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
325N/A$(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
325N/A
325N/A# svccfg has a name clash with main() and libl.so.1. However, svccfg must
325N/A# still export a number of "yy*" (libl) interfaces. Reduce all other symbols
325N/A# to local scope.
325N/AMAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB)
325N/AMAPOPTS = $(MAPFILES:%=-M%)
325N/A
325N/AMYCPPFLAGS = -I ../common -I/usr/include/libxml2
325N/ACPPFLAGS += $(MYCPPFLAGS)
325N/ALDFLAGS += $(MAPOPTS)
325N/A
325N/ACERRWARN += -_gcc=-Wno-unused-label
325N/ACERRWARN += -_gcc=-Wno-implicit-function-declaration
325N/ACERRWARN += -_gcc=-Wno-switch
325N/ACERRWARN += -_gcc=-Wno-uninitialized
325N/ACERRWARN += -_gcc=-Wno-unused-variable
325N/ACERRWARN += -_gcc=-Wno-parentheses
325N/A
325N/ALFLAGS = -t
325N/AYFLAGS = -d
325N/A
325N/ACLOBBERFILES += svccfg_lex.c svccfg_grammar.c svccfg_grammar.h \
325N/A $(MYPROG:%=%-native)
325N/A
325N/ASVCCFG_EXTRA_LIBS = -lxml2 -lscf -ll -luutil -lumem -lmd5 -lnvpair
325N/A$(NOT_NATIVE)SVCCFG_EXTRA_LIBS += -ltecla
325N/A
325N/ALIBSCF = $(SRC)/lib/libscf
325N/ALIBTECLA = $(SRC)/lib/libtecla # just for the header
LIBUUTIL = $(SRC)/lib/libuutil
debug := COPTFLAG = -g
lint := LINTFLAGS = -mux
lint := SVCCFG_EXTRA_LIBS = -lscf -ll -luutil -lumem -lmd5 -lnvpair
LDLIBS += $(SVCCFG_EXTRA_LIBS)
$(NATIVE_BUILD)CC = $(NATIVECC)
$(NATIVE_BUILD)LD = $(NATIVELD)
$(NATIVE_BUILD)CFLAGS = $(NATIVE_CFLAGS)
$(NATIVE_BUILD)CPPFLAGS = \
-DNATIVE_BUILD \
$(MYCPPFLAGS) \
-I$(LIBSCF)/inc \
-I$(LIBTECLA) \
-I$(LIBUUTIL)/common
$(NATIVE_BUILD)LDFLAGS =
$(NATIVE_BUILD)LDLIBS = \
-L$(LIBUUTIL)/native -R $(LIBUUTIL)/native \
-L$(LIBSCF)/native -R $(LIBSCF)/native \
$(SVCCFG_EXTRA_LIBS)
svccfg_lex.o svccfg_grammar.o := CCVERBOSE =
svccfg_help.po := XGETFLAGS = -a
.KEEP_STATE:
.PARALLEL: $(OBJS) $(LNTS)
all debug: $(PROG)
native: FRC
@cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install
@cd $(LIBSCF)/native; pwd; $(MAKE) $(MFLAGS) install
@NATIVE_BUILD= $(MAKE) $(MFLAGS) all
$(PROG): $(OBJS) $(MAPFILES)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
$(POFILE): $(POFILES)
cat $(POFILES) > $(POFILE)
install: all $(ROOTUSRSBINPROG)
svccfg_lex.c: svccfg.l svccfg_grammar.h
$(LEX) $(LFLAGS) svccfg.l > $@
svccfg_help.o: svccfg_grammar.h
svccfg_help-native.o: svccfg_grammar.h
svccfg_grammar.h svccfg_grammar.c: svccfg.y
$(YACC) $(YFLAGS) svccfg.y
@$(MV) y.tab.h svccfg_grammar.h
@$(MV) y.tab.c svccfg_grammar.c
clean: FRC
$(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o) $(LNTS)
lint: $(LNTS)
$(LINT.c) $(LINTFLAGS) $(LNTS) $(LDLIBS)
%-native.o: %.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
%-native.o: ../common/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
%.o: ../common/%.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
$(POST_PROCESS_O)
%.ln: ../common/%.c
$(LINT.c) $(OUTPUT_OPTION) -c $<
include ../../Makefile.targ
FRC: