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 2006 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# ident "%Z%%M% %I% %E% SMI" 26# 27# cmd/print/Makefile 28# 29 30include ../Makefile.cmd 31 32JAVA_SUBDIRS = printmgr 33 34PRINT_SUBDIRS = \ 35 scripts \ 36 lpget \ 37 lpset \ 38 conv_fix \ 39 printer-info \ 40 bsd-sysv-commands 41 42SUBDIRS = $(PRINT_SUBDIRS) $(JAVA_SUBDIRS) 43 44ROOTDIRS = $(ROOTLIB)/print 45 46all := TARGET= all 47install := TARGET= install 48clean := TARGET= clean 49clobber := TARGET= clobber 50lint := TARGET= lint 51strip := TARGET= strip 52_msg := TARGET = _msg 53 54# For testing message catalogs 55_msg_test:= TARGET = _msg_test 56 57POFILE= print.po 58 59.KEEP_STATE: 60 61all install: $(ROOTDIRS) $(SUBDIRS) 62 63# 64# We define our own definition for _msg here because most of these 65# commands have the same PROG names as their counterparts in 66# cmd/lp. Using the _msg rule defined in Makefile.cmd would 67# result in clobbering the cmd/lp message files. 68# To get around this we will define one message file "print.po" 69# for these commands (except java printmgr). To build 70# this file we find all of the .c files and run xgettext on them. 71# Then concatenate this with the scripts.po file. 72# 73_msg: $(MSGDOMAIN) scripts $(JAVA_SUBDIRS) 74 @$(RM) $(POFILE) 75 $(XGETTEXT) -s `/bin/find . -type d -name SCCS -prune -o -type f -name '*.c' -print` 76 @/bin/cat messages.po scripts/scripts.po | sed '/domain/d' > $(POFILE) 77 @$(RM) messages.po 78 $(RM) $(MSGDOMAIN)/$(POFILE) 79 /bin/cp $(POFILE) $(MSGDOMAIN) 80 81# 82# Create a message file to test with. 83# 84_msg_test: scripts 85 @$(RM) $(POFILE) 86 $(XGETTEXT) -s -m "xxx" `/bin/find . -print | grep '\.c$$' | sed '/SCCS/d'` 87 @/bin/cat messages.po scripts/scripts.po | sed '/domain/d' > $(POFILE) 88 echo 'domain "SUNW_OST_OSCMD"' > SUNW_OST_OSCMD.po 89 cat $(POFILE) >> SUNW_OST_OSCMD.po 90 msgfmt SUNW_OST_OSCMD.po 91 @$(RM) messages.po $(POFILE) SUNW_OST_OSCMD.po 92 93clean strip cstyle lint: $(SUBDIRS) 94 95clobber: $(SUBDIRS) 96 $(RM) $(POFILE) $(CLOBBERFILES) 97 98$(ROOTDIRS) $(MSGDOMAIN): 99 $(INS.dir) 100 101$(SUBDIRS): FRC 102 @cd $@; pwd; $(MAKE) $(TARGET) 103 104FRC: 105