From 1eea4119ffbe77304e95eb3044905255ff920d33 Mon Sep 17 00:00:00 2001 From: Jan Friedel Date: Fri, 19 Feb 2010 16:37:39 +0100 Subject: 6910977 _msg target in $SRC/cmd//Makefile should comply with the recommended pattern --- usr/src/cmd/Makefile.cmd.bsm | 50 ---------------------------------------- usr/src/cmd/audit/Makefile | 21 +++++++++-------- usr/src/cmd/audit_warn/Makefile | 9 +++----- usr/src/cmd/auditconfig/Makefile | 24 +++++++------------ usr/src/cmd/auditd/Makefile | 15 +++--------- usr/src/cmd/auditrecord/Makefile | 10 ++++---- usr/src/cmd/auditreduce/Makefile | 29 ++++++++++++----------- usr/src/cmd/auditstat/Makefile | 20 ++++++++++++---- usr/src/cmd/praudit/Makefile | 22 +++++++++--------- 9 files changed, 72 insertions(+), 128 deletions(-) delete mode 100644 usr/src/cmd/Makefile.cmd.bsm diff --git a/usr/src/cmd/Makefile.cmd.bsm b/usr/src/cmd/Makefile.cmd.bsm deleted file mode 100644 index 191dbdc42d..0000000000 --- a/usr/src/cmd/Makefile.cmd.bsm +++ /dev/null @@ -1,50 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# Definitions common to BSM command source -# -# Before including this file you must set the PROG variable -# and include Makefile.cmd -# - - -all: - -install: all $(ROOTUSRSBINPROG) - -# Rules for internationalization - -PO= $(TEXT_DOMAIN).po - -po: $(PO) - -$(PO): $(POS) - $(CAT) $(POS) > $@ - -%.po: %.c - $(XGETTEXT) -c TRANSLATION_NOTE -d $(TEXT_DOMAIN) $< - $(MV) $(TEXT_DOMAIN).po $@ diff --git a/usr/src/cmd/audit/Makefile b/usr/src/cmd/audit/Makefile index 1375d3664c..0a087ab027 100644 --- a/usr/src/cmd/audit/Makefile +++ b/usr/src/cmd/audit/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -19,15 +18,14 @@ # # CDDL HEADER END # -# ident "%Z%%M% %I% %E% SMI" # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # PROG = audit -include ../Makefile.cmd +include $(SRC)/cmd/Makefile.cmd TEXT_DOMAIN=SUNW_OST_OSCMD POFILE=$(PROG).po @@ -38,6 +36,7 @@ AUDITD = ../auditd OBJS = audit.o SRCS = $(OBJS:.o=.c) +MSGFILES = $(SRCS) CPPFLAGS += -I$(AUDITD) @@ -47,13 +46,17 @@ all: $(PROG) install: all $(ROOTUSRSBINPROG) -_msg: $(POFILE) +$(POFILE): $(MSGFILES) + $(BUILDPO.msgfiles) + +_msg: $(MSGDOMAINPOFILE) catalog: $(POFILE) clean: - rm -f $(OBJS) $(POFILE) $(PROG) + $(RM) $(OBJS) lint: lint_PROG -include ../Makefile.targ +include $(SRC)/cmd/Makefile.targ +include $(SRC)/Makefile.msg.targ diff --git a/usr/src/cmd/audit_warn/Makefile b/usr/src/cmd/audit_warn/Makefile index 9106759763..0abc58b471 100644 --- a/usr/src/cmd/audit_warn/Makefile +++ b/usr/src/cmd/audit_warn/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # cmd/audit_warn/Makefile @@ -28,7 +28,7 @@ PROG = audit_warn SRCS = audit_warn.sh -include ../Makefile.cmd +include $(SRC)/cmd/Makefile.cmd ETCSECURITYFILES = audit_warn ROOTETCSECURITY = $(ROOT)/etc/security @@ -49,10 +49,7 @@ $(ROOTETCSECURITY)/%:% $(INS.file) clean: - $(RM) -f $(PROG) - -clobber: clean lint: -include ../Makefile.targ +include $(SRC)/cmd/Makefile.targ diff --git a/usr/src/cmd/auditconfig/Makefile b/usr/src/cmd/auditconfig/Makefile index e4fbddf1d8..bf9a78847a 100644 --- a/usr/src/cmd/auditconfig/Makefile +++ b/usr/src/cmd/auditconfig/Makefile @@ -18,7 +18,7 @@ # # CDDL HEADER END # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # @@ -28,9 +28,6 @@ PROG = auditconfig include $(SRC)/cmd/Makefile.cmd -POFILE = auditconfig.po -MSGFILES = $(SRCS) - LIBBSM = $(SRC)/lib/libbsm/common AUDITCONFIG = $(SRC)/cmd/auditconfig AUDITD = $(SRC)/cmd/auditd @@ -40,22 +37,25 @@ LDLIBS += -lnsl -lbsm -lscf OBJS = audit_scf.o audit_scf_shared.o auditconfig.o SRCS = $(OBJS:%.o=%.c) +POFILE = $(PROG).po +MSGFILES = $(SRCS) + CPPFLAGS += -I$(LIBBSM) -I$(AUDITD) -I$(AUDITCONFIG) .KEEP_STATE: -install: all $(ROOTUSRSBINPROG) all: $(PROG) +install: all $(ROOTUSRSBINPROG) + $(PROG): $(SRCS) $(OBJS) $(LINK.c) $(OBJS) -o $@ $(LDLIBS) $(POST_PROCESS) - $(POFILE): $(MSGFILES) $(BUILDPO.msgfiles) -#_msg: $(MSGDOMAINPOFILE) +_msg: $(MSGDOMAINPOFILE) clean: $(RM) $(OBJS) @@ -63,12 +63,4 @@ clean: lint: lint_SRCS include $(SRC)/cmd/Makefile.targ -#include $(SRC)/Makefile.msg.targ -BUILDPO.msgfiles = \ - $(RM) messages.po $(TEXT_DOMAIN).po; \ - $(TOUCH) $(TEXT_DOMAIN).po; \ - $(XGETTEXT) $(XGETFLAGS) $(MSGFILES); \ - $(SED) -e '/^\# msgid/,/^\# msgstr/d' -e '/^domain/d' \ - -e '/^\#$$/d' -e '/^\#, /d' \ - messages.po $(TEXT_DOMAIN).po > $(POFILE); \ - $(RM) messages.po $(TEXT_DOMAIN).po +include $(SRC)/Makefile.msg.targ diff --git a/usr/src/cmd/auditd/Makefile b/usr/src/cmd/auditd/Makefile index bfb9f67a2b..7e40322828 100644 --- a/usr/src/cmd/auditd/Makefile +++ b/usr/src/cmd/auditd/Makefile @@ -44,10 +44,9 @@ LDLIBS += -lbsm -lsecdb -lscf OBJS = audit_scf_shared.o auditd.o doorway.o queue.o SRCS = $(AUDITCONFIG)/audit_scf_shared.c auditd.c doorway.c queue.c -POFILE = auditd.po +POFILE = $(PROG).po MSGFILES = $(SRCS) - .KEEP_STATE: all: $(PROG) @@ -67,7 +66,7 @@ lint: lint_SRCS $(POFILE): $(MSGFILES) $(BUILDPO.msgfiles) -#_msg: $(MSGDOMAINPOFILE) +_msg: $(MSGDOMAINPOFILE) clean: $(RM) $(OBJS) @@ -75,12 +74,4 @@ clean: check: $(CHKMANIFEST) include $(SRC)/cmd/Makefile.targ -#include $(SRC)/Makefile.msg.targ -BUILDPO.msgfiles = \ - $(RM) messages.po $(TEXT_DOMAIN).po; \ - $(TOUCH) $(TEXT_DOMAIN).po; \ - $(XGETTEXT) $(XGETFLAGS) $(MSGFILES); \ - $(SED) -e '/^\# msgid/,/^\# msgstr/d' -e '/^domain/d' \ - -e '/^\#$$/d' -e '/^\#, /d' \ - messages.po $(TEXT_DOMAIN).po > $(POFILE); \ - $(RM) messages.po $(TEXT_DOMAIN).po +include $(SRC)/Makefile.msg.targ diff --git a/usr/src/cmd/auditrecord/Makefile b/usr/src/cmd/auditrecord/Makefile index b77ae3c7a3..4f4670dfc9 100644 --- a/usr/src/cmd/auditrecord/Makefile +++ b/usr/src/cmd/auditrecord/Makefile @@ -19,11 +19,11 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -include ../Makefile.cmd +include $(SRC)/cmd/Makefile.cmd ATTR = audit_record_attr ROOTAUDITDIR = $(ROOT)/usr/lib/audit @@ -36,7 +36,7 @@ PROG = auditrecord AGETTEXT = mkmsg STRIPTEXT = filter_txt ATTRPROC = audit_record_xml -LIBBSMDIR = ../../lib/libbsm +LIBBSMDIR = $(SRC)/lib/libbsm ADTXMLFILE = $(LIBBSMDIR)/common/adt.xml .KEEP_STATE: @@ -56,7 +56,7 @@ $(ROOTAUDITDIR): _msg: $(PROG).po clean: - $(RM) $(PROG) $(TEXT_DOMAIN).po $(ATTR) $(STRIPTEXT) $(AGETTEXT) + $(RM) $(ATTR) $(STRIPTEXT) $(AGETTEXT) $(ATTR): $(STRIPTEXT) $(ATTRPROC) $(ADTXMLFILE) $(ATTR).txt ./$(STRIPTEXT) < $(ATTR).txt > $(ATTR) @@ -72,4 +72,4 @@ $(PROG).po: $(PROG) $(ATTR) $(AGETTEXT) lint: -include ../Makefile.targ +include $(SRC)/cmd/Makefile.targ diff --git a/usr/src/cmd/auditreduce/Makefile b/usr/src/cmd/auditreduce/Makefile index a740ee24a1..4808a0d28e 100644 --- a/usr/src/cmd/auditreduce/Makefile +++ b/usr/src/cmd/auditreduce/Makefile @@ -21,23 +21,22 @@ # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # TABLEDIR = ../praudit -PROG= auditreduce -SRCS= main.c option.c proc.c time.c token.c regex2.c $(TABLEDIR)/toktable.c -OBJS= main.o option.o proc.o time.o token.o regex2.o toktable.o +PROG = auditreduce +SRCS = main.c option.c proc.c time.c token.c regex2.c $(TABLEDIR)/toktable.c +OBJS = main.o option.o proc.o time.o token.o regex2.o toktable.o -include ../Makefile.cmd +include $(SRC)/cmd/Makefile.cmd -TEXT_DOMAIN=SUNW_OST_OSCMD -POFILE=auditreduce.po -POFILES=main.po option.po proc.po time.po token.po +TEXT_DOMAIN = SUNW_OST_OSCMD +POFILE = $(PROG).po +MSGFILES = $(SRCS) CPPFLAGS += -I$(TABLEDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 LDLIBS += -lnsl -lbsm -lscf -ltsol @@ -55,13 +54,15 @@ $(PROG): $(OBJS) toktable.o: $(TABLEDIR)/toktable.c $(COMPILE.c) $(TABLEDIR)/toktable.c -$(POFILE): $(POFILES) - $(RM) -f $@ - $(CAT) $(POFILES) > $@ +$(POFILE): $(MSGFILES) + $(BUILDPO.msgfiles) + +_msg: $(MSGDOMAINPOFILE) lint: lint_SRCS clean: - $(RM) -f $(OBJS) $(PROG) $(POFILES) $(POFILE) + $(RM) $(OBJS) -include ../Makefile.targ +include $(SRC)/cmd/Makefile.targ +include $(SRC)/Makefile.msg.targ diff --git a/usr/src/cmd/auditstat/Makefile b/usr/src/cmd/auditstat/Makefile index 232a01693e..5f91b34739 100644 --- a/usr/src/cmd/auditstat/Makefile +++ b/usr/src/cmd/auditstat/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -27,8 +27,7 @@ PROG= auditstat OBJS = auditstat.o SRCS = $(OBJS:%.o=%.c) -include ../Makefile.cmd -include ../Makefile.cmd.bsm +include $(SRC)/cmd/Makefile.cmd STATCOMMONDIR = $(SRC)/cmd/stat/common @@ -36,6 +35,9 @@ STAT_COMMON_OBJS = timestamp.o STAT_COMMON_SRCS = $(STAT_COMMON_OBJS:%.o=$(STATCOMMONDIR)/%.c) SRCS += $(STAT_COMMON_SRCS) +MSGFILES = $(SRCS) +POFILE = $(PROG).po + LDLIBS += -lbsm CPPFLAGS += -I$(STATCOMMONDIR) @@ -43,6 +45,8 @@ CPPFLAGS += -I$(STATCOMMONDIR) all: $(PROG) +install: all $(ROOTUSRSBINPROG) + $(PROG): $(OBJS) $(STAT_COMMON_OBJS) $(LINK.c) -o $(PROG) $(OBJS) $(STAT_COMMON_OBJS) $(LDLIBS) $(POST_PROCESS) @@ -52,8 +56,14 @@ $(PROG): $(OBJS) $(STAT_COMMON_OBJS) $(POST_PROCESS_O) clean: - -$(RM) $(OBJS) $(STAT_COMMON_OBJS) + $(RM) $(OBJS) $(STAT_COMMON_OBJS) + +$(POFILE): $(MSGFILES) + $(BUILDPO.msgfiles) + +_msg: $(MSGDOMAINPOFILE) lint: lint_SRCS -include ../Makefile.targ +include $(SRC)/cmd/Makefile.targ +include $(SRC)/Makefile.msg.targ diff --git a/usr/src/cmd/praudit/Makefile b/usr/src/cmd/praudit/Makefile index baff4ae9fd..8fafd8043f 100644 --- a/usr/src/cmd/praudit/Makefile +++ b/usr/src/cmd/praudit/Makefile @@ -21,10 +21,9 @@ # # -# Copyright 2008 Sun Microsystems, Inc. All rights reserved. +# Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # XLATEDIR = $(SRC)/lib/libbsm/common @@ -33,14 +32,14 @@ PROG = praudit SRCS = format.c main.c token.c toktable.c printaudit.c prio.c $(XLATEDIR)/adt_xlate.c OBJS = format.o main.o token.o toktable.o printaudit.o prio.o adt_xlate.o -include ../Makefile.cmd +include $(SRC)/cmd/Makefile.cmd TEXT_DOMAIN=SUNW_OST_OSCMD -POFILE = praudit.po +POFILE = $(PROG).po POFILES = $(OBJS:.o=.po) XGETFLAGS += -a -x praudit.xcl -CPPFLAGS += -D_PRAUDIT -I$(SRC)/lib/libbsm/common +CPPFLAGS += -D_PRAUDIT -I$(XLATEDIR) CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 LDLIBS += -lbsm -lnsl -lpam -ltsol @@ -58,20 +57,21 @@ $(PROG): $(OBJS) adt_xlate.o: $(XLATEDIR)/adt_xlate.c $(COMPILE.c) $(XLATEDIR)/adt_xlate.c -$(POFILE): $(POFILES) - $(RM) -f $@ - $(CAT) $(POFILES) > $@ +$(POFILE): $(POFILES) + $(BUILDPO.pofiles) -# has strings but doesn't use gettext adt_xlate.po: $(XLATEDIR)/adt_xlate.c $(RM) adt_xlate.po $(XGETTEXT) $(XGETFLAGS) $(XLATEDIR)/adt_xlate.c $(SED) "/^domain/d" < messages.po > adt_xlate.po $(RM) messages.po +_msg: $(MSGDOMAINPOFILE) + lint: lint_SRCS clean: - $(RM) -f $(OBJS) $(PROG) $(POFILES) $(POFILE) + $(RM) $(OBJS) -include ../Makefile.targ +include $(SRC)/cmd/Makefile.targ +include $(SRC)/Makefile.msg.targ -- cgit v1.2.3