4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
23 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2017 Joyent, Inc.
30 SRCS
= svccfg_main.c \
38 LNTS
= $(SRCS
:%.c
=%.ln
) \
42 MYOBJS
= $(SRCS
:%.c
=%.o
) \
50 POFILES
= $(SRCS
:%.c
=%.po
) \
53 ..
/common
/manifest_find.po \
54 ..
/common
/manifest_hash.po
56 include ..
/..
/Makefile.cmd
57 include ..
/..
/Makefile.ctf
59 POFILE
= $(PROG
)_all.po
61 NATIVE_BUILD
=$(POUND_SIGN
)
62 $(NATIVE_BUILD
)NOT_NATIVE
=$(POUND_SIGN
)
64 $(NATIVE_BUILD
)PROG
= $(MYPROG
:%=%-native
)
65 $(NATIVE_BUILD
)OBJS
= $(MYOBJS
:%.o
=%-native.o
)
67 # svccfg has a name clash with main() and libl.so.1. However, svccfg must
68 # still export a number of "yy*" (libl) interfaces. Reduce all other symbols
70 MAPFILES
+= $(MAPFILE.LEX
) $(MAPFILE.NGB
)
71 MAPOPTS
= $(MAPFILES
:%=-Wl
,-M
%)
73 MYCPPFLAGS
= -I ..
/common
-I
$(ADJUNCT_PROTO
)/usr
/include/libxml2
74 CPPFLAGS
+= $(MYCPPFLAGS
)
77 CERRWARN
+= -Wno-unused-label
78 CERRWARN
+= -Wno-implicit-function-declaration
79 CERRWARN
+= -Wno-switch
80 CERRWARN
+= -Wno-uninitialized
81 CERRWARN
+= -Wno-unused-variable
82 CERRWARN
+= -Wno-parentheses
87 CLOBBERFILES
+= svccfg_lex.c svccfg_grammar.c svccfg_grammar.h \
90 SVCCFG_EXTRA_LIBS
= -lxml2
-lscf
-ll
-luutil
-lumem
-lmd5
-lnvpair
91 $(NOT_NATIVE
)SVCCFG_EXTRA_LIBS
+= -ltecla
93 LIBSCF
= $(SRC
)/lib
/libscf
94 LIBTECLA
= $(SRC
)/lib
/libtecla
# just for the header
96 debug
:= COPTFLAG
= -g
99 LDLIBS
+= $(SVCCFG_EXTRA_LIBS
)
101 $(NATIVE_BUILD
)CC
= $(NATIVECC
)
102 $(NATIVE_BUILD
)LD
= $(NATIVELD
)
103 $(NATIVE_BUILD
)CFLAGS
= $(NATIVE_CFLAGS
)
104 $(NATIVE_BUILD
)CPPFLAGS
= \
109 $(NATIVE_BUILD
)LDFLAGS
=
110 $(NATIVE_BUILD
)LDLIBS
= \
111 -L
$(LIBSCF
)/native
-R
$(LIBSCF
)/native \
112 -L
$(ADJUNCT_PROTO
)/usr
/lib
-R
$(ADJUNCT_PROTO
)/usr
/lib \
115 svccfg_help.po
:= XGETFLAGS
= -a
118 .PARALLEL
: $(OBJS
) $(LNTS
)
123 @cd
$(LIBSCF
)/native
; pwd
; $(MAKE
) $(MFLAGS
) install
124 @NATIVE_BUILD
= $(MAKE
) $(MFLAGS
) all
126 $(PROG
): $(OBJS
) $(MAPFILES
)
127 $(LINK.c
) -o
$@
$(OBJS
) $(LDLIBS
)
130 $(POFILES
): svccfg_grammar.h
132 $(POFILE
): $(POFILES
)
133 cat
$(POFILES
) > $(POFILE
)
135 install: all $(ROOTUSRSBINPROG
)
137 svccfg_lex.c
: svccfg.l svccfg_grammar.h
138 $(LEX
) $(LFLAGS
) svccfg.l
> $@
140 svccfg_help.o
: svccfg_grammar.h
141 svccfg_help-native.o
: svccfg_grammar.h
143 svccfg_grammar.h svccfg_grammar.c
: svccfg.y
144 $(YACC
) $(YFLAGS
) svccfg.y
145 @
$(MV
) y.tab.h svccfg_grammar.h
146 @
$(MV
) y.tab.c svccfg_grammar.c
149 $(RM
) $(MYOBJS
) $(MYOBJS
:%.o
=%-native.o
) $(LNTS
)
152 $(COMPILE.c
) -o
$@
$<
155 %-native.o
: ..
/common
/%.c
156 $(COMPILE.c
) -o
$@
$<
160 $(COMPILE.c
) $(OUTPUT_OPTION
) $<
163 include ..
/..
/Makefile.targ