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