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