xref: /illumos-gate/usr/src/lib/libbsm/Makefile (revision 2d84dfe88bfb9c12d1b4d2216c32b5a8b1fb56ae)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*2d84dfe8Sgww# Common Development and Distribution License (the "License").
6*2d84dfe8Sgww# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22*2d84dfe8Sgww# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate# lib/libbsm/Makefile
287c478bd9Sstevel@tonic-gate#
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateinclude ../../Makefile.master
317c478bd9Sstevel@tonic-gateinclude ../Makefile.lib
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gateSUBDIRS=	spec .WAIT $(MACH) $(BUILD64) $(MACH64)
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gateXGETFLAGS_ADT += -a
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gateall :=		TARGET= all
387c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
397c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
407c478bd9Sstevel@tonic-gatedelete :=	TARGET= delete
417c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
427c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
437c478bd9Sstevel@tonic-gatepackage :=	TARGET= package
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gate.KEEP_STATE:
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateall clean clobber delete install lint package: $(SUBDIRS)
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gateOBJECTS=	adr.o \
507c478bd9Sstevel@tonic-gate		adrf.o \
517c478bd9Sstevel@tonic-gate		adrm.o \
527c478bd9Sstevel@tonic-gate		adt.o \
537c478bd9Sstevel@tonic-gate		adt_token.o \
547c478bd9Sstevel@tonic-gate		adt_xlate.o \
557c478bd9Sstevel@tonic-gate		au_open.o \
567c478bd9Sstevel@tonic-gate		au_preselect.o \
577c478bd9Sstevel@tonic-gate		au_to.o \
587c478bd9Sstevel@tonic-gate		au_usermask.o \
597c478bd9Sstevel@tonic-gate		audit_allocate.o \
607c478bd9Sstevel@tonic-gate		audit_class.o \
617c478bd9Sstevel@tonic-gate		audit_cron.o \
627c478bd9Sstevel@tonic-gate		audit_crontab.o \
637c478bd9Sstevel@tonic-gate		audit_at.o \
647c478bd9Sstevel@tonic-gate		audit_event.o \
657c478bd9Sstevel@tonic-gate		audit_ftpd.o \
667c478bd9Sstevel@tonic-gate		audit_halt.o \
677c478bd9Sstevel@tonic-gate		audit_inetd.o \
687c478bd9Sstevel@tonic-gate		audit_kadmind.o \
697c478bd9Sstevel@tonic-gate		audit_krb5kdc.o \
707c478bd9Sstevel@tonic-gate		audit_mountd.o \
717c478bd9Sstevel@tonic-gate		audit_newgrp.o \
727c478bd9Sstevel@tonic-gate		audit_plugin.o \
737c478bd9Sstevel@tonic-gate		audit_reboot.o \
747c478bd9Sstevel@tonic-gate		audit_rexd.o \
757c478bd9Sstevel@tonic-gate		audit_rexecd.o \
767c478bd9Sstevel@tonic-gate		audit_rshd.o \
777c478bd9Sstevel@tonic-gate		audit_settid.o \
787c478bd9Sstevel@tonic-gate		audit_shutdown.o \
797c478bd9Sstevel@tonic-gate		audit_uadmin.o \
807c478bd9Sstevel@tonic-gate		audit_user.o \
817c478bd9Sstevel@tonic-gate		bsm.o \
827c478bd9Sstevel@tonic-gate		generic.o \
837c478bd9Sstevel@tonic-gate		getacinfo.o \
847c478bd9Sstevel@tonic-gate		getacval.o \
857c478bd9Sstevel@tonic-gate		getauditflags.o \
867c478bd9Sstevel@tonic-gate		getdaent.o \
877c478bd9Sstevel@tonic-gate		getdment.o \
887c478bd9Sstevel@tonic-gate		getfaudflgs.o
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gateCOMMONDIR = common
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gate#
937c478bd9Sstevel@tonic-gate# Macros for libbsm header files. These define user-level only interfaces.
947c478bd9Sstevel@tonic-gate#
957c478bd9Sstevel@tonic-gateGENHDRS = audit_uevents.h
967c478bd9Sstevel@tonic-gateHDRS = libbsm.h devices.h adt.h adt_event.h audit_private.h
977c478bd9Sstevel@tonic-gateCOMMONHDRS =	$(HDRS:%=$(COMMONDIR)/%)
987c478bd9Sstevel@tonic-gateROOTHDRDIR = 	$(ROOT)/usr/include/bsm
997c478bd9Sstevel@tonic-gateROOTCHDRS = 	$(HDRS:%=$(ROOTHDRDIR)/%)
1007c478bd9Sstevel@tonic-gateROOTHDRS = 	$(GENHDRS:%=$(ROOTHDRDIR)/%)
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gateCHECKCHDRS =	$(COMMONHDRS:%.h=%.check)
1037c478bd9Sstevel@tonic-gateCHECKHDRS =	$(GENHDRS:%.h=%.check)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gate$(ROOTHDRS) := 	FILEMODE = 0644
1067c478bd9Sstevel@tonic-gate$(ROOTCHDRS) :=	FILEMODE = 0644
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gate#
1097c478bd9Sstevel@tonic-gate# Macros for libbsm database files. These should probably be installed
1107c478bd9Sstevel@tonic-gate# from somewhere else. Until we find that better place, install them
1117c478bd9Sstevel@tonic-gate# from here.
1127c478bd9Sstevel@tonic-gate#
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gateROOTETCSECURITY = 	$(ROOT)/etc/security
1157c478bd9Sstevel@tonic-gate$(ROOTETCSECURITY) := 	DIRMODE = 0755
1167c478bd9Sstevel@tonic-gate$(ROOTETCSECURITY) := 	OWNER = root
1177c478bd9Sstevel@tonic-gate$(ROOTETCSECURITY) := 	GROUP = sys
1187c478bd9Sstevel@tonic-gate
1197c478bd9Sstevel@tonic-gateESFILES =		audit_class audit_event
1207c478bd9Sstevel@tonic-gateESSRC =			$(ESFILES:%=%.txt)
1217c478bd9Sstevel@tonic-gateETCSECURITYFILES =	$(ESFILES:%=$(ROOTETCSECURITY)/%)
1227c478bd9Sstevel@tonic-gate$(ETCSECURITYFILES) :=	FILEMODE = 0644
1237c478bd9Sstevel@tonic-gate$(ETCSECURITYFILES) :=	OWNER = root
1247c478bd9Sstevel@tonic-gate$(ETCSECURITYFILES) :=	GROUP = sys
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gateEESFILES =		audit_startup
1277c478bd9Sstevel@tonic-gateEESSRC =		$(EESFILES:%=%.txt)
1287c478bd9Sstevel@tonic-gateEETCSECURITYFILES =	$(EESFILES:%=$(ROOTETCSECURITY)/%)
1297c478bd9Sstevel@tonic-gate$(EETCSECURITYFILES) :=	FILEMODE = 0744
1307c478bd9Sstevel@tonic-gate$(EETCSECURITYFILES) :=	OWNER = root
1317c478bd9Sstevel@tonic-gate$(EETCSECURITYFILES) :=	GROUP = sys
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gateRESFILES = 		audit_control audit_user
1347c478bd9Sstevel@tonic-gateRESSRC =		$(RESFILES:%=%.txt)
1357c478bd9Sstevel@tonic-gateROOTETCSECURITYFILES =	$(RESFILES:%=$(ROOTETCSECURITY)/%)
1367c478bd9Sstevel@tonic-gate$(ROOTETCSECURITYFILES) := FILEMODE = 0640
1377c478bd9Sstevel@tonic-gate$(ROOTETCSECURITYFILES) := OWNER = root
1387c478bd9Sstevel@tonic-gate$(ROOTETCSECURITYFILES) := GROUP = sys
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gate#
1417c478bd9Sstevel@tonic-gate# /etc/security/audit/localhost/files is a symbolic link to /var/audit.
1427c478bd9Sstevel@tonic-gate# This is provided so that auditreduce will work in the default configuration.
1437c478bd9Sstevel@tonic-gate#
1447c478bd9Sstevel@tonic-gateRESA=$(ROOTETCSECURITY)/audit
1457c478bd9Sstevel@tonic-gateRESAL=$(RESA)/localhost
1467c478bd9Sstevel@tonic-gateVARAUDIT=$(ROOT)/var/audit
1477c478bd9Sstevel@tonic-gateAUDITDIRS=$(RESA) $(RESAL) $(VARAUDIT)
1487c478bd9Sstevel@tonic-gate$(AUDITDIRS) := FILEMODE = 0750
1497c478bd9Sstevel@tonic-gate$(AUDITDIRS) := OWNER = root
1507c478bd9Sstevel@tonic-gate$(AUDITDIRS) := GROUP = sys
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gateARSYMLNK=$(RESAL)/files
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gate#
1557c478bd9Sstevel@tonic-gate# message catalogue file
1567c478bd9Sstevel@tonic-gate#
1577c478bd9Sstevel@tonic-gateTEXT_DOMAIN= SUNW_OST_OSLIB
1587c478bd9Sstevel@tonic-gatePOFILE= libbsm.po
1597c478bd9Sstevel@tonic-gateCATALOG=libbsm.po
1607c478bd9Sstevel@tonic-gatePOFILES= $(OBJECTS:%.o=%.po)
1617c478bd9Sstevel@tonic-gate
1627c478bd9Sstevel@tonic-gate#
1637c478bd9Sstevel@tonic-gate# Definitions for XML (DTD AND XSL)
1647c478bd9Sstevel@tonic-gate#
1657c478bd9Sstevel@tonic-gateDTD =		adt_record.dtd.1
1667c478bd9Sstevel@tonic-gateXSL =		adt_record.xsl.1
1677c478bd9Sstevel@tonic-gateROOTXMLDIR =	$(ROOT)/usr/share/lib/xml
1687c478bd9Sstevel@tonic-gateROOTDTDDIR=	$(ROOTXMLDIR)/dtd
1697c478bd9Sstevel@tonic-gateROOTXSLDIR=	$(ROOTXMLDIR)/style
1707c478bd9Sstevel@tonic-gateROOTDTD=	$(DTD:%=$(ROOTDTDDIR)/%)
1717c478bd9Sstevel@tonic-gateROOTXSL=	$(XSL:%=$(ROOTXSLDIR)/%)
1727c478bd9Sstevel@tonic-gateROOTXMLDIRS =	$(ROOTXMLDIR) $(ROOTDTDDIR) $(ROOTXSLDIR)
1737c478bd9Sstevel@tonic-gateROOTXMLFILES =	$(ROOTDTD) $(ROOTXSL)
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gate$(ROOTXMLDIRS) :=  FILEMODE = 755
1767c478bd9Sstevel@tonic-gate$(ROOTXMLDIRS) :=  OWNER = root
1777c478bd9Sstevel@tonic-gate$(ROOTXMLDIRS) :=  GROUP = sys
1787c478bd9Sstevel@tonic-gate
1797c478bd9Sstevel@tonic-gate$(ROOTXMLFILES) :=  FILEMODE = 444
1807c478bd9Sstevel@tonic-gate$(ROOTXMLFILES) :=  OWNER = root
1817c478bd9Sstevel@tonic-gate$(ROOTXMLFILES) :=  GROUP = bin
1827c478bd9Sstevel@tonic-gate
1837c478bd9Sstevel@tonic-gate
1847c478bd9Sstevel@tonic-gateCPPFLAGS += -I$(COMMONDIR)
1857c478bd9Sstevel@tonic-gateCPPFLAGS += -D_REENTRANT
1867c478bd9Sstevel@tonic-gate
1877c478bd9Sstevel@tonic-gate.KEEP_STATE:
1887c478bd9Sstevel@tonic-gate
1897c478bd9Sstevel@tonic-gateinstall: install_dirs install_data
1907c478bd9Sstevel@tonic-gate
1917c478bd9Sstevel@tonic-gate#		$(ROOTUSRLIB) $(ROOTLIBS) $(ROOTLINKS)
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gateinstall_h: $(ROOTHDRDIR) $(ROOTHDRS) $(ROOTCHDRS)
1947c478bd9Sstevel@tonic-gate
1957c478bd9Sstevel@tonic-gatecheck:	$(CHECKHDRS) $(CHECKCHDRS)
1967c478bd9Sstevel@tonic-gate
1977c478bd9Sstevel@tonic-gateinstall_data: $(ESSRC) $(RESSRC) $(ROOTETCSECURITY) $(ETCSECURITYFILES) \
1987c478bd9Sstevel@tonic-gate	$(EETCSECURITYFILES) $(ROOTETCSECURITYFILES) $(ROOTXMLFILES)
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gateinstall_dirs: $(AUDITDIRS) $(ARSYMLNK) $(ROOTXMLDIRS)
2017c478bd9Sstevel@tonic-gate
2027c478bd9Sstevel@tonic-gateaudit_uevents.h: mkhdr.sh audit_event.txt
2037c478bd9Sstevel@tonic-gate	sh mkhdr.sh
2047c478bd9Sstevel@tonic-gate
2057c478bd9Sstevel@tonic-gate$(ETCSECURITYFILES) $(EETCSECURITYFILES) $(ROOTETCSECURITYFILES) $(RESA): \
2067c478bd9Sstevel@tonic-gate	$(ETCSECURITY) \
2077c478bd9Sstevel@tonic-gate	$(ROOTETCSECURITY)
2087c478bd9Sstevel@tonic-gate
2097c478bd9Sstevel@tonic-gate$(RESAL): $(RESA)
2107c478bd9Sstevel@tonic-gate
2117c478bd9Sstevel@tonic-gate$(ARSYMLNK): $(RESAL)
2127c478bd9Sstevel@tonic-gate
2137c478bd9Sstevel@tonic-gate$(ROOTHDRDIR):
2147c478bd9Sstevel@tonic-gate	$(INS.dir)
2157c478bd9Sstevel@tonic-gate
2167c478bd9Sstevel@tonic-gate$(ROOTHDRDIR)/%:%
2177c478bd9Sstevel@tonic-gate	$(INS.file)
2187c478bd9Sstevel@tonic-gate
2197c478bd9Sstevel@tonic-gate$(ROOTHDRDIR)/%:$(COMMONDIR)/%
2207c478bd9Sstevel@tonic-gate	$(INS.file)
2217c478bd9Sstevel@tonic-gate
2227c478bd9Sstevel@tonic-gate$(ROOTXMLDIRS):
2237c478bd9Sstevel@tonic-gate	$(INS.dir)
2247c478bd9Sstevel@tonic-gate
2257c478bd9Sstevel@tonic-gate$(ROOTDTDDIR)/% $(ROOTXSLDIR)/%: %
2267c478bd9Sstevel@tonic-gate	$(INS.file)
2277c478bd9Sstevel@tonic-gate
2287c478bd9Sstevel@tonic-gate$(AUDITDIRS):
2297c478bd9Sstevel@tonic-gate	$(INS.dir)
2307c478bd9Sstevel@tonic-gate
2317c478bd9Sstevel@tonic-gate$(ARSYMLNK):
2327c478bd9Sstevel@tonic-gate	$(RM) $@
2337c478bd9Sstevel@tonic-gate	$(SYMLINK) ../../../../var/audit $@
2347c478bd9Sstevel@tonic-gate
2357c478bd9Sstevel@tonic-gate$(ETCSECURITY)/%: %.txt
2367c478bd9Sstevel@tonic-gate	$(INS.rename)
2377c478bd9Sstevel@tonic-gate
2387c478bd9Sstevel@tonic-gate$(ROOTETCSECURITY):
2397c478bd9Sstevel@tonic-gate	$(INS.dir)
2407c478bd9Sstevel@tonic-gate
2417c478bd9Sstevel@tonic-gate$(ROOTETCSECURITY)/%: %.txt
2427c478bd9Sstevel@tonic-gate	$(INS.rename)
2437c478bd9Sstevel@tonic-gate
2447c478bd9Sstevel@tonic-gate%.po: $(COMMONDIR)/%.c
2457c478bd9Sstevel@tonic-gate	$(COMPILE.cpp) $<  > $<.i
2467c478bd9Sstevel@tonic-gate	$(BUILD.po)
2477c478bd9Sstevel@tonic-gate
2487c478bd9Sstevel@tonic-gate_msg: $(MSGDOMAIN) $(POFILE)
2497c478bd9Sstevel@tonic-gate	$(RM) $(MSGDOMAIN)/$(CATALOG)
2507c478bd9Sstevel@tonic-gate	$(CP) $(POFILE) $(MSGDOMAIN)
2517c478bd9Sstevel@tonic-gate
2527c478bd9Sstevel@tonic-gatecatalog: _msg
2537c478bd9Sstevel@tonic-gate
2547c478bd9Sstevel@tonic-gatepo_clean:
2557c478bd9Sstevel@tonic-gate	$(RM) $(POFILES) $(POFILE)
2567c478bd9Sstevel@tonic-gate
2577c478bd9Sstevel@tonic-gateclobber: po_clean
2587c478bd9Sstevel@tonic-gate
2597c478bd9Sstevel@tonic-gate$(POFILE): .WAIT $(POFILES)
2607c478bd9Sstevel@tonic-gate	$(RM) $@
2617c478bd9Sstevel@tonic-gate	$(CAT) $(POFILES) > $@
2627c478bd9Sstevel@tonic-gate
2637c478bd9Sstevel@tonic-gate# has strings but doesn't use gettext
2647c478bd9Sstevel@tonic-gateadt_xlate.po: $(COMMONDIR)/adt_xlate.c
2657c478bd9Sstevel@tonic-gate	$(RM) adt_xlate.po
2667c478bd9Sstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS_ADT) $(COMMONDIR)/adt_xlate.c
2677c478bd9Sstevel@tonic-gate	$(SED) "/^domain/d" < messages.po > adt_xlate.po
2687c478bd9Sstevel@tonic-gate	$(RM) messages.po
2697c478bd9Sstevel@tonic-gate
2707c478bd9Sstevel@tonic-gate$(MSGDOMAIN):
2717c478bd9Sstevel@tonic-gate	$(INS.dir)
2727c478bd9Sstevel@tonic-gate
2737c478bd9Sstevel@tonic-gate
2747c478bd9Sstevel@tonic-gatespec $(MACH) $(MACH64) :	FRC
2757c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
2767c478bd9Sstevel@tonic-gate
2777c478bd9Sstevel@tonic-gateFRC:
278