xref: /titanic_41/usr/src/cmd/print/scripts/Makefile (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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/lp/etc/Makefile
29#
30
31include			../Makefile.sp
32
33ROOTPRINTLIB = 		$(ROOTLIB)/print
34ROOTLIBLPBIN =		$(ROOTLIBLP)/bin
35
36$(ROOTVARSPOOLPRINT)	:= OWNER=root
37
38OWNER =			root
39GROUP =			lp
40FILEMODE =		0755
41
42MSGFILES =              accept lpadmin
43POFILE =                scripts.po
44
45PROG =			conv_lp conv_lpd Makefile.yp
46ROOTLIBPRINTPROG=	$(PROG:%=$(ROOTPRINTLIB)/%)
47$(ROOTLIBPRINTPROG)	:= FILEMODE=0555
48$(ROOTPRINTLIB)/Makefile.yp		:= FILEMODE=0444
49
50USRSBINPROG=		accept lpsystem lpadmin
51ROOTUSRSBINPROG=	$(USRSBINPROG:%=$(ROOTUSRSBIN)/%)
52$(ROOTUSRSBINPROG)		:= FILEMODE=555
53
54PCONF=	 		printers.conf
55ROOTPCONF=		$(PCONF:%=$(ROOTETC)/%)
56$(ROOTPCONF)		:= OWNER=root
57$(ROOTPCONF)		:= GROUP=sys
58$(ROOTPCONF)		:= FILEMODE=644
59
60PPDPROGS=	 	getmakes getmodels getppdfile getppds ppdfilename2mmp
61ROOTPPDPROGS=		$(PPDPROGS:%=$(ROOTLIBLPBIN)/%)
62$(ROOTPPDPROGS)		:= OWNER=root
63$(ROOTPPDPROGS)		:= GROUP=lp
64$(ROOTPPDPROGS)		:= FILEMODE=555
65
66ACCEPTLINKS=		$(ROOTUSRSBIN)/reject $(ROOTBIN)/enable \
67			$(ROOTBIN)/disable $(ROOTLIB)/accept \
68			$(ROOTLIB)/reject
69
70LIBLINKS=		$(ROOTLIB)/lpadmin $(ROOTLIB)/lpsystem
71
72
73.KEEP_STATE:
74
75all :			$(PROG)
76
77$(ROOTLIB)/print/% $(ROOTINIT_D)/%:	%
78	$(INS.file)
79
80$(ROOTLIBLPBIN)/%: %
81	$(INS.file)
82
83$(ROOTINIT_D) $(ROOTUSRSBIN) $(ROOTVARSPOOLPRINT):
84	$(INS.dir)
85
86$(ROOTLIB)/lpadmin:
87	$(RM) $@; $(SYMLINK) ../sbin/lpadmin $@
88
89$(ROOTLIB)/lpsystem:
90	$(RM) $@; $(SYMLINK) ../sbin/lpsystem $@
91
92$(ACCEPTLINKS):
93	$(RM) $@; $(SYMLINK) ../sbin/accept $@
94
95$(ROOTLNKPROGS) :	$(ROOTSTARTPROG)
96			$(RM) $@; $(LN) $(ROOTSTARTPROG) $@
97
98_msg:   $(POFILE)
99
100$(POFILE): $(MSGFILES)
101	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
102	$(XGETTEXT) -s $(POFILE).i
103	$(RM) $@ $(POFILE).i
104	mv messages.po $(POFILE)
105
106#
107# Create a message file to test with
108#
109_msg_test:
110	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
111	$(XGETTEXT) -s -m "xxx" $(POFILE).i
112	$(RM) $@ $(POFILE).i
113	mv messages.po $(POFILE)
114
115install:		$(ROOTINIT_D) $(ROOTLNKPROGS) \
116			$(ROOTLIBPRINTPROG) $(ROOTSTARTPROG) \
117			$(ROOTUSRSBIN) $(ROOTUSRSBINPROG) \
118			$(ROOTVARSPOOLPRINT) $(ROOTPCONF) \
119			$(ROOTPPDPROGS) \
120			$(LIBLINKS) $(ACCEPTLINKS)
121
122$(SYMLINKS1):
123	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG1) $@
124
125$(SYMLINKS2):
126	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG2) $@
127
128$(REJECTLINK):
129	$(RM) $@; $(SYMLINK) accept $@
130
131clean:
132	$(RM) $(POFILE)
133
134clobber: clean
135
136strip lint:
137