8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libbsm / Makefile
blob514358a52fbc67b1ad19956edef338c5e3346d4a
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
25 include ../Makefile.lib
27 SUBDIRS = $(MACH)
28 $(BUILD64)SUBDIRS += $(MACH64)
30 XGETFLAGS_ADT += -a
32 all := TARGET= all
33 clean := TARGET= clean
34 clobber := TARGET= clobber
35 delete := TARGET= delete
36 install := TARGET= install
37 lint := TARGET= lint
38 package := TARGET= package
40 .KEEP_STATE:
42 COMMONDIR = common
45 # Macros for libbsm header files. These define user-level only interfaces.
47 GENHDRS = audit_uevents.h
48 HDRS = libbsm.h devices.h devalloc.h adt.h adt_event.h audit_private.h
49 GENSRCS = $(COMMONDIR)/adt_xlate.c $(COMMONDIR)/adt_event.h
50 COMMONHDRS = $(HDRS:%=$(COMMONDIR)/%)
51 ROOTHDRDIR = $(ROOT)/usr/include/bsm
52 ROOTCHDRS = $(HDRS:%=$(ROOTHDRDIR)/%)
53 ROOTHDRS = $(GENHDRS:%=$(ROOTHDRDIR)/%)
55 CHECKCHDRS = $(COMMONHDRS:%.h=%.check)
56 CHECKHDRS = $(GENHDRS:%.h=%.check)
58 $(ROOTHDRS) := FILEMODE = 0644
59 $(ROOTCHDRS) := FILEMODE = 0644
61 all install lint package: $(GENSRCS) $(SUBDIRS)
62 clean clobber delete: $(SUBDIRS)
65 # Macros for libbsm database files. These should probably be installed
66 # from somewhere else. Until we find that better place, install them
67 # from here.
70 ROOTETCSECURITY = $(ROOT)/etc/security
71 $(ROOTETCSECURITY) := DIRMODE = 0755
73 ESFILES = audit_class audit_event
74 ESSRC = $(ESFILES:%=%.txt)
75 ETCSECURITYFILES = $(ESFILES:%=$(ROOTETCSECURITY)/%)
76 $(ETCSECURITYFILES) := FILEMODE = 0644
79 # /etc/security/audit/localhost/files is a symbolic link to /var/audit.
80 # This is provided so that auditreduce will work in the default configuration.
82 RESA=$(ROOTETCSECURITY)/audit
83 RESAL=$(RESA)/localhost
84 VARAUDIT=$(ROOT)/var/audit
85 AUDITDIRS=$(RESA) $(RESAL) $(VARAUDIT)
86 $(AUDITDIRS) := FILEMODE = 0750
88 ARSYMLNK=$(RESAL)/files
91 # message catalogue file
93 MSGFILES = `$(GREP) -l gettext $(COMMONDIR)/*.c`
94 POFILE = libbsm.po
97 # Definitions for XML (DTD AND XSL)
99 DTD = adt_record.dtd.1
100 XSL = adt_record.xsl.1
101 ROOTXMLDIR = $(ROOT)/usr/share/lib/xml
102 ROOTDTDDIR= $(ROOTXMLDIR)/dtd
103 ROOTXSLDIR= $(ROOTXMLDIR)/style
104 ROOTDTD= $(DTD:%=$(ROOTDTDDIR)/%)
105 ROOTXSL= $(XSL:%=$(ROOTXSLDIR)/%)
106 ROOTXMLDIRS = $(ROOTXMLDIR) $(ROOTDTDDIR) $(ROOTXSLDIR)
107 ROOTXMLFILES = $(ROOTDTD) $(ROOTXSL)
109 $(ROOTXMLDIRS) := FILEMODE = 755
111 $(ROOTXMLFILES) := FILEMODE = 444
114 CPPFLAGS += -I$(COMMONDIR)
115 CPPFLAGS += -D_REENTRANT
117 CLEANFILES += $(GENSRCS) $(GENHDRS)
119 ADTXMLFILE = $(COMMONDIR)/adt.xml
120 ADTXSDFILE = $(COMMONDIR)/adt.xsd
121 AUDITXML = auditxml
123 .KEEP_STATE:
125 install: install_dirs install_data
127 # $(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
129 install_h: $(ROOTHDRDIR) $(ROOTHDRS) $(ROOTCHDRS)
131 check: $(CHECKHDRS) $(CHECKCHDRS)
132 xmllint --schema $(ADTXSDFILE) --noout $(ADTXMLFILE)
134 install_data: $(ESSRC) $(RESSRC) $(ROOTETCSECURITY) $(ETCSECURITYFILES) \
135 $(ROOTXMLFILES)
137 install_dirs: $(AUDITDIRS) $(ARSYMLNK) $(ROOTXMLDIRS)
139 audit_uevents.h: mkhdr.sh audit_event.txt
140 sh mkhdr.sh
142 $(COMMONDIR)/adt_event.check: $(COMMONDIR)/adt_event.h
143 $(DOT_C_CHECK) $<
145 clean clobber: clean_files
147 clean_files:
148 -$(RM) $(CLEANFILES)
150 $(GENSRCS): $(ADTXMLFILE) $(AUDITXML)
151 $(PERL) $(AUDITXML) -o $(COMMONDIR) $(ADTXMLFILE)
153 $(ETCSECURITYFILES) $(RESA): \
154 $(ETCSECURITY) \
155 $(ROOTETCSECURITY)
157 $(RESAL): $(RESA)
159 $(ARSYMLNK): $(RESAL)
161 $(ROOTHDRDIR):
162 $(INS.dir)
164 $(ROOTHDRDIR)/%:%
165 $(INS.file)
167 $(ROOTHDRDIR)/%:$(COMMONDIR)/%
168 $(INS.file)
170 $(ROOTXMLDIRS):
171 $(INS.dir)
173 $(ROOTDTDDIR)/% $(ROOTXSLDIR)/%: %
174 $(INS.file)
176 $(AUDITDIRS):
177 $(INS.dir)
179 $(ARSYMLNK):
180 $(RM) $@
181 $(SYMLINK) ../../../../var/audit $@
183 $(ETCSECURITY)/%: %.txt
184 $(INS.rename)
186 $(ROOTETCSECURITY):
187 $(INS.dir)
189 $(ROOTETCSECURITY)/%: %.txt
190 $(INS.rename)
192 $(POFILE): pofile_MSGFILES
194 _msg: $(MSGDOMAINPOFILE)
196 # has strings but doesn't use gettext
197 adt_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
203 $(SUBDIRS): FRC
204 @cd $@; pwd; $(MAKE) $(TARGET)
206 FRC:
208 include ../Makefile.targ
209 include ../../Makefile.msg.targ