Makefile revision df4628cb18cef0a7960608d573d5a9b6cc9e29d5
551N/A#
551N/A# CDDL HEADER START
551N/A#
551N/A# The contents of this file are subject to the terms of the
1097N/A# Common Development and Distribution License (the "License").
551N/A# You may not use this file except in compliance with the License.
551N/A#
919N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
919N/A# or http://www.opensolaris.org/os/licensing.
919N/A# See the License for the specific language governing permissions
919N/A# and limitations under the License.
919N/A#
919N/A# When distributing Covered Code, include this CDDL HEADER in each
919N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
919N/A# If applicable, add the following below this CDDL HEADER, with the
919N/A# fields enclosed by brackets "[]" replaced with your own identifying
919N/A# information: Portions Copyright [yyyy] [name of copyright owner]
919N/A#
919N/A# CDDL HEADER END
919N/A#
919N/A
919N/A#
919N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
919N/A# Use is subject to license terms.
551N/A#
551N/A# ident "%Z%%M% %I% %E% SMI"
551N/A
551N/AMYPROG = svccfg
551N/APROG = $(MYPROG)
551N/A
970N/ASRCS = svccfg_main.c \
970N/A svccfg_engine.c \
970N/A svccfg_internal.c \
970N/A svccfg_libscf.c \
970N/A svccfg_xml.c \
970N/A svccfg_help.c
970N/A
970N/ALNTS = $(SRCS:%.c=%.ln) \
551N/A manifest_hash.ln
551N/A
551N/AMYOBJS = $(SRCS:%.c=%.o) \
551N/A svccfg_grammar.o \
551N/A svccfg_lex.o \
551N/A manifest_hash.o
1097N/AOBJS = $(MYOBJS)
1097N/A
1097N/APOFILES = $(SRCS:%.c=%.po) \
1097N/A svccfg_grammar.po \
551N/A svccfg_lex.po \
551N/A ../common/manifest_hash.po
551N/A
551N/Ainclude ../../Makefile.cmd
551N/Ainclude ../Makefile.ctf
551N/A
551N/APOFILE = $(PROG)_all.po
551N/A
1193N/ANATIVE_BUILD=$(POUND_SIGN)
1193N/A$(NATIVE_BUILD)NOT_NATIVE=$(POUND_SIGN)
1193N/A
551N/A$(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
1193N/A$(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
1193N/A
1193N/A# svccfg has a name clash with main() and libl.so.1. However, svccfg must
551N/A# still export a number of "yy*" (libl) interfaces. Reduce all other symbols
970N/A# to local scope.
970N/AMAPFILES += $(MAPFILE.LEX) $(MAPFILE.NGB)
970N/AMAPOPTS = $(MAPFILES:%=-M%)
551N/A
MYCPPFLAGS = -I ../common -I/usr/include/libxml2
CPPFLAGS += $(MYCPPFLAGS)
LDFLAGS += $(MAPOPTS)
LFLAGS = -t
YFLAGS = -d
CLOBBERFILES += svccfg_lex.c svccfg_grammar.c svccfg_grammar.h \
$(MYPROG:%=%-native)
LAZYLIBS = $(ZLAZYLOAD) -lxml2 $(ZNOLAZYLOAD)
SVCCFG_EXTRA_LIBS = $(LAZYLIBS) -lscf -ll -luutil -lumem -lmd5
$(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
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) -ldoor
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) $(CTFMERGE_HOOK)
$(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 $@ $< $(CTFCONVERT_HOOK)
$(POST_PROCESS_O)
%-native.o: ../common/%.c
$(COMPILE.c) -o $@ $< $(CTFCONVERT_HOOK)
$(POST_PROCESS_O)
%.o: ../common/%.c
$(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
$(POST_PROCESS_O)
%.ln: ../common/%.c
$(LINT.c) $(OUTPUT_OPTION) -c $<
include ../../Makefile.targ
FRC: