xref: /titanic_41/usr/src/lib/libbsm/Makefile (revision f4b3ec61df05330d25f55a36b975b4d7519fdeb1)
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
28include ../Makefile.lib
29
30SUBDIRS =	$(MACH)
31$(BUILD64)SUBDIRS += $(MACH64)
32
33XGETFLAGS_ADT += -a
34
35all :=		TARGET= all
36clean :=	TARGET= clean
37clobber :=	TARGET= clobber
38delete :=	TARGET= delete
39install :=	TARGET= install
40lint :=		TARGET= lint
41package :=	TARGET= package
42
43.KEEP_STATE:
44
45all clean clobber delete install lint package: $(SUBDIRS)
46
47COMMONDIR = common
48
49#
50# Macros for libbsm header files. These define user-level only interfaces.
51#
52GENHDRS = audit_uevents.h
53HDRS = libbsm.h devices.h devalloc.h adt.h adt_event.h audit_private.h
54COMMONHDRS =	$(HDRS:%=$(COMMONDIR)/%)
55ROOTHDRDIR = 	$(ROOT)/usr/include/bsm
56ROOTCHDRS = 	$(HDRS:%=$(ROOTHDRDIR)/%)
57ROOTHDRS = 	$(GENHDRS:%=$(ROOTHDRDIR)/%)
58
59CHECKCHDRS =	$(COMMONHDRS:%.h=%.check)
60CHECKHDRS =	$(GENHDRS:%.h=%.check)
61
62$(ROOTHDRS) := 	FILEMODE = 0644
63$(ROOTCHDRS) :=	FILEMODE = 0644
64
65#
66# Macros for libbsm database files. These should probably be installed
67# from somewhere else. Until we find that better place, install them
68# from here.
69#
70
71ROOTETCSECURITY = 	$(ROOT)/etc/security
72$(ROOTETCSECURITY) := 	DIRMODE = 0755
73$(ROOTETCSECURITY) := 	OWNER = root
74$(ROOTETCSECURITY) := 	GROUP = sys
75
76ESFILES =		audit_class audit_control audit_event audit_user
77ESSRC =			$(ESFILES:%=%.txt)
78ETCSECURITYFILES =	$(ESFILES:%=$(ROOTETCSECURITY)/%)
79$(ETCSECURITYFILES) :=	FILEMODE = 0644
80$(ETCSECURITYFILES) :=	OWNER = root
81$(ETCSECURITYFILES) :=	GROUP = sys
82
83EESFILES =		audit_startup
84EESSRC =		$(EESFILES:%=%.txt)
85EETCSECURITYFILES =	$(EESFILES:%=$(ROOTETCSECURITY)/%)
86$(EETCSECURITYFILES) :=	FILEMODE = 0744
87$(EETCSECURITYFILES) :=	OWNER = root
88$(EETCSECURITYFILES) :=	GROUP = sys
89
90#
91# /etc/security/audit/localhost/files is a symbolic link to /var/audit.
92# This is provided so that auditreduce will work in the default configuration.
93#
94RESA=$(ROOTETCSECURITY)/audit
95RESAL=$(RESA)/localhost
96VARAUDIT=$(ROOT)/var/audit
97AUDITDIRS=$(RESA) $(RESAL) $(VARAUDIT)
98$(AUDITDIRS) := FILEMODE = 0750
99$(AUDITDIRS) := OWNER = root
100$(AUDITDIRS) := GROUP = sys
101
102ARSYMLNK=$(RESAL)/files
103
104#
105# message catalogue file
106#
107MSGFILES =	`$(GREP) -l gettext $(COMMONDIR)/*.c`
108POFILE =	libbsm.po
109
110#
111# Definitions for XML (DTD AND XSL)
112#
113DTD =		adt_record.dtd.1
114XSL =		adt_record.xsl.1
115ROOTXMLDIR =	$(ROOT)/usr/share/lib/xml
116ROOTDTDDIR=	$(ROOTXMLDIR)/dtd
117ROOTXSLDIR=	$(ROOTXMLDIR)/style
118ROOTDTD=	$(DTD:%=$(ROOTDTDDIR)/%)
119ROOTXSL=	$(XSL:%=$(ROOTXSLDIR)/%)
120ROOTXMLDIRS =	$(ROOTXMLDIR) $(ROOTDTDDIR) $(ROOTXSLDIR)
121ROOTXMLFILES =	$(ROOTDTD) $(ROOTXSL)
122
123$(ROOTXMLDIRS) :=  FILEMODE = 755
124$(ROOTXMLDIRS) :=  OWNER = root
125$(ROOTXMLDIRS) :=  GROUP = sys
126
127$(ROOTXMLFILES) :=  FILEMODE = 444
128$(ROOTXMLFILES) :=  OWNER = root
129$(ROOTXMLFILES) :=  GROUP = bin
130
131
132CPPFLAGS += -I$(COMMONDIR)
133CPPFLAGS += -D_REENTRANT
134
135.KEEP_STATE:
136
137install: install_dirs install_data
138
139#		$(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
140
141install_h: $(ROOTHDRDIR) $(ROOTHDRS) $(ROOTCHDRS)
142
143check:	$(CHECKHDRS) $(CHECKCHDRS)
144
145install_data: $(ESSRC) $(RESSRC) $(ROOTETCSECURITY) $(ETCSECURITYFILES) \
146	$(EETCSECURITYFILES) $(ROOTXMLFILES)
147
148install_dirs: $(AUDITDIRS) $(ARSYMLNK) $(ROOTXMLDIRS)
149
150audit_uevents.h: mkhdr.sh audit_event.txt
151	sh mkhdr.sh
152
153$(ETCSECURITYFILES) $(EETCSECURITYFILES) $(RESA): \
154	$(ETCSECURITY) \
155	$(ROOTETCSECURITY)
156
157$(RESAL): $(RESA)
158
159$(ARSYMLNK): $(RESAL)
160
161$(ROOTHDRDIR):
162	$(INS.dir)
163
164$(ROOTHDRDIR)/%:%
165	$(INS.file)
166
167$(ROOTHDRDIR)/%:$(COMMONDIR)/%
168	$(INS.file)
169
170$(ROOTXMLDIRS):
171	$(INS.dir)
172
173$(ROOTDTDDIR)/% $(ROOTXSLDIR)/%: %
174	$(INS.file)
175
176$(AUDITDIRS):
177	$(INS.dir)
178
179$(ARSYMLNK):
180	$(RM) $@
181	$(SYMLINK) ../../../../var/audit $@
182
183$(ETCSECURITY)/%: %.txt
184	$(INS.rename)
185
186$(ROOTETCSECURITY):
187	$(INS.dir)
188
189$(ROOTETCSECURITY)/%: %.txt
190	$(INS.rename)
191
192$(POFILE):	 pofile_MSGFILES
193
194_msg:	$(MSGDOMAINPOFILE)
195
196# has strings but doesn't use gettext
197adt_xlate.po: $(COMMONDIR)/adt_xlate.c
198	$(RM) adt_xlate.po
199	$(XGETTEXT) $(XGETFLAGS_ADT) $(COMMONDIR)/adt_xlate.c
200	$(SED) "/^domain/d" < messages.po > adt_xlate.po
201	$(RM) messages.po
202
203$(SUBDIRS):	FRC
204	@cd $@; pwd; $(MAKE) $(TARGET)
205
206FRC:
207
208include ../Makefile.targ
209include ../../Makefile.msg.targ
210