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