Makefile revision 7c478bd95313f5f23a4c958a745db2134aa03244
1N/A#
1N/A# CDDL HEADER START
1N/A#
1N/A# The contents of this file are subject to the terms of the
1N/A# Common Development and Distribution License, Version 1.0 only
1N/A# (the "License"). You may not use this file except in compliance
1N/A# with the License.
1N/A#
1N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1N/A# or http://www.opensolaris.org/os/licensing.
1N/A# See the License for the specific language governing permissions
1N/A# and limitations under the License.
1N/A#
1N/A# When distributing Covered Code, include this CDDL HEADER in each
1N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1N/A# If applicable, add the following below this CDDL HEADER, with the
1N/A# fields enclosed by brackets "[]" replaced with your own identifying
1N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1N/A#
1N/A# CDDL HEADER END
1N/A#
1N/A#
1N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
1N/A# Use is subject to license terms.
1N/A#
1N/A# ident "%Z%%M% %I% %E% SMI"
1N/A#
1N/A# build two versions, su and su.static
1N/A# su.static is dynamically linked; the .static suffix is historical.
1N/A
1N/APROG = su
1N/AROOTFS_PROG = su.static
1N/A
1N/Ainclude ../Makefile.cmd
1N/A
1N/AEMB_PROG = embedded_su
1N/AROOTEMB_PROG = $(ROOTLIB)/$(EMB_PROG)
1N/A
1N/APROG_STATIC = $(ROOTSBIN)/$(ROOTFS_PROG)
1N/A
1N/ADFLTD = $(ROOTETC)/default
1N/AETCDFLTPROG = $(PROG:%=$(DFLTD)/%)
1N/A
1N/A# set /usr/bin/su to 4555; set /sbin/su.static to 0555
1N/AFILEMODE = 04555
1N/A
1N/AGROUP = sys
1N/A
1N/A$(PROG_STATIC) := FILEMODE = 0555
1N/A$(ETCDFLTPROG) := FILEMODE = $(LIBFILEMODE)
1N/A
1N/A# A reduced su.static is created, with just enough functionality
1N/A# to satisfy the needs of a single-user login with /usr not mounted.
1N/A# In particular, nss_files.so.1 may be dlopen()'ed at runtime.
1N/A$(ROOTFS_PROG) := LDLIBS += -lcmd -lbsm
1N/A
1N/A# The standard su is fully functional.
1N/A$(PROG) := CPPFLAGS += -DDYNAMIC_SU
1N/A$(PROG) := LDLIBS += -lcmd -lbsm -lpam
1N/A
1N/ALINTFLAGS += -DDYNAMIC_SU
1N/A
1N/ACLOBBERFILES += $(ROOTFS_PROG) $(EMB_PROG)
1N/A
1N/Alint := LDLIBS += -lcmd -lbsm -lpam
1N/A
1N/A.KEEP_STATE:
1N/A
1N/Aall: $(PROG) $(ROOTFS_PROG) $(EMB_PROG) $(PROG).dfl
1N/A
1N/A# install rule for the default file
1N/A$(DFLTD)/%: %.dfl
1N/A $(INS.rename)
1N/A
1N/A# install rule for non-setuid /sbin/su.static
1N/A# (exec'd by /sbin/sulogin when booting single user)
1N/A$(ROOTFS_PROG): $(PROG).c
1N/A $(LINK.c) $(PROG).c -o $@ $(LDLIBS)
1N/A $(POST_PROCESS)
1N/A
1N/Ainstall: all $(PROG_STATIC) $(ROOTPROG) $(ROOTSBINPROG) $(ETCDFLTPROG) \
1N/A $(ROOTEMB_PROG)
1N/A
1N/A$(ROOTSBINPROG): $(ROOTPROG)
1N/A $(RM) $(ROOTSBINPROG); \
1N/A $(SYMLINK) ../usr/bin/$(PROG) $(ROOTSBINPROG)
1N/A
1N/A$(ROOTEMB_PROG):
1N/A $(RM) $(ROOTEMB_PROG); \
1N/A $(SYMLINK) ../bin/$(PROG) $(ROOTEMB_PROG)
1N/A
1N/A$(EMB_PROG):
1N/A $(RM) $(EMB_PROG); \
1N/A $(SYMLINK) $(PROG) $(EMB_PROG)
1N/A
1N/Aclean:
1N/A
1N/Alint: lint_PROG
1N/A
1N/Ainclude ../Makefile.targ
1N/A