Merge illumos-gate
[unleashed.git] / usr / src / cmd / oamuser / user / Makefile
blob303e3931d2e8d5c6c6f2fb65b98b210906e79cd9
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
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
26 # Copyright (c) 2018, Joyent, Inc.
28 DEFAULTFILES= useradd.dfl
30 include ../../Makefile.cmd
32 GREP= grep
34 USERADD= useradd
35 USERDEL= userdel
36 USERMOD= usermod
37 ROLEADD= roleadd
38 ROLEDEL= roledel
39 ROLEMOD= rolemod
41 SBINPROG= $(USERADD) $(USERDEL) $(USERMOD)
43 # Removing sysadm: deleted $(SYSADMPROG) from this target.
45 PROG= $(SBINPROG)
46 PRODUCT= $(PROG)
48 ADD_OBJ= useradd.o homedir.o groups.o call_pass.o \
49 userdefs.o messages.o val_lgrp.o funcs.o \
50 val_lprj.o proj.o
52 DEL_OBJ= userdel.o call_pass.o homedir.o isbusy.o \
53 groups.o messages.o funcs.o proj.o
55 MOD_OBJ= usermod.o movedir.o groups.o homedir.o \
56 call_pass.o isbusy.o userdefs.o \
57 messages.o val_lgrp.o funcs.o val_lprj.o \
58 proj.o
60 OBJECTS= $(ADD_OBJ) $(DEL_OBJ) $(MOD_OBJ)
62 SRCS= $(OBJECTS:.o=.c)
64 LIBDIR= ../lib
65 LIBUSRGRP= $(LIBDIR)/lib.a
66 LIBADM= -ladm
67 LOCAL= ../inc
68 HERE= .
70 ROOTSKEL= $(ROOTETC)/skel
71 INSSBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
72 INSSKELFILE= $(SKELFILE:%=$(ROOTSKEL)/%)
74 CPPFLAGS= -I$(HERE) -I$(LOCAL) $(CPPFLAGS.master)
76 # not linted
77 SMATCH=off
79 $(INSSBINPROG) := FILEMODE = 0555
80 $(INSSYSADMPROG):= FILEMODE = 0500
81 $(INSSKELFILE) := FILEMODE = 0644
83 $(USERADD) := OBJS = $(ADD_OBJ)
84 $(USERADD) := LIBS = $(LIBUSRGRP)
85 $(USERADD) := LDLIBS += -lcmdutils
87 $(USERDEL) := OBJS = $(DEL_OBJ)
88 $(USERDEL) := LIBS = $(LIBUSRGRP)
90 $(USERMOD) := OBJS = $(MOD_OBJ)
91 $(USERMOD) := LIBS = $(LIBUSRGRP)
93 LDLIBS += -lsecdb -lproject -lzfs
95 .PARALLEL: $(OBJECTS)
97 all: $(PRODUCT)
99 $(PROG): $$(OBJS) $$(LIBS)
100 $(LINK.c) $(OBJS) -o $@ $(LIBS) $(LDLIBS)
101 $(POST_PROCESS)
103 $(USERADD): $(ADD_OBJ)
104 $(USERMOD): $(MOD_OBJ)
105 $(USERDEL): $(DEL_OBJ)
107 install: 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)
116 clean:
117 $(RM) $(OBJECTS)
120 include ../../Makefile.targ