xref: /illumos-gate/usr/src/cmd/print/bsd-sysv-commands/Makefile (revision 5a0af8165ce9590e7a18f1ef4f9badc4dd72c6e6)
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#
22375b28ffSGowtham Thommandra# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23355b4669Sjacobs# Use is subject to license terms.
24355b4669Sjacobs#
255661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
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
49355b4669Sjacobs
50355b4669Sjacobsinclude ../../Makefile.cmd
51355b4669Sjacobs
520a44ef6dSjacobsMANIFEST=	rfc1179.xml
530a44ef6dSjacobsROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
540a44ef6dSjacobs$(ROOTMANIFEST)		:= FILEMODE= 444
550a44ef6dSjacobs
56375b28ffSGowtham ThommandraLPLIB	=	$(SRC)/cmd/lp/lib
57375b28ffSGowtham ThommandraLIBLP	=	$(LPLIB)/lp/liblp.a
58355b4669SjacobsCFLAGS +=	$(CCVERBOSE)
59355b4669SjacobsCPPFLAGS +=	-I.
60355b4669SjacobsCPPFLAGS +=	-I../../../lib/print/libpapi-common/common
610a44ef6dSjacobsCPPFLAGS +=	-I$(ROOT)/usr/include
62375b28ffSGowtham ThommandraCPPFLAGS +=	-I../../lp/include
63*5a0af816SRobert MustacchiLDLIBS +=	$(LIBLP) $(LDSTACKPROTECT) -lpapi -lc
640a44ef6dSjacobsin.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
650a44ef6dSjacobsin.lpd:=	LDLIBS +=	-lnsl -lsocket
66355b4669Sjacobs
677014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
68d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
697014882cSRichard Lowe
705661bb76SJohn Levon# not linted
715661bb76SJohn LevonSMATCH=off
725661bb76SJohn Levon
739622934aSjacobsall:	$(BINPROGS) $(SBINPROGS)
749622934aSjacobs
75355b4669Sjacobs#	each program needs common.o as well
760a44ef6dSjacobs$(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
77355b4669Sjacobs	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
78355b4669Sjacobs	$(POST_PROCESS)
79355b4669Sjacobs
80355b4669Sjacobs#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
81355b4669SjacobsROOTUSRUCB =		$(ROOT)/usr/ucb
82355b4669SjacobsROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
83355b4669Sjacobs$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
84355b4669Sjacobs
859622934aSjacobs$(ROOTLIBLPBIN)/%:	%
869622934aSjacobs	$(INS.file)
879622934aSjacobs
88355b4669Sjacobs$(ROOTUCBSYMLINKS):
89355b4669Sjacobs	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
90355b4669Sjacobs
91355b4669Sjacobs#	usr/lib links
92355b4669SjacobsROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
93355b4669Sjacobs$(ROOTLIB)/%:	$(ROOTLIB) %
94355b4669Sjacobs
95355b4669Sjacobs$(ROOTUSRLIBSYMLINKS):
96355b4669Sjacobs	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
97355b4669Sjacobs
98355b4669Sjacobs.KEEP_STATE:
99355b4669Sjacobs
1009622934aSjacobsinstall:	$(ROOTLIBLPPROGS) \
1010a44ef6dSjacobs		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
102355b4669Sjacobs		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
103355b4669Sjacobs
1040a44ef6dSjacobscheck:	$(CHKMANIFEST)
1050a44ef6dSjacobs
106355b4669Sjacobsclean:
107355b4669Sjacobs	$(RM) $(OBJS)
108355b4669Sjacobs
1090a44ef6dSjacobsCLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
110355b4669Sjacobs
111355b4669Sjacobslint:
112355b4669Sjacobs
113355b4669Sjacobsinclude ../../Makefile.targ
114