xref: /titanic_51/usr/src/lib/libbsm/Makefile (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 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.master
32include ../Makefile.lib
33
34SUBDIRS=	spec .WAIT $(MACH) $(BUILD64) $(MACH64)
35
36XGETFLAGS_ADT += -a
37
38all :=		TARGET= all
39clean :=	TARGET= clean
40clobber :=	TARGET= clobber
41delete :=	TARGET= delete
42install :=	TARGET= install
43lint :=		TARGET= lint
44package :=	TARGET= package
45
46.KEEP_STATE:
47
48all clean clobber delete install lint package: $(SUBDIRS)
49
50OBJECTS=	adr.o \
51		adrf.o \
52		adrm.o \
53		adt.o \
54		adt_token.o \
55		adt_xlate.o \
56		au_open.o \
57		au_preselect.o \
58		au_to.o \
59		au_usermask.o \
60		audit_allocate.o \
61		audit_class.o \
62		audit_cron.o \
63		audit_crontab.o \
64		audit_at.o \
65		audit_event.o \
66		audit_ftpd.o \
67		audit_halt.o \
68		audit_inetd.o \
69		audit_kadmind.o \
70		audit_krb5kdc.o \
71		audit_login.o \
72		audit_mountd.o \
73		audit_mgrs.o \
74		audit_newgrp.o \
75		audit_plugin.o \
76		audit_reboot.o \
77		audit_rexd.o \
78		audit_rexecd.o \
79		audit_rshd.o \
80		audit_settid.o \
81		audit_shutdown.o \
82		audit_su.o \
83		audit_uadmin.o \
84		audit_user.o \
85		bsm.o \
86		generic.o \
87		getacinfo.o \
88		getacval.o \
89		getauditflags.o \
90		getdaent.o \
91		getdment.o \
92		getfaudflgs.o
93
94COMMONDIR = common
95
96#
97# Macros for libbsm header files. These define user-level only interfaces.
98#
99GENHDRS = audit_uevents.h
100HDRS = libbsm.h devices.h adt.h adt_event.h audit_private.h
101COMMONHDRS =	$(HDRS:%=$(COMMONDIR)/%)
102ROOTHDRDIR = 	$(ROOT)/usr/include/bsm
103ROOTCHDRS = 	$(HDRS:%=$(ROOTHDRDIR)/%)
104ROOTHDRS = 	$(GENHDRS:%=$(ROOTHDRDIR)/%)
105
106CHECKCHDRS =	$(COMMONHDRS:%.h=%.check)
107CHECKHDRS =	$(GENHDRS:%.h=%.check)
108
109$(ROOTHDRS) := 	FILEMODE = 0644
110$(ROOTCHDRS) :=	FILEMODE = 0644
111
112#
113# Macros for libbsm database files. These should probably be installed
114# from somewhere else. Until we find that better place, install them
115# from here.
116#
117
118ROOTETCSECURITY = 	$(ROOT)/etc/security
119$(ROOTETCSECURITY) := 	DIRMODE = 0755
120$(ROOTETCSECURITY) := 	OWNER = root
121$(ROOTETCSECURITY) := 	GROUP = sys
122
123ESFILES =		audit_class audit_event
124ESSRC =			$(ESFILES:%=%.txt)
125ETCSECURITYFILES =	$(ESFILES:%=$(ROOTETCSECURITY)/%)
126$(ETCSECURITYFILES) :=	FILEMODE = 0644
127$(ETCSECURITYFILES) :=	OWNER = root
128$(ETCSECURITYFILES) :=	GROUP = sys
129
130EESFILES =		audit_startup
131EESSRC =		$(EESFILES:%=%.txt)
132EETCSECURITYFILES =	$(EESFILES:%=$(ROOTETCSECURITY)/%)
133$(EETCSECURITYFILES) :=	FILEMODE = 0744
134$(EETCSECURITYFILES) :=	OWNER = root
135$(EETCSECURITYFILES) :=	GROUP = sys
136
137RESFILES = 		audit_control audit_user
138RESSRC =		$(RESFILES:%=%.txt)
139ROOTETCSECURITYFILES =	$(RESFILES:%=$(ROOTETCSECURITY)/%)
140$(ROOTETCSECURITYFILES) := FILEMODE = 0640
141$(ROOTETCSECURITYFILES) := OWNER = root
142$(ROOTETCSECURITYFILES) := GROUP = sys
143
144#
145# /etc/security/audit/localhost/files is a symbolic link to /var/audit.
146# This is provided so that auditreduce will work in the default configuration.
147#
148RESA=$(ROOTETCSECURITY)/audit
149RESAL=$(RESA)/localhost
150VARAUDIT=$(ROOT)/var/audit
151AUDITDIRS=$(RESA) $(RESAL) $(VARAUDIT)
152$(AUDITDIRS) := FILEMODE = 0750
153$(AUDITDIRS) := OWNER = root
154$(AUDITDIRS) := GROUP = sys
155
156ARSYMLNK=$(RESAL)/files
157
158#
159# message catalogue file
160#
161TEXT_DOMAIN= SUNW_OST_OSLIB
162POFILE= libbsm.po
163CATALOG=libbsm.po
164POFILES= $(OBJECTS:%.o=%.po)
165
166#
167# Definitions for XML (DTD AND XSL)
168#
169DTD =		adt_record.dtd.1
170XSL =		adt_record.xsl.1
171ROOTXMLDIR =	$(ROOT)/usr/share/lib/xml
172ROOTDTDDIR=	$(ROOTXMLDIR)/dtd
173ROOTXSLDIR=	$(ROOTXMLDIR)/style
174ROOTDTD=	$(DTD:%=$(ROOTDTDDIR)/%)
175ROOTXSL=	$(XSL:%=$(ROOTXSLDIR)/%)
176ROOTXMLDIRS =	$(ROOTXMLDIR) $(ROOTDTDDIR) $(ROOTXSLDIR)
177ROOTXMLFILES =	$(ROOTDTD) $(ROOTXSL)
178
179$(ROOTXMLDIRS) :=  FILEMODE = 755
180$(ROOTXMLDIRS) :=  OWNER = root
181$(ROOTXMLDIRS) :=  GROUP = sys
182
183$(ROOTXMLFILES) :=  FILEMODE = 444
184$(ROOTXMLFILES) :=  OWNER = root
185$(ROOTXMLFILES) :=  GROUP = bin
186
187
188CPPFLAGS += -I$(COMMONDIR)
189CPPFLAGS += -D_REENTRANT
190
191.KEEP_STATE:
192
193install: install_dirs install_data
194
195#		$(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
196
197install_h: $(ROOTHDRDIR) $(ROOTHDRS) $(ROOTCHDRS)
198
199check:	$(CHECKHDRS) $(CHECKCHDRS)
200
201install_data: $(ESSRC) $(RESSRC) $(ROOTETCSECURITY) $(ETCSECURITYFILES) \
202	$(EETCSECURITYFILES) $(ROOTETCSECURITYFILES) $(ROOTXMLFILES)
203
204install_dirs: $(AUDITDIRS) $(ARSYMLNK) $(ROOTXMLDIRS)
205
206audit_uevents.h: mkhdr.sh audit_event.txt
207	sh mkhdr.sh
208
209$(ETCSECURITYFILES) $(EETCSECURITYFILES) $(ROOTETCSECURITYFILES) $(RESA): \
210	$(ETCSECURITY) \
211	$(ROOTETCSECURITY)
212
213$(RESAL): $(RESA)
214
215$(ARSYMLNK): $(RESAL)
216
217$(ROOTHDRDIR):
218	$(INS.dir)
219
220$(ROOTHDRDIR)/%:%
221	$(INS.file)
222
223$(ROOTHDRDIR)/%:$(COMMONDIR)/%
224	$(INS.file)
225
226$(ROOTXMLDIRS):
227	$(INS.dir)
228
229$(ROOTDTDDIR)/% $(ROOTXSLDIR)/%: %
230	$(INS.file)
231
232$(AUDITDIRS):
233	$(INS.dir)
234
235$(ARSYMLNK):
236	$(RM) $@
237	$(SYMLINK) ../../../../var/audit $@
238
239$(ETCSECURITY)/%: %.txt
240	$(INS.rename)
241
242$(ROOTETCSECURITY):
243	$(INS.dir)
244
245$(ROOTETCSECURITY)/%: %.txt
246	$(INS.rename)
247
248%.po: $(COMMONDIR)/%.c
249	$(COMPILE.cpp) $<  > $<.i
250	$(BUILD.po)
251
252_msg: $(MSGDOMAIN) $(POFILE)
253	$(RM) $(MSGDOMAIN)/$(CATALOG)
254	$(CP) $(POFILE) $(MSGDOMAIN)
255
256catalog: _msg
257
258po_clean:
259	$(RM) $(POFILES) $(POFILE)
260
261clobber: po_clean
262
263$(POFILE): .WAIT $(POFILES)
264	$(RM) $@
265	$(CAT) $(POFILES) > $@
266
267# has strings but doesn't use gettext
268adt_xlate.po: $(COMMONDIR)/adt_xlate.c
269	$(RM) adt_xlate.po
270	$(XGETTEXT) $(XGETFLAGS_ADT) $(COMMONDIR)/adt_xlate.c
271	$(SED) "/^domain/d" < messages.po > adt_xlate.po
272	$(RM) messages.po
273
274$(MSGDOMAIN):
275	$(INS.dir)
276
277
278spec $(MACH) $(MACH64) :	FRC
279	@cd $@; pwd; $(MAKE) $(TARGET)
280
281FRC:
282