xref: /titanic_50/usr/src/cmd/print/bsd-sysv-commands/Makefile (revision 375b28ffc40c6f03a644dc9310ae2000e73ffd5e)
1355b4669Sjacobs#
2355b4669Sjacobs# CDDL HEADER START
3355b4669Sjacobs#
4355b4669Sjacobs# The contents of this file are subject to the terms of the
5355b4669Sjacobs# Common Development and Distribution License (the "License").
6355b4669Sjacobs# You may not use this file except in compliance with the License.
7355b4669Sjacobs#
8355b4669Sjacobs# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9355b4669Sjacobs# or http://www.opensolaris.org/os/licensing.
10355b4669Sjacobs# See the License for the specific language governing permissions
11355b4669Sjacobs# and limitations under the License.
12355b4669Sjacobs#
13355b4669Sjacobs# When distributing Covered Code, include this CDDL HEADER in each
14355b4669Sjacobs# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15355b4669Sjacobs# If applicable, add the following below this CDDL HEADER, with the
16355b4669Sjacobs# fields enclosed by brackets "[]" replaced with your own identifying
17355b4669Sjacobs# information: Portions Copyright [yyyy] [name of copyright owner]
18355b4669Sjacobs#
19355b4669Sjacobs# CDDL HEADER END
20355b4669Sjacobs#
21355b4669Sjacobs#
22*375b28ffSGowtham Thommandra# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23355b4669Sjacobs# Use is subject to license terms.
24355b4669Sjacobs#
25355b4669Sjacobs#
26355b4669Sjacobs
270a44ef6dSjacobsinclude		../Makefile.sp
280a44ef6dSjacobs
29355b4669SjacobsUCBPROGS =	lpr lpq lprm lpc
30355b4669SjacobsBINPROGS =	lp lpstat cancel enable disable $(UCBPROGS)
31355b4669SjacobsSBINPROGS =	accept reject lpmove
329622934aSjacobs
330a44ef6dSjacobsLIBPRINTPROGS =	in.lpd
34355b4669Sjacobs
359622934aSjacobsLIBLPPROGS = $(BINPROGS) $(SBINPROGS)
369622934aSjacobs
37355b4669Sjacobs
380a44ef6dSjacobsOBJS =	$(BINPROGS:=.o) $(SBINPROGS:=.o) $(LIBPRINTPROGS:=.o) common.o
39355b4669Sjacobs
409622934aSjacobsROOTLIBLPBIN=$(ROOTLIBLP)/bin
419622934aSjacobs
42355b4669SjacobsROOTBINPROGS =		$(BINPROGS:%=$(ROOTBIN)/%)
43355b4669SjacobsROOTUSRSBINPROGS =	$(SBINPROGS:%=$(ROOTUSRSBIN)/%)
440a44ef6dSjacobsROOTLIBPRINTPROGS =	$(LIBPRINTPROGS:%=$(ROOTLIBPRINT)/%)
459622934aSjacobsROOTLIBLPPROGS =	$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
46355b4669Sjacobs
47355b4669Sjacobs
48355b4669SjacobsFILEMODE =	0555
49355b4669SjacobsOWNER =		root
50355b4669Sjacobs
51355b4669Sjacobsinclude ../../Makefile.cmd
52355b4669Sjacobs
530a44ef6dSjacobsMANIFEST=	rfc1179.xml
540a44ef6dSjacobsROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
550a44ef6dSjacobs$(ROOTMANIFEST)		:= FILEMODE= 444
560a44ef6dSjacobs
57*375b28ffSGowtham ThommandraLPLIB	=	$(SRC)/cmd/lp/lib
58*375b28ffSGowtham ThommandraLIBLP	=	$(LPLIB)/lp/liblp.a
59355b4669SjacobsCFLAGS +=	$(CCVERBOSE)
60355b4669SjacobsCPPFLAGS +=	-I.
61355b4669SjacobsCPPFLAGS +=	-I../../../lib/print/libpapi-common/common
620a44ef6dSjacobsCPPFLAGS +=	-I$(ROOT)/usr/include
63*375b28ffSGowtham ThommandraCPPFLAGS +=	-I../../lp/include
64*375b28ffSGowtham ThommandraLDLIBS +=	$(LIBLP) -lpapi -lc
650a44ef6dSjacobsin.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
660a44ef6dSjacobsin.lpd:=	LDLIBS +=	-lnsl -lsocket
67355b4669Sjacobs
689622934aSjacobsall:	$(BINPROGS) $(SBINPROGS)
699622934aSjacobs
70355b4669Sjacobs#	each program needs common.o as well
710a44ef6dSjacobs$(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
72355b4669Sjacobs	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
73355b4669Sjacobs	$(POST_PROCESS)
74355b4669Sjacobs
75355b4669Sjacobs#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
76355b4669SjacobsROOTUSRUCB =		$(ROOT)/usr/ucb
77355b4669SjacobsROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
78355b4669Sjacobs$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
79355b4669Sjacobs
809622934aSjacobs$(ROOTLIBLPBIN)/%:	%
819622934aSjacobs	$(INS.file)
829622934aSjacobs
83355b4669Sjacobs$(ROOTUCBSYMLINKS):
84355b4669Sjacobs	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
85355b4669Sjacobs
86355b4669Sjacobs#	usr/lib links
87355b4669SjacobsROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
88355b4669Sjacobs$(ROOTLIB)/%:	$(ROOTLIB) %
89355b4669Sjacobs
90355b4669Sjacobs$(ROOTUSRLIBSYMLINKS):
91355b4669Sjacobs	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
92355b4669Sjacobs
93355b4669Sjacobs.KEEP_STATE:
94355b4669Sjacobs
959622934aSjacobsinstall:	$(ROOTLIBLPPROGS) \
960a44ef6dSjacobs		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
97355b4669Sjacobs		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
98355b4669Sjacobs
990a44ef6dSjacobscheck:	$(CHKMANIFEST)
1000a44ef6dSjacobs
101355b4669Sjacobsclean:
102355b4669Sjacobs	$(RM) $(OBJS)
103355b4669Sjacobs
1040a44ef6dSjacobsCLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
105355b4669Sjacobs
106355b4669Sjacobslint:
107355b4669Sjacobs
108355b4669Sjacobsinclude ../../Makefile.targ
109