xref: /illumos-gate/usr/src/cmd/oamuser/user/Makefile (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
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
99LAZYLIBS = $(ZLAZYLOAD) -ltsol $(ZNOLAZYLOAD)
100lint := LAZYLIBS = -ltsol
101LDLIBS +=	-lsecdb -lproject $(LAZYLIBS)
102
103.PARALLEL: $(OBJECTS)
104
105all: 		$(PRODUCT)
106
107$(PROFILE):    $(STDPROFILE)
108	$(GREP) -v "^#ident" $(STDPROFILE) > $(PROFILE)
109
110$(PROG):	$$(OBJS) $$(LIBS)
111	$(LINK.c) $(OBJS) -o $@ $(LIBS) $(LDLIBS)
112	$(POST_PROCESS)
113
114$(USERADD):	$(ADD_OBJ)
115$(USERMOD):	$(MOD_OBJ)
116$(USERDEL):	$(DEL_OBJ)
117
118install:	all .WAIT $(ROOTSKEL) $(INSSBINPROG) $(INSSKELFILE)
119		$(RM) $(ROOTUSRSBIN)/$(ROLEADD)
120		$(LN) $(ROOTUSRSBIN)/$(USERADD) $(ROOTUSRSBIN)/$(ROLEADD)
121		$(RM) $(ROOTUSRSBIN)/$(ROLEDEL)
122		$(LN) $(ROOTUSRSBIN)/$(USERDEL) $(ROOTUSRSBIN)/$(ROLEDEL)
123		$(RM) $(ROOTUSRSBIN)/$(ROLEMOD)
124		$(LN) $(ROOTUSRSBIN)/$(USERMOD) $(ROOTUSRSBIN)/$(ROLEMOD)
125
126$(ROOTSKEL):
127	$(INS.dir)
128
129$(ROOTSKEL)/%:	%
130	$(INS.file)
131
132clean:
133	$(RM) $(OBJECTS)
134
135lint:	lint_SRCS
136
137include ../../Makefile.targ
138