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