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