xref: /titanic_51/usr/src/cmd/print/bsd-sysv-commands/Makefile (revision b453864f3587ccc3324d7a3b0438a1e542dcfde7)
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 2008 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)
32SBINPROGS =	accept reject lpmove
33
34LIBPRINTPROGS =	in.lpd
35
36LIBLPPROGS = $(BINPROGS) $(SBINPROGS)
37
38
39OBJS =	$(BINPROGS:=.o) $(SBINPROGS:=.o) $(LIBPRINTPROGS:=.o) common.o
40
41ROOTLIBLPBIN=$(ROOTLIBLP)/bin
42
43ROOTBINPROGS =		$(BINPROGS:%=$(ROOTBIN)/%)
44ROOTUSRSBINPROGS =	$(SBINPROGS:%=$(ROOTUSRSBIN)/%)
45ROOTLIBPRINTPROGS =	$(LIBPRINTPROGS:%=$(ROOTLIBPRINT)/%)
46ROOTLIBLPPROGS =	$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
47
48
49FILEMODE =	0555
50OWNER =		root
51
52include ../../Makefile.cmd
53
54MANIFEST=	rfc1179.xml
55ROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
56$(ROOTMANIFEST)		:= FILEMODE= 444
57
58CFLAGS +=	$(CCVERBOSE)
59CPPFLAGS +=	-I.
60CPPFLAGS +=	-I../../../lib/print/libpapi-common/common
61CPPFLAGS +=	-I$(ROOT)/usr/include
62LDLIBS +=	-lpapi -lc
63in.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
64in.lpd:=	LDLIBS +=	-lnsl -lsocket
65
66all:	$(BINPROGS) $(SBINPROGS)
67
68#	each program needs common.o as well
69$(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
70	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
71	$(POST_PROCESS)
72
73#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
74ROOTUSRUCB =		$(ROOT)/usr/ucb
75ROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
76$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
77
78$(ROOTLIBLPBIN)/%:	%
79	$(INS.file)
80
81$(ROOTUCBSYMLINKS):
82	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
83
84#	usr/lib links
85ROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
86$(ROOTLIB)/%:	$(ROOTLIB) %
87
88$(ROOTUSRLIBSYMLINKS):
89	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
90
91.KEEP_STATE:
92
93install:	$(ROOTLIBLPPROGS) \
94		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
95		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
96
97check:	$(CHKMANIFEST)
98
99clean:
100	$(RM) $(OBJS)
101
102CLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
103
104lint:
105
106include ../../Makefile.targ
107