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]
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # build two versions, su and su.static
26 # su.static is dynamically linked; the .static suffix is historical.
29 ROOTFS_PROG
= su.static
32 include ..
/Makefile.cmd
34 EMB_PROG
= embedded_su
35 ROOTEMB_PROG
= $(ROOTLIB
)/$(EMB_PROG
)
37 PROG_STATIC
= $(ROOTSBIN
)/$(ROOTFS_PROG
)
39 # set /usr/bin/su to 4555; set /sbin/su.static to 0555
42 $(PROG_STATIC
) := FILEMODE
= 0555
44 # A reduced su.static is created, with just enough functionality
45 # to satisfy the needs of a single-user login with /usr not mounted.
46 # In particular, nss_files.so.1 may be dlopen()'ed at runtime.
47 $(ROOTFS_PROG
) := LDLIBS
+= -lbsm
-lpam
-lsecdb
49 # The standard su is fully functional.
50 $(PROG
) := CPPFLAGS
+= -DDYNAMIC_SU
51 $(PROG
) := LDLIBS
+= -lbsm
-lpam
-lsecdb
53 LINTFLAGS
+= -DDYNAMIC_SU
55 CLOBBERFILES
+= $(ROOTFS_PROG
) $(EMB_PROG
)
57 CERRWARN
+= -_gcc
=-Wno-parentheses
59 lint
:= LDLIBS
+= -lbsm
-lpam
-lsecdb
63 all: $(PROG
) $(ROOTFS_PROG
) $(EMB_PROG
)
65 # install rule for non-setuid /sbin/su.static
66 # (exec'd by /sbin/sulogin when booting single user)
67 $(ROOTFS_PROG
): $(PROG
).c
68 $(LINK.c
) $(PROG
).c
-o
$@
$(LDLIBS
)
71 install: all $(PROG_STATIC
) $(ROOTPROG
) $(ROOTSBINPROG
) \
72 $(ROOTETCDEFAULTFILES
) $(ROOTEMB_PROG
)
74 $(ROOTSBINPROG
): $(ROOTPROG
)
75 $(RM
) $(ROOTSBINPROG
); \
76 $(SYMLINK
) ..
/usr
/bin
/$(PROG
) $(ROOTSBINPROG
)
79 $(RM
) $(ROOTEMB_PROG
); \
80 $(SYMLINK
) ..
/bin
/$(PROG
) $(ROOTEMB_PROG
)
84 $(SYMLINK
) $(PROG
) $(EMB_PROG
)
90 include ..
/Makefile.targ