dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libbsm / Makefile
blob51663629fe5861cee0e9fdb1046c278b704aae47
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 package := TARGET= package
39 .KEEP_STATE:
41 COMMONDIR = common
44 # Macros for libbsm header files. These define user-level only interfaces.
46 GENHDRS = audit_uevents.h
47 HDRS = libbsm.h devices.h devalloc.h adt.h adt_event.h audit_private.h
48 GENSRCS = $(COMMONDIR)/adt_xlate.c $(COMMONDIR)/adt_event.h
49 COMMONHDRS = $(HDRS:%=$(COMMONDIR)/%)
50 ROOTHDRDIR = $(ROOT)/usr/include/bsm
51 ROOTCHDRS = $(HDRS:%=$(ROOTHDRDIR)/%)
52 ROOTHDRS = $(GENHDRS:%=$(ROOTHDRDIR)/%)
54 CHECKCHDRS = $(COMMONHDRS:%.h=%.check)
55 CHECKHDRS = $(GENHDRS:%.h=%.check)
57 $(ROOTHDRS) := FILEMODE = 0644
58 $(ROOTCHDRS) := FILEMODE = 0644
60 all install package: $(GENSRCS) $(SUBDIRS)
61 clean clobber delete: $(SUBDIRS)
64 # Macros for libbsm database files. These should probably be installed
65 # from somewhere else. Until we find that better place, install them
66 # from here.
69 ROOTETCSECURITY = $(ROOT)/etc/security
70 $(ROOTETCSECURITY) := DIRMODE = 0755
72 ESFILES = audit_class audit_event
73 ESSRC = $(ESFILES:%=%.txt)
74 ETCSECURITYFILES = $(ESFILES:%=$(ROOTETCSECURITY)/%)
75 $(ETCSECURITYFILES) := FILEMODE = 0644
78 # /etc/security/audit/localhost/files is a symbolic link to /var/audit.
79 # This is provided so that auditreduce will work in the default configuration.
81 RESA=$(ROOTETCSECURITY)/audit
82 RESAL=$(RESA)/localhost
83 VARAUDIT=$(ROOT)/var/audit
84 AUDITDIRS=$(RESA) $(RESAL) $(VARAUDIT)
85 $(AUDITDIRS) := FILEMODE = 0750
87 ARSYMLNK=$(RESAL)/files
90 # message catalogue file
92 MSGFILES = `$(GREP) -l gettext $(COMMONDIR)/*.c`
93 POFILE = libbsm.po
96 # Definitions for XML (DTD AND XSL)
98 DTD = adt_record.dtd.1
99 XSL = adt_record.xsl.1
100 ROOTXMLDIR = $(ROOT)/usr/share/lib/xml
101 ROOTDTDDIR= $(ROOTXMLDIR)/dtd
102 ROOTXSLDIR= $(ROOTXMLDIR)/style
103 ROOTDTD= $(DTD:%=$(ROOTDTDDIR)/%)
104 ROOTXSL= $(XSL:%=$(ROOTXSLDIR)/%)
105 ROOTXMLDIRS = $(ROOTXMLDIR) $(ROOTDTDDIR) $(ROOTXSLDIR)
106 ROOTXMLFILES = $(ROOTDTD) $(ROOTXSL)
108 $(ROOTXMLDIRS) := FILEMODE = 755
110 $(ROOTXMLFILES) := FILEMODE = 444
113 CPPFLAGS += -I$(COMMONDIR)
115 CLEANFILES += $(GENSRCS) $(GENHDRS)
117 ADTXMLFILE = $(COMMONDIR)/adt.xml
118 ADTXSDFILE = $(COMMONDIR)/adt.xsd
119 AUDITXML = auditxml
121 .KEEP_STATE:
123 install: install_dirs install_data
125 # $(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
127 install_h: $(ROOTHDRDIR) $(ROOTHDRS) $(ROOTCHDRS)
129 check: $(CHECKHDRS) $(CHECKCHDRS)
130 xmllint --schema $(ADTXSDFILE) --noout $(ADTXMLFILE)
132 install_data: $(ESSRC) $(RESSRC) $(ROOTETCSECURITY) $(ETCSECURITYFILES) \
133 $(ROOTXMLFILES)
135 install_dirs: $(AUDITDIRS) $(ARSYMLNK) $(ROOTXMLDIRS)
137 audit_uevents.h: mkhdr.sh audit_event.txt
138 sh mkhdr.sh
140 $(COMMONDIR)/adt_event.check: $(COMMONDIR)/adt_event.h
141 $(DOT_C_CHECK) $<
143 clean clobber: clean_files
145 clean_files:
146 -$(RM) $(CLEANFILES)
148 $(GENSRCS): $(ADTXMLFILE) $(AUDITXML)
149 $(PERL) $(AUDITXML) -o $(COMMONDIR) $(ADTXMLFILE)
151 $(ETCSECURITYFILES) $(RESA): \
152 $(ETCSECURITY) \
153 $(ROOTETCSECURITY)
155 $(RESAL): $(RESA)
157 $(ARSYMLNK): $(RESAL)
159 $(ROOTHDRDIR):
160 $(INS.dir)
162 $(ROOTHDRDIR)/%:%
163 $(INS.file)
165 $(ROOTHDRDIR)/%:$(COMMONDIR)/%
166 $(INS.file)
168 $(ROOTXMLDIRS):
169 $(INS.dir)
171 $(ROOTDTDDIR)/% $(ROOTXSLDIR)/%: %
172 $(INS.file)
174 $(AUDITDIRS):
175 $(INS.dir)
177 $(ARSYMLNK):
178 $(RM) $@
179 $(SYMLINK) ../../../../var/audit $@
181 $(ETCSECURITY)/%: %.txt
182 $(INS.rename)
184 $(ROOTETCSECURITY):
185 $(INS.dir)
187 $(ROOTETCSECURITY)/%: %.txt
188 $(INS.rename)
190 $(POFILE): pofile_MSGFILES
192 _msg: $(MSGDOMAINPOFILE)
194 # has strings but doesn't use gettext
195 adt_xlate.po: $(COMMONDIR)/adt_xlate.c
196 $(RM) adt_xlate.po
197 $(XGETTEXT) $(XGETFLAGS_ADT) $(COMMONDIR)/adt_xlate.c
198 $(SED) "/^domain/d" < messages.po > adt_xlate.po
199 $(RM) messages.po
201 $(SUBDIRS): FRC
202 @cd $@; pwd; $(MAKE) $(TARGET)
204 FRC:
206 include ../Makefile.targ
207 include ../../Makefile.msg.targ