xref: /onnv-gate/usr/src/cmd/print/Makefile (revision 6237:466769df01dd)
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
52264Sjacobs# Common Development and Distribution License (the "License").
62264Sjacobs# 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#
22*6237Sjacobs# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate# Use is subject to license terms.
240Sstevel@tonic-gate#
250Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
260Sstevel@tonic-gate#
270Sstevel@tonic-gate# cmd/print/Makefile
280Sstevel@tonic-gate#
290Sstevel@tonic-gate
300Sstevel@tonic-gateinclude ../Makefile.cmd
310Sstevel@tonic-gate
320Sstevel@tonic-gateJAVA_SUBDIRS = printmgr
330Sstevel@tonic-gate
340Sstevel@tonic-gatePRINT_SUBDIRS  =		\
350Sstevel@tonic-gate		scripts		\
360Sstevel@tonic-gate		lpget		\
370Sstevel@tonic-gate		lpset		\
380Sstevel@tonic-gate		conv_fix	\
390Sstevel@tonic-gate		printer-info	\
403781Sceastha		ppdmgr		\
41*6237Sjacobs		selector	\
422264Sjacobs		bsd-sysv-commands
430Sstevel@tonic-gate
440Sstevel@tonic-gateSUBDIRS = $(PRINT_SUBDIRS) $(JAVA_SUBDIRS)
450Sstevel@tonic-gate
463125SjacobsROOTDIRS = 	$(ROOTLIB)/print
470Sstevel@tonic-gate
480Sstevel@tonic-gateall	:=	TARGET= all
490Sstevel@tonic-gateinstall :=	TARGET= install
500Sstevel@tonic-gateclean	:=	TARGET= clean
510Sstevel@tonic-gateclobber	:=	TARGET= clobber
520Sstevel@tonic-gatelint	:=	TARGET= lint
530Sstevel@tonic-gatestrip	:=	TARGET= strip
540Sstevel@tonic-gate_msg	:=      TARGET = _msg
550Sstevel@tonic-gate
560Sstevel@tonic-gate# For testing message catalogs
570Sstevel@tonic-gate_msg_test:=	TARGET = _msg_test
580Sstevel@tonic-gate
590Sstevel@tonic-gatePOFILE= print.po
600Sstevel@tonic-gate
610Sstevel@tonic-gate.KEEP_STATE:
620Sstevel@tonic-gate
630Sstevel@tonic-gateall install:	$(ROOTDIRS) $(SUBDIRS)
640Sstevel@tonic-gate
650Sstevel@tonic-gate#
660Sstevel@tonic-gate# We define our own definition for _msg here because most of these
670Sstevel@tonic-gate# commands have the same PROG names as their counterparts in
680Sstevel@tonic-gate# cmd/lp. Using the _msg rule defined in Makefile.cmd would
690Sstevel@tonic-gate# result in clobbering the cmd/lp message files.
700Sstevel@tonic-gate# To get around this we will define one message file "print.po"
710Sstevel@tonic-gate# for these commands (except java printmgr). To build
720Sstevel@tonic-gate# this file we find all of the .c files and run xgettext on them.
730Sstevel@tonic-gate# Then concatenate this with the scripts.po file.
740Sstevel@tonic-gate#
750Sstevel@tonic-gate_msg:   $(MSGDOMAIN) scripts $(JAVA_SUBDIRS)
760Sstevel@tonic-gate	@$(RM)	$(POFILE)
770Sstevel@tonic-gate	$(XGETTEXT) -s `/bin/find . -type d -name SCCS -prune -o -type f -name '*.c' -print`
780Sstevel@tonic-gate	@/bin/cat messages.po scripts/scripts.po | sed '/domain/d' > $(POFILE)
790Sstevel@tonic-gate	@$(RM) messages.po
800Sstevel@tonic-gate	$(RM)  $(MSGDOMAIN)/$(POFILE)
810Sstevel@tonic-gate	/bin/cp $(POFILE)    $(MSGDOMAIN)
820Sstevel@tonic-gate
830Sstevel@tonic-gate#
840Sstevel@tonic-gate# Create a message file to test with.
850Sstevel@tonic-gate#
860Sstevel@tonic-gate_msg_test: scripts
870Sstevel@tonic-gate	@$(RM)  $(POFILE)
880Sstevel@tonic-gate	$(XGETTEXT) -s -m "xxx" `/bin/find . -print | grep '\.c$$' | sed '/SCCS/d'`
890Sstevel@tonic-gate	@/bin/cat messages.po scripts/scripts.po | sed '/domain/d' > $(POFILE)
900Sstevel@tonic-gate	echo 'domain "SUNW_OST_OSCMD"' > SUNW_OST_OSCMD.po
910Sstevel@tonic-gate	cat $(POFILE) >> SUNW_OST_OSCMD.po
920Sstevel@tonic-gate	msgfmt SUNW_OST_OSCMD.po
930Sstevel@tonic-gate	@$(RM) messages.po $(POFILE) SUNW_OST_OSCMD.po
940Sstevel@tonic-gate
950Sstevel@tonic-gateclean strip cstyle lint:	$(SUBDIRS)
960Sstevel@tonic-gate
970Sstevel@tonic-gateclobber: $(SUBDIRS)
980Sstevel@tonic-gate	$(RM) $(POFILE) $(CLOBBERFILES)
990Sstevel@tonic-gate
1000Sstevel@tonic-gate$(ROOTDIRS) $(MSGDOMAIN):
1010Sstevel@tonic-gate	$(INS.dir)
1020Sstevel@tonic-gate
1030Sstevel@tonic-gate$(SUBDIRS):	FRC
1040Sstevel@tonic-gate		@cd $@; pwd; $(MAKE) $(TARGET)
1050Sstevel@tonic-gate
1060Sstevel@tonic-gateFRC:
107