xref: /onnv-gate/usr/src/lib/libbsm/Makefile (revision 12918:32a41a5f8110)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
51453Sgww# Common Development and Distribution License (the "License").
61453Sgww# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
210Sstevel@tonic-gate#
2212788Sgary.winiger@oracle.com# Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate#
240Sstevel@tonic-gate
250Sstevel@tonic-gateinclude ../Makefile.lib
260Sstevel@tonic-gate
272522SrafSUBDIRS =	$(MACH)
282522Sraf$(BUILD64)SUBDIRS += $(MACH64)
290Sstevel@tonic-gate
300Sstevel@tonic-gateXGETFLAGS_ADT += -a
310Sstevel@tonic-gate
320Sstevel@tonic-gateall :=		TARGET= all
330Sstevel@tonic-gateclean :=	TARGET= clean
340Sstevel@tonic-gateclobber :=	TARGET= clobber
350Sstevel@tonic-gatedelete :=	TARGET= delete
360Sstevel@tonic-gateinstall :=	TARGET= install
370Sstevel@tonic-gatelint :=		TARGET= lint
380Sstevel@tonic-gatepackage :=	TARGET= package
390Sstevel@tonic-gate
400Sstevel@tonic-gate.KEEP_STATE:
410Sstevel@tonic-gate
420Sstevel@tonic-gateCOMMONDIR = common
430Sstevel@tonic-gate
440Sstevel@tonic-gate#
450Sstevel@tonic-gate# Macros for libbsm header files. These define user-level only interfaces.
460Sstevel@tonic-gate#
470Sstevel@tonic-gateGENHDRS = audit_uevents.h
48*12918SJan.Friedel@Sun.COMHDRS = libbsm.h devices.h devalloc.h adt.h adt_event.h audit_private.h
494176Stz204579GENSRCS =	$(COMMONDIR)/adt_xlate.c $(COMMONDIR)/adt_event.h
500Sstevel@tonic-gateCOMMONHDRS =	$(HDRS:%=$(COMMONDIR)/%)
510Sstevel@tonic-gateROOTHDRDIR = 	$(ROOT)/usr/include/bsm
520Sstevel@tonic-gateROOTCHDRS = 	$(HDRS:%=$(ROOTHDRDIR)/%)
530Sstevel@tonic-gateROOTHDRS = 	$(GENHDRS:%=$(ROOTHDRDIR)/%)
540Sstevel@tonic-gate
550Sstevel@tonic-gateCHECKCHDRS =	$(COMMONHDRS:%.h=%.check)
560Sstevel@tonic-gateCHECKHDRS =	$(GENHDRS:%.h=%.check)
570Sstevel@tonic-gate
580Sstevel@tonic-gate$(ROOTHDRS) := 	FILEMODE = 0644
590Sstevel@tonic-gate$(ROOTCHDRS) :=	FILEMODE = 0644
600Sstevel@tonic-gate
6111506SJames.McPherson@Sun.COMall install lint package: $(GENSRCS) $(SUBDIRS)
624176Stz204579clean clobber delete: $(SUBDIRS)
634176Stz204579
640Sstevel@tonic-gate#
650Sstevel@tonic-gate# Macros for libbsm database files. These should probably be installed
660Sstevel@tonic-gate# from somewhere else. Until we find that better place, install them
670Sstevel@tonic-gate# from here.
680Sstevel@tonic-gate#
690Sstevel@tonic-gate
700Sstevel@tonic-gateROOTETCSECURITY = 	$(ROOT)/etc/security
710Sstevel@tonic-gate$(ROOTETCSECURITY) := 	DIRMODE = 0755
720Sstevel@tonic-gate
73*12918SJan.Friedel@Sun.COMESFILES =		audit_class audit_event
740Sstevel@tonic-gateESSRC =			$(ESFILES:%=%.txt)
750Sstevel@tonic-gateETCSECURITYFILES =	$(ESFILES:%=$(ROOTETCSECURITY)/%)
760Sstevel@tonic-gate$(ETCSECURITYFILES) :=	FILEMODE = 0644
770Sstevel@tonic-gate
780Sstevel@tonic-gate#
790Sstevel@tonic-gate# /etc/security/audit/localhost/files is a symbolic link to /var/audit.
800Sstevel@tonic-gate# This is provided so that auditreduce will work in the default configuration.
810Sstevel@tonic-gate#
820Sstevel@tonic-gateRESA=$(ROOTETCSECURITY)/audit
830Sstevel@tonic-gateRESAL=$(RESA)/localhost
840Sstevel@tonic-gateVARAUDIT=$(ROOT)/var/audit
850Sstevel@tonic-gateAUDITDIRS=$(RESA) $(RESAL) $(VARAUDIT)
860Sstevel@tonic-gate$(AUDITDIRS) := FILEMODE = 0750
870Sstevel@tonic-gate
880Sstevel@tonic-gateARSYMLNK=$(RESAL)/files
890Sstevel@tonic-gate
900Sstevel@tonic-gate#
910Sstevel@tonic-gate# message catalogue file
920Sstevel@tonic-gate#
931676SjpkMSGFILES =	`$(GREP) -l gettext $(COMMONDIR)/*.c`
941676SjpkPOFILE =	libbsm.po
950Sstevel@tonic-gate
960Sstevel@tonic-gate#
970Sstevel@tonic-gate# Definitions for XML (DTD AND XSL)
980Sstevel@tonic-gate#
990Sstevel@tonic-gateDTD =		adt_record.dtd.1
1000Sstevel@tonic-gateXSL =		adt_record.xsl.1
1010Sstevel@tonic-gateROOTXMLDIR =	$(ROOT)/usr/share/lib/xml
1020Sstevel@tonic-gateROOTDTDDIR=	$(ROOTXMLDIR)/dtd
1030Sstevel@tonic-gateROOTXSLDIR=	$(ROOTXMLDIR)/style
1040Sstevel@tonic-gateROOTDTD=	$(DTD:%=$(ROOTDTDDIR)/%)
1050Sstevel@tonic-gateROOTXSL=	$(XSL:%=$(ROOTXSLDIR)/%)
1060Sstevel@tonic-gateROOTXMLDIRS =	$(ROOTXMLDIR) $(ROOTDTDDIR) $(ROOTXSLDIR)
1070Sstevel@tonic-gateROOTXMLFILES =	$(ROOTDTD) $(ROOTXSL)
1080Sstevel@tonic-gate
1090Sstevel@tonic-gate$(ROOTXMLDIRS) :=  FILEMODE = 755
1100Sstevel@tonic-gate
1110Sstevel@tonic-gate$(ROOTXMLFILES) :=  FILEMODE = 444
1120Sstevel@tonic-gate
1130Sstevel@tonic-gate
1140Sstevel@tonic-gateCPPFLAGS += -I$(COMMONDIR)
1150Sstevel@tonic-gateCPPFLAGS += -D_REENTRANT
1160Sstevel@tonic-gate
1174176Stz204579CLEANFILES += $(GENSRCS) $(GENHDRS)
1184176Stz204579
1194176Stz204579ADTXMLFILE =	$(COMMONDIR)/adt.xml
1204176Stz204579ADTXSDFILE =	$(COMMONDIR)/adt.xsd
1214176Stz204579AUDITXML =	auditxml
1224176Stz204579
1230Sstevel@tonic-gate.KEEP_STATE:
1240Sstevel@tonic-gate
1250Sstevel@tonic-gateinstall: install_dirs install_data
1260Sstevel@tonic-gate
1270Sstevel@tonic-gate#		$(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
1280Sstevel@tonic-gate
1290Sstevel@tonic-gateinstall_h: $(ROOTHDRDIR) $(ROOTHDRS) $(ROOTCHDRS)
1300Sstevel@tonic-gate
1310Sstevel@tonic-gatecheck:	$(CHECKHDRS) $(CHECKCHDRS)
1324176Stz204579	xmllint --schema $(ADTXSDFILE) --noout $(ADTXMLFILE)
1330Sstevel@tonic-gate
1340Sstevel@tonic-gateinstall_data: $(ESSRC) $(RESSRC) $(ROOTETCSECURITY) $(ETCSECURITYFILES) \
13511129SJan.Friedel@Sun.COM	$(ROOTXMLFILES)
1360Sstevel@tonic-gate
1370Sstevel@tonic-gateinstall_dirs: $(AUDITDIRS) $(ARSYMLNK) $(ROOTXMLDIRS)
1380Sstevel@tonic-gate
1390Sstevel@tonic-gateaudit_uevents.h: mkhdr.sh audit_event.txt
1400Sstevel@tonic-gate	sh mkhdr.sh
1410Sstevel@tonic-gate
1424176Stz204579$(COMMONDIR)/adt_event.check:	$(COMMONDIR)/adt_event.h
1434176Stz204579	$(DOT_C_CHECK) $<
1444176Stz204579
1454176Stz204579clean clobber: clean_files
1464176Stz204579
1474176Stz204579clean_files:
1484176Stz204579	-$(RM) $(CLEANFILES)
1494176Stz204579
1504176Stz204579$(GENSRCS): $(ADTXMLFILE) $(AUDITXML)
1517496Sgww@eng.sun.com	$(PERL) $(AUDITXML) -o $(COMMONDIR) $(ADTXMLFILE)
1524176Stz204579
15311129SJan.Friedel@Sun.COM$(ETCSECURITYFILES) $(RESA): \
1540Sstevel@tonic-gate	$(ETCSECURITY) \
1550Sstevel@tonic-gate	$(ROOTETCSECURITY)
1560Sstevel@tonic-gate
1570Sstevel@tonic-gate$(RESAL): $(RESA)
1580Sstevel@tonic-gate
1590Sstevel@tonic-gate$(ARSYMLNK): $(RESAL)
1600Sstevel@tonic-gate
1610Sstevel@tonic-gate$(ROOTHDRDIR):
1620Sstevel@tonic-gate	$(INS.dir)
1630Sstevel@tonic-gate
1640Sstevel@tonic-gate$(ROOTHDRDIR)/%:%
1650Sstevel@tonic-gate	$(INS.file)
1660Sstevel@tonic-gate
1670Sstevel@tonic-gate$(ROOTHDRDIR)/%:$(COMMONDIR)/%
1680Sstevel@tonic-gate	$(INS.file)
1690Sstevel@tonic-gate
1700Sstevel@tonic-gate$(ROOTXMLDIRS):
1710Sstevel@tonic-gate	$(INS.dir)
1720Sstevel@tonic-gate
1730Sstevel@tonic-gate$(ROOTDTDDIR)/% $(ROOTXSLDIR)/%: %
1740Sstevel@tonic-gate	$(INS.file)
1750Sstevel@tonic-gate
1760Sstevel@tonic-gate$(AUDITDIRS):
1770Sstevel@tonic-gate	$(INS.dir)
1780Sstevel@tonic-gate
1790Sstevel@tonic-gate$(ARSYMLNK):
1800Sstevel@tonic-gate	$(RM) $@
1810Sstevel@tonic-gate	$(SYMLINK) ../../../../var/audit $@
1820Sstevel@tonic-gate
1830Sstevel@tonic-gate$(ETCSECURITY)/%: %.txt
1840Sstevel@tonic-gate	$(INS.rename)
1850Sstevel@tonic-gate
1860Sstevel@tonic-gate$(ROOTETCSECURITY):
1870Sstevel@tonic-gate	$(INS.dir)
1880Sstevel@tonic-gate
1890Sstevel@tonic-gate$(ROOTETCSECURITY)/%: %.txt
1900Sstevel@tonic-gate	$(INS.rename)
1910Sstevel@tonic-gate
1921676Sjpk$(POFILE):	 pofile_MSGFILES
1930Sstevel@tonic-gate
1941676Sjpk_msg:	$(MSGDOMAINPOFILE)
1950Sstevel@tonic-gate
1960Sstevel@tonic-gate# has strings but doesn't use gettext
1970Sstevel@tonic-gateadt_xlate.po: $(COMMONDIR)/adt_xlate.c
1980Sstevel@tonic-gate	$(RM) adt_xlate.po
1990Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS_ADT) $(COMMONDIR)/adt_xlate.c
2000Sstevel@tonic-gate	$(SED) "/^domain/d" < messages.po > adt_xlate.po
2010Sstevel@tonic-gate	$(RM) messages.po
2020Sstevel@tonic-gate
2032522Sraf$(SUBDIRS):	FRC
2040Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
2050Sstevel@tonic-gate
2060Sstevel@tonic-gateFRC:
2071676Sjpk
2081676Sjpkinclude ../Makefile.targ
2091676Sjpkinclude ../../Makefile.msg.targ
210