Makefile revision 494f7e12a62129ef191a15f9dfde6b7abe3bf510
749N/A#
749N/A# CDDL HEADER START
749N/A#
749N/A# The contents of this file are subject to the terms of the
749N/A# Common Development and Distribution License (the "License").
749N/A# You may not use this file except in compliance with the License.
749N/A#
749N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
749N/A# or http://www.opensolaris.org/os/licensing.
749N/A# See the License for the specific language governing permissions
749N/A# and limitations under the License.
749N/A#
749N/A# When distributing Covered Code, include this CDDL HEADER in each
749N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
749N/A# If applicable, add the following below this CDDL HEADER, with the
749N/A# fields enclosed by brackets "[]" replaced with your own identifying
749N/A# information: Portions Copyright [yyyy] [name of copyright owner]
749N/A#
749N/A# CDDL HEADER END
749N/A#
749N/A
749N/A#
749N/A# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
749N/A#
749N/A
749N/AMYPROG = svccfg
749N/APROG = $(MYPROG)
749N/A
749N/ASRCS = svccfg_main.c \
749N/A svccfg_engine.c \
749N/A svccfg_internal.c \
749N/A svccfg_libscf.c \
749N/A svccfg_tmpl.c \
749N/A svccfg_xml.c \
749N/A svccfg_help.c
749N/A
749N/ALNTS = $(SRCS:%.c=%.ln) \
749N/A manifest_find.ln \
749N/A manifest_hash.ln
749N/A
749N/AMYOBJS = $(SRCS:%.c=%.o) \
749N/A svccfg_grammar.o \
749N/A svccfg_lex.o \
749N/A manifest_find.o \
749N/A manifest_hash.o \
749N/A notify_params.o
749N/AOBJS = $(MYOBJS)
749N/A
749N/APOFILES = $(SRCS:%.c=%.po) \
749N/A svccfg_grammar.po \
749N/A svccfg_lex.po \
749N/A ../common/manifest_find.po \
749N/A ../common/manifest_hash.po
749N/A
749N/Ainclude ../../Makefile.cmd
749N/Ainclude ../../Makefile.ctf
749N/A
749N/APOFILE = $(PROG)_all.po
749N/A
749N/ANATIVE_BUILD=$(POUND_SIGN)
749N/A$(NATIVE_BUILD)NOT_NATIVE=$(POUND_SIGN)
749N/A
749N/A$(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
749N/A$(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
749N/A
749N/A# svccfg has a name clash with main() and libl.so.1. However, svccfg must
# still export a number of "yy*" (libl) interfaces. Reduce all other symbols
# to local scope.
MAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB)
MAPOPTS = $(MAPFILES:%=-M%)
MYCPPFLAGS = -I ../common -I$(ADJUNCT_PROTO)/usr/include/libxml2
CPPFLAGS += $(MYCPPFLAGS)
LDFLAGS += $(MAPOPTS)
CERRWARN += -_gcc=-Wno-unused-label
CERRWARN += -_gcc=-Wno-implicit-function-declaration
CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-unused-variable
CERRWARN += -_gcc=-Wno-parentheses
LFLAGS = -t
YFLAGS = -d
CLOBBERFILES += svccfg_lex.c svccfg_grammar.c svccfg_grammar.h \
$(MYPROG:%=%-native)
SVCCFG_EXTRA_LIBS = -lxml2 -lscf -ll -luutil -lumem -lmd5 -lnvpair
$(NOT_NATIVE)SVCCFG_EXTRA_LIBS += -ltecla
LIBSCF = $(SRC)/lib/libscf
LIBTECLA = $(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 \
-L$(ADJUNCT_PROTO)/usr/lib -R$(ADJUNCT_PROTO)/usr/lib \
$(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: