xref: /titanic_52/usr/src/cmd/oamuser/user/Makefile (revision 1cb6af97c6f66f456d4f726ef056e1ebc0f73305)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# cmd/oamuser/user/Makefile
29#
30
31include ../../Makefile.cmd
32
33GREP=		grep
34
35USERADD= 	useradd
36USERDEL= 	userdel
37USERMOD= 	usermod
38PROFILE=	.profile
39STDPROFILE=	stdprofile
40ROLEADD=	roleadd
41ROLEDEL=	roledel
42ROLEMOD=	rolemod
43
44SBINPROG=	$(USERADD)   $(USERDEL)   $(USERMOD)
45SKELFILE=	$(PROFILE)
46#
47#	Removing sysadm: deleted $(SYSADMPROG) from this target.
48#
49PROG=		$(SBINPROG)
50PRODUCT=	$(PROG) $(PROFILE)
51
52ADD_OBJ=	useradd.o     uid.o        homedir.o \
53		groups.o      call_pass.o      userdefs.o   messages.o \
54		val_lgrp.o    funcs.o	       val_lprj.o   proj.o
55
56DEL_OBJ=	userdel.o     call_pass.o      rmfiles.o    isbusy.o \
57		groups.o      messages.o       funcs.o      proj.o
58
59MOD_OBJ=	usermod.o     uid.o            movedir.o    groups.o \
60		rmfiles.o     call_pass.o      isbusy.o     homedir.o \
61		userdefs.o    messages.o       val_lgrp.o   funcs.o \
62		val_lprj.o    proj.o
63
64OBJECTS=	$(ADD_OBJ)     $(DEL_OBJ)    $(MOD_OBJ)
65
66SRCS=		$(OBJECTS:.o=.c)
67
68CLOBBERFILES=	$(PROFILE)
69LIBDIR=		../lib
70LIBUSRGRP=	$(LIBDIR)/lib.a
71LIBADM=		-ladm
72LOCAL=		../inc
73HERE=		.
74LINTFLAGS=	-u
75
76ROOTSKEL=	$(ROOTETC)/skel
77INSSBINPROG=	$(SBINPROG:%=$(ROOTUSRSBIN)/%)
78INSSKELFILE=	$(SKELFILE:%=$(ROOTSKEL)/%)
79
80CPPFLAGS=	-I$(HERE) -I$(LOCAL) $(CPPFLAGS.master)
81OWNER= 		root
82GROUP= 		sys
83
84$(INSSBINPROG)  := FILEMODE = 0555
85$(INSSYSADMPROG):= FILEMODE = 0500
86$(INSSKELFILE)  := FILEMODE = 0644
87$(INSSKELFILE)  := GROUP = other
88$(ROOTSKEL)	:= OWNER = root
89$(ROOTSKEL)	:= GROUP = sys
90
91$(USERADD) :=	OBJS = $(ADD_OBJ)
92$(USERADD) :=	LIBS = $(LIBUSRGRP)
93
94$(USERDEL) :=	OBJS = $(DEL_OBJ)
95$(USERDEL) :=	LIBS = $(LIBUSRGRP)
96
97$(USERMOD) :=	OBJS = $(MOD_OBJ)
98$(USERMOD) :=	LIBS = $(LIBUSRGRP)
99
100LDLIBS +=	-lsecdb -lproject
101
102.PARALLEL: $(OBJECTS)
103
104all: 		$(PRODUCT)
105
106$(PROFILE):    $(STDPROFILE)
107	$(GREP) -v "^#ident" $(STDPROFILE) > $(PROFILE)
108
109$(PROG):	$$(OBJS) $$(LIBS)
110	$(LINK.c) $(OBJS) -o $@ $(LIBS) $(LDLIBS)
111	$(POST_PROCESS)
112
113$(USERADD):	$(ADD_OBJ)
114$(USERMOD):	$(MOD_OBJ)
115$(USERDEL):	$(DEL_OBJ)
116
117install:	all .WAIT $(ROOTSKEL) $(INSSBINPROG) $(INSSKELFILE)
118		$(RM) $(ROOTUSRSBIN)/$(ROLEADD)
119		$(LN) $(ROOTUSRSBIN)/$(USERADD) $(ROOTUSRSBIN)/$(ROLEADD)
120		$(RM) $(ROOTUSRSBIN)/$(ROLEDEL)
121		$(LN) $(ROOTUSRSBIN)/$(USERDEL) $(ROOTUSRSBIN)/$(ROLEDEL)
122		$(RM) $(ROOTUSRSBIN)/$(ROLEMOD)
123		$(LN) $(ROOTUSRSBIN)/$(USERMOD) $(ROOTUSRSBIN)/$(ROLEMOD)
124
125$(ROOTSKEL):
126	$(INS.dir)
127
128$(ROOTSKEL)/%:	%
129	$(INS.file)
130
131clean:
132	$(RM) $(OBJECTS)
133
134lint:	lint_SRCS
135
136include ../../Makefile.targ
137