xref: /illumos-gate/usr/src/lib/libsecdb/Makefile (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
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) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
23#
24
25include ../Makefile.lib
26
27SUBDIRS =	help $(MACH)
28$(BUILD64)SUBDIRS += $(MACH64)
29
30MSGSUBDIRS=	help
31
32all:=		TARGET= all
33clean:=		TARGET= clean
34clobber:=	TARGET= clobber
35install:=	TARGET= install
36_msg:=		TARGET= _msg
37
38.KEEP_STATE:
39
40ROOTETC =		$(ROOT)/etc
41ROOTETCSECURITY =	$(ROOTETC)/security
42
43EFILES =	user_attr
44EFILESRC =	$(EFILES:%=%)
45ETCFILES =	$(EFILES:%=$(ROOTETC)/%)
46ETCDFILES =	$(EFILES:%=$(ROOTETC)/%.d/SUNWcs)
47
48ESDFILES =	auth_attr exec_attr prof_attr
49ESFILES =		$(ESDFILES) policy.conf
50ESSRC =			$(ESFILES:%=%)
51ETCSECURITYFILES =	$(ESFILES:%=$(ROOTETCSECURITY)/%)
52ETCSECURITYDFILES =	$(ESDFILES:%=$(ROOTETCSECURITY)/%.d/SUNWcs)
53
54
55MFSTFILES =	rbac.xml
56MANIFESTDIR =	$(ROOT)/lib/svc/manifest/system
57MANIFEST =	$(MFSTFILES:%=$(MANIFESTDIR)/%)
58$(MANIFEST) :=	FILEMODE = 0444
59
60METHODFILES =	svc-rbac
61METHODDIR =	$(ROOT)/lib/svc/method
62METHOD =	$(METHODFILES:%=$(METHODDIR)/%)
63$(METHOD) :=	FILEMODE = 0555
64
65SCRIPTS =		i.rbac r.rbac
66CLASS_SCR_SRC_DIR =	common
67INSTALL_DIR =		$(ROOT)/usr/sadm/install
68
69CLASS_SCR_DIR =		$(INSTALL_DIR)/scripts
70
71CLASS_SCR_FILES =	$(SCRIPTS:%=$(CLASS_SCR_DIR)/%)
72$(CLASS_SCR_FILES) :=	FILEMODE = 0555
73
74all clean clobber delete install package: $(SUBDIRS)
75_msg: $(MSGSUBDIRS)
76
77install:	install_data
78
79install_data:	$(ETCSECURITYFILES) $(ETCSECURITYDFILES) $(ETCFILES) \
80		$(ETCDFILES) $(CLASS_SCR_FILES) $(MANIFESTDIR) $(MANIFEST) \
81		$(METHODDIR) $(METHOD)
82
83ATTR_FILES =	auth_attr exec_attr prof_attr user_attr
84${ATTR_FILES}:	$$@.txt ${CLASS_SCR_SRC_DIR}/i.rbac
85	> $@
86	$(ECHO) $@.txt $@ | $(SHELL) ${CLASS_SCR_SRC_DIR}/i.rbac
87
88$(ETCSECURITYDFILES) $(ETCDFILES): $$(@D)
89
90$(ETCSECURITYFILES) $(ETCFILES): $(ETCSECURITY) $(ROOTETCSECURITY)
91
92$(ETCSECURITY)/%: %
93	$(INS.file)
94
95$(ROOTETCSECURITY):
96	$(INS.dir)
97
98$(ROOTETCSECURITY)/%: %
99	$(INS.file)
100
101$(ROOTETCSECURITY)/%.d/SUNWcs: %
102	$(INS.rename)
103
104$(ROOTETC)/% : %
105	$(INS.file)
106
107$(ROOTETC)/%.d/SUNWcs: %
108	$(INS.rename)
109
110$(MANIFESTDIR):
111	$(INS.dir)
112
113$(MANIFESTDIR)/% : %
114	$(INS.file)
115
116$(METHODDIR):
117	$(INS.dir)
118
119$(METHODDIR)/% : %
120	$(INS.file)
121
122$(CLASS_SCR_FILES): $(INSTALL_DIR) $(CLASS_SCR_DIR)
123
124$(INSTALL_DIR):
125	$(INS.dir)
126
127$(CLASS_SCR_DIR):
128	$(INS.dir)
129
130$(CLASS_SCR_DIR)/%: $(CLASS_SCR_SRC_DIR)/%
131	$(INS.file)
132
133clobber clean:
134	$(RM) $(ATTR_FILES)
135
136$(SUBDIRS):	FRC
137	@cd $@; pwd; $(MAKE) $(TARGET)
138
139FRC:
140