xref: /titanic_41/usr/src/cmd/print/bsd-sysv-commands/Makefile (revision 1daa57680c1c12da0548089a11b00a9d6d077bb5)
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
28UCBPROGS =	lpr lpq lprm lpc
29BINPROGS =	lp lpstat cancel enable disable $(UCBPROGS)
30
31SBINPROGS =	accept reject lpmove
32
33
34OBJS =	$(BINPROGS:=.o) $(SBINPROGS:=.o) common.o
35
36ROOTBINPROGS =		$(BINPROGS:%=$(ROOTBIN)/%)
37ROOTUSRSBINPROGS =	$(SBINPROGS:%=$(ROOTUSRSBIN)/%)
38
39
40FILEMODE =	0555
41OWNER =		root
42
43include ../../Makefile.cmd
44
45CFLAGS +=	$(CCVERBOSE)
46CPPFLAGS +=	-I.
47CPPFLAGS +=	-I../../../lib/print/libpapi-common/common
48LDLIBS +=	-lpapi -lc
49
50#	each program needs common.o as well
51$(BINPROGS) $(SBINPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c) common.o
52	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
53	$(POST_PROCESS)
54
55#	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
56ROOTUSRUCB =		$(ROOT)/usr/ucb
57ROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
58$(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
59
60$(ROOTUCBSYMLINKS):
61	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
62
63#	usr/lib links
64ROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
65$(ROOTLIB)/%:	$(ROOTLIB) %
66
67$(ROOTUSRLIBSYMLINKS):
68	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
69
70.KEEP_STATE:
71
72all:	$(BINPROGS) $(SBINPROGS)
73
74install:	$(BINPROGS) $(SBINPROGS) $(ROOTBINPROGS) $(ROOTUSRSBINPROGS) \
75		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
76
77clean:
78	$(RM) $(OBJS)
79
80CLOBBERFILES += $(BINPROGS) $(SBINPROGS)
81
82lint:
83
84include ../../Makefile.targ
85