xref: /titanic_41/usr/src/cmd/oamuser/user/Makefile (revision 3af08d828975d7e2581b6829e0eecff14d87a483)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27# cmd/oamuser/user/Makefile
28#
29
30include ../../Makefile.cmd
31
32GREP=		grep
33
34USERADD= 	useradd
35USERDEL= 	userdel
36USERMOD= 	usermod
37PROFILE=	.profile
38STDPROFILE=	stdprofile
39ROLEADD=	roleadd
40ROLEDEL=	roledel
41ROLEMOD=	rolemod
42
43SBINPROG=	$(USERADD)   $(USERDEL)   $(USERMOD)
44SKELFILE=	$(PROFILE)
45#
46#	Removing sysadm: deleted $(SYSADMPROG) from this target.
47#
48PROG=		$(SBINPROG)
49PRODUCT=	$(PROG) $(PROFILE)
50
51ADD_OBJ=	useradd.o     uid.o        homedir.o \
52		groups.o      call_pass.o      userdefs.o   messages.o \
53		val_lgrp.o    funcs.o	       val_lprj.o   proj.o
54
55DEL_OBJ=	userdel.o     call_pass.o      rmfiles.o    isbusy.o \
56		groups.o      messages.o       funcs.o      proj.o
57
58MOD_OBJ=	usermod.o     uid.o            movedir.o    groups.o \
59		rmfiles.o     call_pass.o      isbusy.o     homedir.o \
60		userdefs.o    messages.o       val_lgrp.o   funcs.o \
61		val_lprj.o    proj.o
62
63OBJECTS=	$(ADD_OBJ)     $(DEL_OBJ)    $(MOD_OBJ)
64
65SRCS=		$(OBJECTS:.o=.c)
66
67CLOBBERFILES=	$(PROFILE)
68LIBDIR=		../lib
69LIBUSRGRP=	$(LIBDIR)/lib.a
70LIBADM=		-ladm
71LOCAL=		../inc
72HERE=		.
73LINTFLAGS=	-u
74
75ROOTSKEL=	$(ROOTETC)/skel
76INSSBINPROG=	$(SBINPROG:%=$(ROOTUSRSBIN)/%)
77INSSKELFILE=	$(SKELFILE:%=$(ROOTSKEL)/%)
78
79CPPFLAGS=	-I$(HERE) -I$(LOCAL) $(CPPFLAGS.master)
80OWNER= 		root
81GROUP= 		sys
82
83$(INSSBINPROG)  := FILEMODE = 0555
84$(INSSYSADMPROG):= FILEMODE = 0500
85$(INSSKELFILE)  := FILEMODE = 0644
86$(INSSKELFILE)  := GROUP = other
87$(ROOTSKEL)	:= OWNER = root
88$(ROOTSKEL)	:= GROUP = sys
89
90$(USERADD) :=	OBJS = $(ADD_OBJ)
91$(USERADD) :=	LIBS = $(LIBUSRGRP)
92
93$(USERDEL) :=	OBJS = $(DEL_OBJ)
94$(USERDEL) :=	LIBS = $(LIBUSRGRP)
95
96$(USERMOD) :=	OBJS = $(MOD_OBJ)
97$(USERMOD) :=	LIBS = $(LIBUSRGRP)
98
99LDLIBS +=	-lsecdb -lproject -ltsol
100
101.PARALLEL: $(OBJECTS)
102
103all: 		$(PRODUCT)
104
105$(PROFILE):    $(STDPROFILE)
106	$(GREP) -v "^#ident" $(STDPROFILE) > $(PROFILE)
107
108$(PROG):	$$(OBJS) $$(LIBS)
109	$(LINK.c) $(OBJS) -o $@ $(LIBS) $(LDLIBS)
110	$(POST_PROCESS)
111
112$(USERADD):	$(ADD_OBJ)
113$(USERMOD):	$(MOD_OBJ)
114$(USERDEL):	$(DEL_OBJ)
115
116install:	all .WAIT $(ROOTSKEL) $(INSSBINPROG) $(INSSKELFILE)
117		$(RM) $(ROOTUSRSBIN)/$(ROLEADD)
118		$(LN) $(ROOTUSRSBIN)/$(USERADD) $(ROOTUSRSBIN)/$(ROLEADD)
119		$(RM) $(ROOTUSRSBIN)/$(ROLEDEL)
120		$(LN) $(ROOTUSRSBIN)/$(USERDEL) $(ROOTUSRSBIN)/$(ROLEDEL)
121		$(RM) $(ROOTUSRSBIN)/$(ROLEMOD)
122		$(LN) $(ROOTUSRSBIN)/$(USERMOD) $(ROOTUSRSBIN)/$(ROLEMOD)
123
124$(ROOTSKEL):
125	$(INS.dir)
126
127$(ROOTSKEL)/%:	%
128	$(INS.file)
129
130clean:
131	$(RM) $(OBJECTS)
132
133lint:	lint_SRCS
134
135include ../../Makefile.targ
136