xref: /illumos-gate/usr/src/cmd/print/bsd-sysv-commands/Makefile (revision 8226594fdd4479be135127f43632f1f995074654)
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# Copyright (c) 2018, Joyent, Inc.
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
49
50include ../../Makefile.cmd
51
52MANIFEST=	rfc1179.xml
53ROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
54$(ROOTMANIFEST)		:= FILEMODE= 444
55
56LPLIB	=	$(SRC)/cmd/lp/lib
57LIBLP	=	$(LPLIB)/lp/liblp.a
58CFLAGS +=	$(CCVERBOSE)
59CPPFLAGS +=	-I.
60CPPFLAGS +=	-I../../../lib/print/libpapi-common/common
61CPPFLAGS +=	-I$(ROOT)/usr/include
62CPPFLAGS +=	-I../../lp/include
63LDLIBS +=	$(LIBLP) $(LDSTACKPROTECT) -lpapi -lc
64in.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
65in.lpd:=	LDLIBS +=	-lnsl -lsocket
66
67CERRWARN +=	-_gcc=-Wno-unused-variable
68CERRWARN +=	$(CNOWARN_UNINIT)
69
70# not linted
71SMATCH=off
72
73all:	$(BINPROGS) $(SBINPROGS)
74
75#	each program needs common.o as well
76$(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
77	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
78	$(POST_PROCESS)
79
80#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
81ROOTUSRUCB =		$(ROOT)/usr/ucb
82ROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
83$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
84
85$(ROOTLIBLPBIN)/%:	%
86	$(INS.file)
87
88$(ROOTUCBSYMLINKS):
89	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
90
91#	usr/lib links
92ROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
93$(ROOTLIB)/%:	$(ROOTLIB) %
94
95$(ROOTUSRLIBSYMLINKS):
96	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
97
98.KEEP_STATE:
99
100install:	$(ROOTLIBLPPROGS) \
101		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
102		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
103
104check:	$(CHKMANIFEST)
105
106clean:
107	$(RM) $(OBJS)
108
109CLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
110
111lint:
112
113include ../../Makefile.targ
114