xref: /illumos-gate/usr/src/cmd/print/Makefile (revision fb3fb4f3d76d55b64440afd0af72775dfad3bd1d)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# cmd/print/Makefile
29#
30
31include ../Makefile.cmd
32
33JAVA_SUBDIRS = printmgr
34
35PRINT_SUBDIRS  =		\
36		scripts		\
37		lpget		\
38		lpset		\
39		lp		\
40		lpstat		\
41		cancel		\
42		lpmove		\
43		conv_fix	\
44		printer-info	\
45		gateway
46
47SUBDIRS = $(PRINT_SUBDIRS) $(JAVA_SUBDIRS)
48
49ROOTDIRS = 	$(ROOTLIB)/print \
50		$(ROOTLIB)/print/bsd-adaptor
51
52all	:=	TARGET= all
53install :=	TARGET= install
54clean	:=	TARGET= clean
55clobber	:=	TARGET= clobber
56lint	:=	TARGET= lint
57strip	:=	TARGET= strip
58_msg	:=      TARGET = _msg
59
60# For testing message catalogs
61_msg_test:=	TARGET = _msg_test
62
63POFILE= print.po
64
65.KEEP_STATE:
66
67all install:	$(ROOTDIRS) $(SUBDIRS)
68
69#
70# We define our own definition for _msg here because most of these
71# commands have the same PROG names as their counterparts in
72# cmd/lp. Using the _msg rule defined in Makefile.cmd would
73# result in clobbering the cmd/lp message files.
74# To get around this we will define one message file "print.po"
75# for these commands (except java printmgr). To build
76# this file we find all of the .c files and run xgettext on them.
77# Then concatenate this with the scripts.po file.
78#
79_msg:   $(MSGDOMAIN) scripts $(JAVA_SUBDIRS)
80	@$(RM)	$(POFILE)
81	$(XGETTEXT) -s `/bin/find . -type d -name SCCS -prune -o -type f -name '*.c' -print`
82	@/bin/cat messages.po scripts/scripts.po | sed '/domain/d' > $(POFILE)
83	@$(RM) messages.po
84	$(RM)  $(MSGDOMAIN)/$(POFILE)
85	/bin/cp $(POFILE)    $(MSGDOMAIN)
86
87#
88# Create a message file to test with.
89#
90_msg_test: scripts
91	@$(RM)  $(POFILE)
92	$(XGETTEXT) -s -m "xxx" `/bin/find . -print | grep '\.c$$' | sed '/SCCS/d'`
93	@/bin/cat messages.po scripts/scripts.po | sed '/domain/d' > $(POFILE)
94	echo 'domain "SUNW_OST_OSCMD"' > SUNW_OST_OSCMD.po
95	cat $(POFILE) >> SUNW_OST_OSCMD.po
96	msgfmt SUNW_OST_OSCMD.po
97	@$(RM) messages.po $(POFILE) SUNW_OST_OSCMD.po
98
99clean strip cstyle lint:	$(SUBDIRS)
100
101clobber: $(SUBDIRS)
102	$(RM) $(POFILE) $(CLOBBERFILES)
103
104$(ROOTDIRS) $(MSGDOMAIN):
105	$(INS.dir)
106
107$(SUBDIRS):	FRC
108		@cd $@; pwd; $(MAKE) $(TARGET)
109
110FRC:
111