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