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