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