xref: /illumos-gate/usr/src/cmd/print/scripts/Makefile (revision 7257d1b4d25bfac0c802847390e98a464fd787ac)
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#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 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
69LIBLPPROGS=	 	getmakes getmodels getppdfile getppds ppdfilename2mmp \
70			lpadmin
71ROOTLIBLPPROGS=		$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
72$(ROOTLIBLPPROGS)		:= OWNER=root
73$(ROOTLIBLPPROGS)		:= GROUP=lp
74$(ROOTLIBLPPROGS)		:= FILEMODE=555
75
76LIBLINKS=		$(ROOTLIB)/lpadmin $(ROOTLIB)/lpsystem
77
78
79.KEEP_STATE:
80
81all :			$(PROG)
82
83$(ROOTLIB)/print/%:	%
84	$(INS.file)
85
86$(ROOTLIBLPBIN)/%: %
87	$(INS.file)
88
89$(ROOTVARLPPPD)/%: %
90	$(INS.file)
91
92$(ROOTUSRSBIN) $(ROOTVARSPOOLPRINT) $(ROOTVARLP) $(ROOTVARLPPPD):
93	$(INS.dir)
94
95$(ROOTLIB)/lpadmin:
96	$(RM) $@; $(SYMLINK) ../sbin/lpadmin $@
97
98$(ROOTLIB)/lpsystem:
99	$(RM) $@; $(SYMLINK) ../sbin/lpsystem $@
100
101$(ROOTLNKPROGS) :	$(ROOTSTARTPROG)
102			$(RM) $@; $(LN) $(ROOTSTARTPROG) $@
103
104_msg:   $(POFILE)
105
106$(POFILE): $(MSGFILES)
107	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
108	$(XGETTEXT) -s $(POFILE).i
109	$(RM) $@ $(POFILE).i
110	mv messages.po $(POFILE)
111
112#
113# Create a message file to test with
114#
115_msg_test:
116	grep gettext $(MSGFILES) | tr '`' ' ' | sed -e "s/gettext \"/gettext \(\"/" | sed -e "s/$$/);/"  > $(POFILE).i
117	$(XGETTEXT) -s -m "xxx" $(POFILE).i
118	$(RM) $@ $(POFILE).i
119	mv messages.po $(POFILE)
120
121install:		$(ROOTLNKPROGS) \
122			$(ROOTLIBPRINTPROG) $(ROOTSTARTPROG) \
123			$(ROOTUSRSBIN) $(ROOTUSRSBINPROG) \
124			$(ROOTVARSPOOLPRINT) $(ROOTPCONF) \
125			$(ROOTLIBLPPROGS) $(LIBLINKS) \
126			$(ROOTVARLP) $(ROOTVARLPPPD) \
127			$(ROOTMANUFALIASES)
128
129$(SYMLINKS1):
130	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG1) $@
131
132$(SYMLINKS2):
133	$(RM) $@; $(SYMLINK) ../sbin/$(SBINPROG2) $@
134
135clean:
136	$(RM) $(POFILE)
137
138clobber: clean
139
140strip lint:
141