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