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#
26
27include		../Makefile.sp
28
29UCBPROGS =	lpr lpq lprm lpc
30BINPROGS =	lp lpstat cancel enable disable $(UCBPROGS)
31SBINPROGS =	accept reject lpmove
32
33LIBPRINTPROGS =	in.lpd
34
35LIBLPPROGS = $(BINPROGS) $(SBINPROGS)
36
37
38OBJS =	$(BINPROGS:=.o) $(SBINPROGS:=.o) $(LIBPRINTPROGS:=.o) common.o
39
40ROOTLIBLPBIN=$(ROOTLIBLP)/bin
41
42ROOTBINPROGS =		$(BINPROGS:%=$(ROOTBIN)/%)
43ROOTUSRSBINPROGS =	$(SBINPROGS:%=$(ROOTUSRSBIN)/%)
44ROOTLIBPRINTPROGS =	$(LIBPRINTPROGS:%=$(ROOTLIBPRINT)/%)
45ROOTLIBLPPROGS =	$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
46
47
48FILEMODE =	0555
49OWNER =		root
50
51include ../../Makefile.cmd
52
53MANIFEST=	rfc1179.xml
54ROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
55$(ROOTMANIFEST)		:= FILEMODE= 444
56
57LPLIB	=	$(SRC)/cmd/lp/lib
58LIBLP	=	$(LPLIB)/lp/liblp.a
59CFLAGS +=	$(CCVERBOSE)
60CPPFLAGS +=	-I.
61CPPFLAGS +=	-I../../../lib/print/libpapi-common/common
62CPPFLAGS +=	-I$(ROOT)/usr/include
63CPPFLAGS +=	-I../../lp/include
64LDLIBS +=	$(LIBLP) -lpapi -lc
65in.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
66in.lpd:=	LDLIBS +=	-lnsl -lsocket
67
68all:	$(BINPROGS) $(SBINPROGS)
69
70#	each program needs common.o as well
71$(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
72	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
73	$(POST_PROCESS)
74
75#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
76ROOTUSRUCB =		$(ROOT)/usr/ucb
77ROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
78$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
79
80$(ROOTLIBLPBIN)/%:	%
81	$(INS.file)
82
83$(ROOTUCBSYMLINKS):
84	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
85
86#	usr/lib links
87ROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
88$(ROOTLIB)/%:	$(ROOTLIB) %
89
90$(ROOTUSRLIBSYMLINKS):
91	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
92
93.KEEP_STATE:
94
95install:	$(ROOTLIBLPPROGS) \
96		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
97		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
98
99check:	$(CHKMANIFEST)
100
101clean:
102	$(RM) $(OBJS)
103
104CLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
105
106lint:
107
108include ../../Makefile.targ
109