xref: /illumos-gate/usr/src/cmd/print/bsd-sysv-commands/Makefile (revision 54925bf60766fbb4f1f2d7c843721406a7b7a3fb)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28include		../Makefile.sp
29
30UCBPROGS =	lpr lpq lprm lpc
31BINPROGS =	lp lpstat cancel enable disable $(UCBPROGS)
32
33SBINPROGS =	accept reject lpmove
34LIBPRINTPROGS =	in.lpd
35
36
37OBJS =	$(BINPROGS:=.o) $(SBINPROGS:=.o) $(LIBPRINTPROGS:=.o) common.o
38
39ROOTBINPROGS =		$(BINPROGS:%=$(ROOTBIN)/%)
40ROOTUSRSBINPROGS =	$(SBINPROGS:%=$(ROOTUSRSBIN)/%)
41ROOTLIBPRINTPROGS =	$(LIBPRINTPROGS:%=$(ROOTLIBPRINT)/%)
42
43
44FILEMODE =	0555
45OWNER =		root
46
47include ../../Makefile.cmd
48
49MANIFEST=	rfc1179.xml
50ROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
51$(ROOTMANIFEST)		:= FILEMODE= 444
52
53CFLAGS +=	$(CCVERBOSE)
54CPPFLAGS +=	-I.
55CPPFLAGS +=	-I../../../lib/print/libpapi-common/common
56CPPFLAGS +=	-I$(ROOT)/usr/include
57LDLIBS +=	-lpapi -lc
58in.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
59in.lpd:=	LDLIBS +=	-lnsl -lsocket
60
61#	each program needs common.o as well
62$(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
63	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
64	$(POST_PROCESS)
65
66#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
67ROOTUSRUCB =		$(ROOT)/usr/ucb
68ROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
69$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
70
71$(ROOTUCBSYMLINKS):
72	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
73
74#	usr/lib links
75ROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
76$(ROOTLIB)/%:	$(ROOTLIB) %
77
78$(ROOTUSRLIBSYMLINKS):
79	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
80
81.KEEP_STATE:
82
83all:	$(BINPROGS) $(SBINPROGS)
84
85install:	$(BINPROGS) $(SBINPROGS) $(ROOTBINPROGS) $(ROOTUSRSBINPROGS) \
86		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
87		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
88
89check:	$(CHKMANIFEST)
90
91clean:
92	$(RM) $(OBJS)
93
94CLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
95
96lint:
97
98include ../../Makefile.targ
99