xref: /illumos-gate/usr/src/cmd/login/Makefile (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26PROG= login
27OBJS= login.o login_audit.o
28SRCS= $(OBJS:%.o=%.c)
29ONC_SRCS=$(SRCS:%.c=%.c_onc_plus)
30
31DEFAULTFILES= login.dfl
32
33include ../Makefile.cmd
34
35LOGINDEVPERM= logindevperm
36LOGINDEVPERMSRC= $(LOGINDEVPERM).sh
37ROOTLOGINDEVPERM= $(LOGINDEVPERM:%=$(ROOTETC)/%)
38
39$(ROOTLOGINDEVPERM) := FILEMODE = 644
40FILEMODE= 4555
41
42CLOBBERFILES +=	$(LOGINDEVPERM) $(ONC_SRCS)
43
44CPPFLAGS +=	-DSYSV -DCONSOLE='"/dev/console"' -DSECURITY \
45		-D_FILE_OFFSET_BITS=64 -I$(SRC)/lib/pam_modules/krb5
46
47LDLIBS += -lbsm -lpam -ldevinfo
48CFLAGS += $(CCVERBOSE)
49
50.KEEP_STATE:
51
52
53all: $(PROG) $(ROOTLOGINDEVPERM)
54
55$(LOGINDEVPERM): $(LOGINDEVPERMSRC)
56	$(RM) $(LOGINDEVPERM)
57	/bin/sh $(LOGINDEVPERMSRC) > $(LOGINDEVPERM)
58
59$(PROG): $(OBJS)
60	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
61	$(POST_PROCESS)
62
63install: all $(DIRS) $(ROOTPROG) $(ROOTETCDEFAULTFILES) $(ROOTLOGINDEVPERM)
64
65clean:
66	$(RM) $(OBJS)
67
68lint:	lint_SRCS
69
70include ../Makefile.targ
71
72# make ONC_PLUS using suffix rule
73#
74
75ONC_PLUS: $(ONC_SRCS)
76