xref: /illumos-gate/usr/src/lib/libbsm/Makefile (revision 9512fe850e98fdd448c638ca63fdd92a8a510255)
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_event
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
90RESFILES = 		audit_control audit_user
91RESSRC =		$(RESFILES:%=%.txt)
92ROOTETCSECURITYFILES =	$(RESFILES:%=$(ROOTETCSECURITY)/%)
93$(ROOTETCSECURITYFILES) := FILEMODE = 0640
94$(ROOTETCSECURITYFILES) := OWNER = root
95$(ROOTETCSECURITYFILES) := GROUP = sys
96
97#
98# /etc/security/audit/localhost/files is a symbolic link to /var/audit.
99# This is provided so that auditreduce will work in the default configuration.
100#
101RESA=$(ROOTETCSECURITY)/audit
102RESAL=$(RESA)/localhost
103VARAUDIT=$(ROOT)/var/audit
104AUDITDIRS=$(RESA) $(RESAL) $(VARAUDIT)
105$(AUDITDIRS) := FILEMODE = 0750
106$(AUDITDIRS) := OWNER = root
107$(AUDITDIRS) := GROUP = sys
108
109ARSYMLNK=$(RESAL)/files
110
111#
112# message catalogue file
113#
114MSGFILES =	`$(GREP) -l gettext $(COMMONDIR)/*.c`
115POFILE =	libbsm.po
116
117#
118# Definitions for XML (DTD AND XSL)
119#
120DTD =		adt_record.dtd.1
121XSL =		adt_record.xsl.1
122ROOTXMLDIR =	$(ROOT)/usr/share/lib/xml
123ROOTDTDDIR=	$(ROOTXMLDIR)/dtd
124ROOTXSLDIR=	$(ROOTXMLDIR)/style
125ROOTDTD=	$(DTD:%=$(ROOTDTDDIR)/%)
126ROOTXSL=	$(XSL:%=$(ROOTXSLDIR)/%)
127ROOTXMLDIRS =	$(ROOTXMLDIR) $(ROOTDTDDIR) $(ROOTXSLDIR)
128ROOTXMLFILES =	$(ROOTDTD) $(ROOTXSL)
129
130$(ROOTXMLDIRS) :=  FILEMODE = 755
131$(ROOTXMLDIRS) :=  OWNER = root
132$(ROOTXMLDIRS) :=  GROUP = sys
133
134$(ROOTXMLFILES) :=  FILEMODE = 444
135$(ROOTXMLFILES) :=  OWNER = root
136$(ROOTXMLFILES) :=  GROUP = bin
137
138
139CPPFLAGS += -I$(COMMONDIR)
140CPPFLAGS += -D_REENTRANT
141
142.KEEP_STATE:
143
144install: install_dirs install_data
145
146#		$(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
147
148install_h: $(ROOTHDRDIR) $(ROOTHDRS) $(ROOTCHDRS)
149
150check:	$(CHECKHDRS) $(CHECKCHDRS)
151
152install_data: $(ESSRC) $(RESSRC) $(ROOTETCSECURITY) $(ETCSECURITYFILES) \
153	$(EETCSECURITYFILES) $(ROOTETCSECURITYFILES) $(ROOTXMLFILES)
154
155install_dirs: $(AUDITDIRS) $(ARSYMLNK) $(ROOTXMLDIRS)
156
157audit_uevents.h: mkhdr.sh audit_event.txt
158	sh mkhdr.sh
159
160$(ETCSECURITYFILES) $(EETCSECURITYFILES) $(ROOTETCSECURITYFILES) $(RESA): \
161	$(ETCSECURITY) \
162	$(ROOTETCSECURITY)
163
164$(RESAL): $(RESA)
165
166$(ARSYMLNK): $(RESAL)
167
168$(ROOTHDRDIR):
169	$(INS.dir)
170
171$(ROOTHDRDIR)/%:%
172	$(INS.file)
173
174$(ROOTHDRDIR)/%:$(COMMONDIR)/%
175	$(INS.file)
176
177$(ROOTXMLDIRS):
178	$(INS.dir)
179
180$(ROOTDTDDIR)/% $(ROOTXSLDIR)/%: %
181	$(INS.file)
182
183$(AUDITDIRS):
184	$(INS.dir)
185
186$(ARSYMLNK):
187	$(RM) $@
188	$(SYMLINK) ../../../../var/audit $@
189
190$(ETCSECURITY)/%: %.txt
191	$(INS.rename)
192
193$(ROOTETCSECURITY):
194	$(INS.dir)
195
196$(ROOTETCSECURITY)/%: %.txt
197	$(INS.rename)
198
199$(POFILE):	 pofile_MSGFILES
200
201_msg:	$(MSGDOMAINPOFILE)
202
203# has strings but doesn't use gettext
204adt_xlate.po: $(COMMONDIR)/adt_xlate.c
205	$(RM) adt_xlate.po
206	$(XGETTEXT) $(XGETFLAGS_ADT) $(COMMONDIR)/adt_xlate.c
207	$(SED) "/^domain/d" < messages.po > adt_xlate.po
208	$(RM) messages.po
209
210$(SUBDIRS):	FRC
211	@cd $@; pwd; $(MAKE) $(TARGET)
212
213FRC:
214
215include ../Makefile.targ
216include ../../Makefile.msg.targ
217