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]
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
26 include ..
/Makefile.lib
29 $(BUILD64
)SUBDIRS
+= $(MACH64
)
34 clean := TARGET
= clean
35 clobber := TARGET
= clobber
36 delete
:= TARGET
= delete
37 install := TARGET
= install
39 package
:= TARGET
= package
46 # Macros for libbsm header files. These define user-level only interfaces.
48 GENHDRS
= audit_uevents.h
49 HDRS
= libbsm.h devices.h devalloc.h adt.h adt_event.h audit_private.h
50 GENSRCS
= $(COMMONDIR
)/adt_xlate.c
$(COMMONDIR
)/adt_event.h
51 COMMONHDRS
= $(HDRS
:%=$(COMMONDIR
)/%)
52 ROOTHDRDIR
= $(ROOT
)/usr
/include/bsm
53 ROOTCHDRS
= $(HDRS
:%=$(ROOTHDRDIR
)/%)
54 ROOTHDRS
= $(GENHDRS
:%=$(ROOTHDRDIR
)/%)
56 CHECKCHDRS
= $(COMMONHDRS
:%.h
=%.
check)
57 CHECKHDRS
= $(GENHDRS
:%.h
=%.
check)
59 $(ROOTHDRS
) := FILEMODE
= 0644
60 $(ROOTCHDRS
) := FILEMODE
= 0644
62 all install lint package
: $(GENSRCS
) $(SUBDIRS
)
63 clean clobber delete
: $(SUBDIRS
)
66 # Macros for libbsm database files. These should probably be installed
67 # from somewhere else. Until we find that better place, install them
71 ROOTETCSECURITY
= $(ROOT
)/etc
/security
72 $(ROOTETCSECURITY
) := DIRMODE
= 0755
73 $(ROOTETCSECURITY
) := OWNER
= root
74 $(ROOTETCSECURITY
) := GROUP
= sys
76 ESFILES
= audit_class audit_control audit_event audit_user
77 ESSRC
= $(ESFILES
:%=%.txt
)
78 ETCSECURITYFILES
= $(ESFILES
:%=$(ROOTETCSECURITY
)/%)
79 $(ETCSECURITYFILES
) := FILEMODE
= 0644
80 $(ETCSECURITYFILES
) := OWNER
= root
81 $(ETCSECURITYFILES
) := GROUP
= sys
83 EESFILES
= audit_startup
84 EESSRC
= $(EESFILES
:%=%.txt
)
85 EETCSECURITYFILES
= $(EESFILES
:%=$(ROOTETCSECURITY
)/%)
86 $(EETCSECURITYFILES
) := FILEMODE
= 0744
87 $(EETCSECURITYFILES
) := OWNER
= root
88 $(EETCSECURITYFILES
) := GROUP
= sys
91 # /etc/security/audit/localhost/files is a symbolic link to /var/audit.
92 # This is provided so that auditreduce will work in the default configuration.
94 RESA
=$(ROOTETCSECURITY
)/audit
95 RESAL
=$(RESA
)/localhost
96 VARAUDIT
=$(ROOT
)/var
/audit
97 AUDITDIRS
=$(RESA
) $(RESAL
) $(VARAUDIT
)
98 $(AUDITDIRS
) := FILEMODE
= 0750
99 $(AUDITDIRS
) := OWNER
= root
100 $(AUDITDIRS
) := GROUP
= sys
102 ARSYMLNK
=$(RESAL
)/files
105 # message catalogue file
107 MSGFILES
= `$(GREP) -l gettext $(COMMONDIR)/*.c`
111 # Definitions for XML (DTD AND XSL)
113 DTD
= adt_record.dtd
.1
114 XSL
= adt_record.xsl
.1
115 ROOTXMLDIR
= $(ROOT
)/usr
/share
/lib
/xml
116 ROOTDTDDIR
= $(ROOTXMLDIR
)/dtd
117 ROOTXSLDIR
= $(ROOTXMLDIR
)/style
118 ROOTDTD
= $(DTD
:%=$(ROOTDTDDIR
)/%)
119 ROOTXSL
= $(XSL
:%=$(ROOTXSLDIR
)/%)
120 ROOTXMLDIRS
= $(ROOTXMLDIR
) $(ROOTDTDDIR
) $(ROOTXSLDIR
)
121 ROOTXMLFILES
= $(ROOTDTD
) $(ROOTXSL
)
123 $(ROOTXMLDIRS
) := FILEMODE
= 755
124 $(ROOTXMLDIRS
) := OWNER
= root
125 $(ROOTXMLDIRS
) := GROUP
= sys
127 $(ROOTXMLFILES
) := FILEMODE
= 444
128 $(ROOTXMLFILES
) := OWNER
= root
129 $(ROOTXMLFILES
) := GROUP
= bin
132 CPPFLAGS
+= -I
$(COMMONDIR
)
133 CPPFLAGS
+= -D_REENTRANT
135 CLEANFILES
+= $(GENSRCS
) $(GENHDRS
)
137 ADTXMLFILE
= $(COMMONDIR
)/adt.xml
138 ADTXSDFILE
= $(COMMONDIR
)/adt.xsd
143 install: install_dirs
install_data
145 # $(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
147 install_h
: $(ROOTHDRDIR
) $(ROOTHDRS
) $(ROOTCHDRS
)
149 check: $(CHECKHDRS
) $(CHECKCHDRS
)
150 xmllint
--schema
$(ADTXSDFILE
) --noout
$(ADTXMLFILE
)
152 install_data: $(ESSRC
) $(RESSRC
) $(ROOTETCSECURITY
) $(ETCSECURITYFILES
) \
153 $(EETCSECURITYFILES
) $(ROOTXMLFILES
)
155 install_dirs
: $(AUDITDIRS
) $(ARSYMLNK
) $(ROOTXMLDIRS
)
157 audit_uevents.h
: mkhdr.sh audit_event.txt
160 $(COMMONDIR
)/adt_event.
check: $(COMMONDIR
)/adt_event.h
163 clean clobber: clean_files
168 $(GENSRCS
): $(ADTXMLFILE
) $(AUDITXML
)
169 $(PERL
) $(AUDITXML
) -o
$(COMMONDIR
) $(ADTXMLFILE
)
171 $(ETCSECURITYFILES
) $(EETCSECURITYFILES
) $(RESA
): \
177 $(ARSYMLNK
): $(RESAL
)
185 $(ROOTHDRDIR
)/%:$(COMMONDIR
)/%
191 $(ROOTDTDDIR
)/% $(ROOTXSLDIR
)/%: %
199 $(SYMLINK
) ..
/..
/..
/..
/var
/audit
$@
201 $(ETCSECURITY
)/%: %.txt
207 $(ROOTETCSECURITY
)/%: %.txt
210 $(POFILE
): pofile_MSGFILES
212 _msg
: $(MSGDOMAINPOFILE
)
214 # has strings but doesn't use gettext
215 adt_xlate.po
: $(COMMONDIR
)/adt_xlate.c
217 $(XGETTEXT
) $(XGETFLAGS_ADT
) $(COMMONDIR
)/adt_xlate.c
218 $(SED
) "/^domain/d" < messages.po
> adt_xlate.po
222 @cd
$@
; pwd
; $(MAKE
) $(TARGET
)
226 include ..
/Makefile.targ
227 include ..
/..
/Makefile.msg.targ