summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarlsonj <none@none>2008-04-03 10:10:34 -0700
committercarlsonj <none@none>2008-04-03 10:10:34 -0700
commita778b211500c8b2b47a35aa015cd89d5548a8ad8 (patch)
treeb77d66a650cf100689dcaa2f9df0d342c8335551
parent3dec9fcdd56adf1b4a563137b4915c8f2d83b881 (diff)
downloadillumos-gate-a778b211500c8b2b47a35aa015cd89d5548a8ad8.tar.gz
6680948 ON could use some common Perl and Python build rules
-rw-r--r--usr/src/Makefile.master47
-rw-r--r--usr/src/cmd/abi/appcert/scripts/Makefile32
-rw-r--r--usr/src/cmd/bsmrecord/Makefile6
-rw-r--r--usr/src/cmd/dtrace/demo/Makefile21
-rw-r--r--usr/src/cmd/filebench/fbscript/Makefile8
-rw-r--r--usr/src/cmd/filebench/scripts/Makefile8
-rw-r--r--usr/src/cmd/intrd/Makefile6
-rw-r--r--usr/src/cmd/kstat/Makefile13
-rw-r--r--usr/src/cmd/lgrpinfo/Makefile8
-rw-r--r--usr/src/cmd/projadd/Makefile12
-rw-r--r--usr/src/cmd/psrinfo/Makefile9
-rw-r--r--usr/src/cmd/sgs/tools/Makefile12
-rw-r--r--usr/src/tools/Makefile.targ12
-rw-r--r--usr/src/uts/i86pc/cpu/scripts/Makefile10
14 files changed, 59 insertions, 145 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index 9f2faf1841..d4e16189c4 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -514,8 +514,9 @@ XGETTEXT= /usr/bin/xgettext
XGETFLAGS= -c TRANSLATION_NOTE
BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
$(RM) $@ ;\
- sed "/^domain/d" < $(<F).po > $@ ;\
+ $(SED) "/^domain/d" < $(<F).po > $@ ;\
$(RM) $(<F).po $<.i
+
#
# This is overwritten by local Makefile when PROG is a list.
#
@@ -983,15 +984,13 @@ PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
.java.class:
$(COMPILE.java) $<
-#
-# Rules to create message catalogue files from .sh, .ksh, .c, .y, and .l
-# files. For .sh and .ksh files, we extract all gettext strings with
-# sed(1) (being careful to permit multiple gettext strings on the same
-# line), weed out the dups, and build the catalogue with awk(1).
-#
+# Bourne and Korn shell script message catalog build rules.
+# We extract all gettext strings with sed(1) (being careful to permit
+# multiple gettext strings on the same line), weed out the dups, and
+# build the catalogue with awk(1).
-.sh.po:
- $(SED) -n -e ":a" \
+.sh.po .ksh.po:
+ $(SED) -n -e ":a" \
-e "h" \
-e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
-e "x" \
@@ -999,14 +998,26 @@ PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
-e "t a" \
$< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
-.ksh.po:
- $(SED) -n -e ":a" \
- -e "h" \
- -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
- -e "x" \
- -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
- -e "t a" \
- $< | sort -u | awk '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
+#
+# Python and Perl executable and message catalog build rules.
+# Note that Python i18n isn't supported by this rule set yet,
+# as it requires a special build tool (pygettext.py).
+#
+.SUFFIXES: .pl .pm .py
+
+.pl:
+ $(RM) $@;
+ $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
+ $(CHMOD) +x $@
+
+.py:
+ $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@
+
+.pl.po .pm.po:
+ $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
+ $(RM) $@ ;
+ $(SED) "/^domain/d" < $(<F).po > $@ ;
+ $(RM) $(<F).po
#
# When using xgettext, we want messages to go to the default domain,
@@ -1051,7 +1062,7 @@ CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
#
# Rules to perform stylistic checks
#
-.SUFFIXES: $(SUFFIXES) .x .xml .check .xmlchk
+.SUFFIXES: .x .xml .check .xmlchk
.h.check:
$(DOT_H_CHECK)
diff --git a/usr/src/cmd/abi/appcert/scripts/Makefile b/usr/src/cmd/abi/appcert/scripts/Makefile
index 9b0899268e..298d870b4e 100644
--- a/usr/src/cmd/abi/appcert/scripts/Makefile
+++ b/usr/src/cmd/abi/appcert/scripts/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.
@@ -20,16 +19,14 @@
# CDDL HEADER END
#
#
-# Copyright (c) 1999-2001 by Sun Microsystems, Inc.
-# All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
#
# cmd/abi/appcert/scripts/Makefile
#
-SUFFIXES += .pl .pm
-
PROG= appcert
APPCERT_SUBCMDS= symcheck symprof symreport abi_index
MODULES= AppcertUtil.pm
@@ -67,14 +64,6 @@ _msg: $(MSGDOMAIN) $(MESSAGES)
$(MSGDOMAIN):
$(INS.dir)
-.pl:
- $(RM) $@
- $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@
- $(CHMOD) +x $@
-
-.pm:
-
-
clean:
-$(RM) $(CLEANFILES)
@@ -87,20 +76,7 @@ $(ROOTLIBABIDIR):
$(ROOTLIBABIDIR)/%: %
$(INS.file)
-%.po: %.pl
- $(XGETTEXT) $(XGETFLAGS) $<
- $(RM) $@
- $(SED) "/^domain/d" messages.po > $@
- $(RM) messages.po
-
-%.po: %.pm
- $(XGETTEXT) $(XGETFLAGS) $<
- $(RM) $@
- $(SED) "/^domain/d" messages.po > $@
- $(RM) messages.po
-
lint:
clobber: clean
-$(RM) $(CLOBBERFILES)
-
diff --git a/usr/src/cmd/bsmrecord/Makefile b/usr/src/cmd/bsmrecord/Makefile
index 244990b44d..d0103cabe3 100644
--- a/usr/src/cmd/bsmrecord/Makefile
+++ b/usr/src/cmd/bsmrecord/Makefile
@@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -60,10 +60,6 @@ _msg: $(PROG).po
clean:
$(RM) $(PROG) $(TEXT_DOMAIN).po $(ATTR) $(STRIPTEXT) $(AGETTEXT)
-%: %.pl
- $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@
- $(CHMOD) 755 $@
-
$(ATTR): $(STRIPTEXT) $(ATTRPROC) $(ADTXMLFILE) $(ATTR).txt
./$(STRIPTEXT) < $(ATTR).txt > $(ATTR)
$(PERL) -I $(LIBBSMDIR) ./$(ATTRPROC) $(ADTXMLFILE) >> $(ATTR)
diff --git a/usr/src/cmd/dtrace/demo/Makefile b/usr/src/cmd/dtrace/demo/Makefile
index 228227dad6..2e5ef38d73 100644
--- a/usr/src/cmd/dtrace/demo/Makefile
+++ b/usr/src/cmd/dtrace/demo/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.
@@ -20,10 +19,10 @@
# CDDL HEADER END
#
#
-# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#pragma ident "%Z%%M% %I% %E% SMI"
+# ident "%Z%%M% %I% %E% SMI"
include ../../Makefile.cmd
@@ -109,9 +108,11 @@ DFILES = \
xterm.d \
xwork.d
+HTMLFILES = index.html
+
DEMOFILES = \
$(DFILES) \
- index.html \
+ $(HTMLFILES) \
sunlogo.gif
MKDEMO = mkdemo
@@ -135,16 +136,12 @@ $(ROOTDEMODIR):
$(ROOTDEMODIR)/%: %
$(INS.file)
-%.html: $(DFILES) $(MKDEMO)
+$(HTMLFILES): $(DFILES) $(MKDEMO)
./$(MKDEMO) $@
-%.d: $(MKDEMO)
+$(DFILES): $(MKDEMO)
./$(MKDEMO) $@
-%: %.pl
- $(CP) $< $@
- $(CHMOD) 755 $@
-
$(ROOTDEMOFILES): $(ROOTDEMODIR)
$(ROOTDEMODIR) := OWNER = root
diff --git a/usr/src/cmd/filebench/fbscript/Makefile b/usr/src/cmd/filebench/fbscript/Makefile
index 2b874e8c25..fdb1d2d00a 100644
--- a/usr/src/cmd/filebench/fbscript/Makefile
+++ b/usr/src/cmd/filebench/fbscript/Makefile
@@ -19,13 +19,12 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
.KEEP_STATE:
-.SUFFIXES: .pl
include ../../Makefile.cmd
@@ -34,11 +33,6 @@ ROOTUSRBENCHDIR = $(ROOT)/usr/benchmarks
ROOTUSRBENCHFBBINDIR = $(ROOTUSRBENCHDIR)/filebench/bin
FBSCRIPT = $(SCRIPT:%=$(ROOTUSRBENCHFBBINDIR)/%)
-.pl:
- $(RM) $@
- $(CAT) $< > $@
- $(CHMOD) +x $@
-
all clean lint:
clobber:
diff --git a/usr/src/cmd/filebench/scripts/Makefile b/usr/src/cmd/filebench/scripts/Makefile
index 09837abc82..f0400292d8 100644
--- a/usr/src/cmd/filebench/scripts/Makefile
+++ b/usr/src/cmd/filebench/scripts/Makefile
@@ -19,13 +19,12 @@
# CDDL HEADER END
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
.KEEP_STATE:
-.SUFFIXES: .pl
include ../../Makefile.cmd
@@ -34,11 +33,6 @@ ROOTUSRBENCHDIR = $(ROOT)/usr/benchmarks
ROOTUSRBENCHFBSCRIPTSDIR = $(ROOTUSRBENCHDIR)/filebench/scripts
FBSCRIPTS = $(SCRIPTS:%=$(ROOTUSRBENCHFBSCRIPTSDIR)/%)
-.pl:
- $(RM) $@
- $(CAT) $< > $@
- $(CHMOD) +x $@
-
all clean lint:
clobber:
diff --git a/usr/src/cmd/intrd/Makefile b/usr/src/cmd/intrd/Makefile
index 69b37d03be..45e914fa57 100644
--- a/usr/src/cmd/intrd/Makefile
+++ b/usr/src/cmd/intrd/Makefile
@@ -20,7 +20,7 @@
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -52,10 +52,6 @@ install: all .WAIT $(ROOTPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
clean:
-%: %.pl
- $(CP) $< $@
- $(CHMOD) 755 $@
-
check: $(CHKMANIFEST)
${ROOTLIB}/%: %
diff --git a/usr/src/cmd/kstat/Makefile b/usr/src/cmd/kstat/Makefile
index ab3d412fe2..2265eb67d7 100644
--- a/usr/src/cmd/kstat/Makefile
+++ b/usr/src/cmd/kstat/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.
@@ -20,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -40,15 +39,9 @@ _msg: $(PROG).po
clean:
-%: %.pl
- $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@
-
$(ROOTBINPROG): $(PROG)
$(INS.file)
-$(PROG).po: $(PROG).pl
- $(XGETTEXT) -d $(PROG) $(PROG).pl
-
lint:
include ../Makefile.targ
diff --git a/usr/src/cmd/lgrpinfo/Makefile b/usr/src/cmd/lgrpinfo/Makefile
index 9178046633..e3669c5562 100644
--- a/usr/src/cmd/lgrpinfo/Makefile
+++ b/usr/src/cmd/lgrpinfo/Makefile
@@ -20,7 +20,7 @@
#
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -43,15 +43,9 @@ install: all .WAIT $(ROOTPROG)
clean:
-%: %.pl
- $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@
-
$(ROOTBINPROG): $(PROG)
$(INS.file)
-$(PROG).po: $(PROG).pl
- $(XGETTEXT) -d $(PROG) $(PROG).pl
-
lint:
include ../Makefile.targ
diff --git a/usr/src/cmd/projadd/Makefile b/usr/src/cmd/projadd/Makefile
index 6b0be5aa4a..0e1e61e85a 100644
--- a/usr/src/cmd/projadd/Makefile
+++ b/usr/src/cmd/projadd/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.
@@ -20,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
@@ -56,10 +55,5 @@ $(MSGDOMAIN):
clobber: clean
-$(RM) $(PROG) $(CLOBBERFILES)
-%: %.pl
- $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@
-
$(ROOTUSRSBIN)/% : %
$(INS.file)
-%.po : %.pl
- $(XGETTEXT) -d $(@:%.po=%) $<
diff --git a/usr/src/cmd/psrinfo/Makefile b/usr/src/cmd/psrinfo/Makefile
index 4a39f0d858..9117d4688e 100644
--- a/usr/src/cmd/psrinfo/Makefile
+++ b/usr/src/cmd/psrinfo/Makefile
@@ -21,7 +21,7 @@
#
#ident "%Z%%M% %I% %E% SMI"
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# cmd/psrinfo/Makefile
@@ -44,16 +44,9 @@ _msg: $(PROG).po
clean:
-%: %.pl
- $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@
-
-
$(ROOTUSRSBINBINPROG): $(PROG)
$(INS.file)
-$(PROG).po: $(PROG).pl
- $(XGETTEXT) -d $(PROG) $(PROG).pl
-
lint:
include ../Makefile.targ
diff --git a/usr/src/cmd/sgs/tools/Makefile b/usr/src/cmd/sgs/tools/Makefile
index ad5684267b..044839c959 100644
--- a/usr/src/cmd/sgs/tools/Makefile
+++ b/usr/src/cmd/sgs/tools/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.
@@ -20,7 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -74,11 +73,6 @@ delete:
lint: $(SUBDIRS)
-%: %.pl
- $(RM) $@
- cat $< > $@
- chmod +x $@
-
%: %.ksh
$(RM) $@
cat $< > $@
diff --git a/usr/src/tools/Makefile.targ b/usr/src/tools/Makefile.targ
index b5f60df69f..b496f5d5fd 100644
--- a/usr/src/tools/Makefile.targ
+++ b/usr/src/tools/Makefile.targ
@@ -21,7 +21,7 @@
#
#ident "%Z%%M% %I% %E% SMI"
#
-# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# common target definitions for tool builds
@@ -34,13 +34,3 @@ lint_PROG:
lint_SRCS:
$(LINT.c) $(SRCS)
-
-%: %.pl
- $(RM) $@
- cat $< > $@
- chmod +x $@
-
-%: %.py
- $(RM) $@
- cat $< > $@
- chmod +x $@
diff --git a/usr/src/uts/i86pc/cpu/scripts/Makefile b/usr/src/uts/i86pc/cpu/scripts/Makefile
index 1d06c1fe0c..a4896ecb6c 100644
--- a/usr/src/uts/i86pc/cpu/scripts/Makefile
+++ b/usr/src/uts/i86pc/cpu/scripts/Makefile
@@ -20,7 +20,7 @@
#
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
@@ -31,9 +31,6 @@ PERLFILES= \
include ../../../Makefile.uts
-OWNER= root
-GROUP= bin
-
.KEEP_STATE:
def all install setup: $(PERLFILES)
@@ -42,8 +39,3 @@ clean clobber:
$(RM) $(PERLFILES)
include ../../../Makefile.targ
-
-%: %.pl
- $(RM) $@
- cat $< > $@
- chmod +x $@