xref: /illumos-gate/usr/src/cmd/print/bsd-sysv-commands/Makefile (revision 9622934a862fa39a8e90c816c4136e293d75629d)
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*9622934aSjacobs# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23355b4669Sjacobs# Use is subject to license terms.
24355b4669Sjacobs#
25355b4669Sjacobs# ident	"%Z%%M%	%I%	%E% SMI"
26355b4669Sjacobs#
27355b4669Sjacobs
280a44ef6dSjacobsinclude		../Makefile.sp
290a44ef6dSjacobs
30355b4669SjacobsUCBPROGS =	lpr lpq lprm lpc
31355b4669SjacobsBINPROGS =	lp lpstat cancel enable disable $(UCBPROGS)
32355b4669SjacobsSBINPROGS =	accept reject lpmove
33*9622934aSjacobs
340a44ef6dSjacobsLIBPRINTPROGS =	in.lpd
35355b4669Sjacobs
36*9622934aSjacobsLIBLPPROGS = $(BINPROGS) $(SBINPROGS)
37*9622934aSjacobs
38355b4669Sjacobs
390a44ef6dSjacobsOBJS =	$(BINPROGS:=.o) $(SBINPROGS:=.o) $(LIBPRINTPROGS:=.o) common.o
40355b4669Sjacobs
41*9622934aSjacobsROOTLIBLPBIN=$(ROOTLIBLP)/bin
42*9622934aSjacobs
43355b4669SjacobsROOTBINPROGS =		$(BINPROGS:%=$(ROOTBIN)/%)
44355b4669SjacobsROOTUSRSBINPROGS =	$(SBINPROGS:%=$(ROOTUSRSBIN)/%)
450a44ef6dSjacobsROOTLIBPRINTPROGS =	$(LIBPRINTPROGS:%=$(ROOTLIBPRINT)/%)
46*9622934aSjacobsROOTLIBLPPROGS =	$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
47355b4669Sjacobs
48355b4669Sjacobs
49355b4669SjacobsFILEMODE =	0555
50355b4669SjacobsOWNER =		root
51355b4669Sjacobs
52355b4669Sjacobsinclude ../../Makefile.cmd
53355b4669Sjacobs
540a44ef6dSjacobsMANIFEST=	rfc1179.xml
550a44ef6dSjacobsROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
560a44ef6dSjacobs$(ROOTMANIFEST)		:= FILEMODE= 444
570a44ef6dSjacobs
58355b4669SjacobsCFLAGS +=	$(CCVERBOSE)
59355b4669SjacobsCPPFLAGS +=	-I.
60355b4669SjacobsCPPFLAGS +=	-I../../../lib/print/libpapi-common/common
610a44ef6dSjacobsCPPFLAGS +=	-I$(ROOT)/usr/include
62355b4669SjacobsLDLIBS +=	-lpapi -lc
630a44ef6dSjacobsin.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
640a44ef6dSjacobsin.lpd:=	LDLIBS +=	-lnsl -lsocket
65355b4669Sjacobs
66*9622934aSjacobsall:	$(BINPROGS) $(SBINPROGS)
67*9622934aSjacobs
68355b4669Sjacobs#	each program needs common.o as well
690a44ef6dSjacobs$(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
70355b4669Sjacobs	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
71355b4669Sjacobs	$(POST_PROCESS)
72355b4669Sjacobs
73355b4669Sjacobs#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
74355b4669SjacobsROOTUSRUCB =		$(ROOT)/usr/ucb
75355b4669SjacobsROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
76355b4669Sjacobs$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
77355b4669Sjacobs
78*9622934aSjacobs$(ROOTLIBLPBIN)/%:	%
79*9622934aSjacobs	$(INS.file)
80*9622934aSjacobs
81355b4669Sjacobs$(ROOTUCBSYMLINKS):
82355b4669Sjacobs	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
83355b4669Sjacobs
84355b4669Sjacobs#	usr/lib links
85355b4669SjacobsROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
86355b4669Sjacobs$(ROOTLIB)/%:	$(ROOTLIB) %
87355b4669Sjacobs
88355b4669Sjacobs$(ROOTUSRLIBSYMLINKS):
89355b4669Sjacobs	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
90355b4669Sjacobs
91355b4669Sjacobs.KEEP_STATE:
92355b4669Sjacobs
93*9622934aSjacobsinstall:	$(ROOTLIBLPPROGS) \
940a44ef6dSjacobs		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
95355b4669Sjacobs		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
96355b4669Sjacobs
970a44ef6dSjacobscheck:	$(CHKMANIFEST)
980a44ef6dSjacobs
99355b4669Sjacobsclean:
100355b4669Sjacobs	$(RM) $(OBJS)
101355b4669Sjacobs
1020a44ef6dSjacobsCLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
103355b4669Sjacobs
104355b4669Sjacobslint:
105355b4669Sjacobs
106355b4669Sjacobsinclude ../../Makefile.targ
107