xref: /illumos-gate/usr/src/cmd/lp/cmd/Makefile (revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e)
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#
23#
24# ident	"%Z%%M%	%I%	%E% SMI"
25#
26# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
27# Use is subject to license terms.
28#
29# cmd/lp/cmd/Makefile
30#
31
32include 	../Makefile.lp
33
34OWNER = root
35
36SUBDIRS =	lpc lptest lpadmin lpsched lpstat adaptor scripts
37
38LOCALPROG1 =	lp lpsystem lpmove lpshut
39LOCALPROG2 =	accept
40LOCALPROG =	$(LOCALPROG1) $(LOCALPROG2)
41LOCALLINKS =	disable enable reject
42
43SBINPROG =	lpfilter lpforms lpusers
44
45LIBLINKS =	$(SBINPROG)
46
47PROG =		$(LOCALPROG) $(SBINPROG)
48
49COMMONOBJ=	comb.o
50OTHEROBJS=	cancel.o lp.o $(SBINPROG:=.o)
51
52OBJS=		$(COMMONOBJ) $(OTHEROBJS)
53
54SRCS=          $(OBJS:.o=.c)
55
56POFILE=		lp_cmd.po
57POFILES=	$(SRCS:%.c=%.po) lpsystem.po lpmove.po lpschedlpshut.po
58
59ROOTLIBLPLOCLPROG=	$(LOCALPROG:%=$(ROOTLIBLPLOCL)/%)
60ROOTSBINPROG=	$(SBINPROG:%=$(ROOTUSRSBIN)/%)
61ROOTSYMLINKS=	$(LIBLINKS:%=$(ROOTLIB)/%)
62ROOTSYMLINKS2=	$(LOCALLINKS:%=$(ROOTLIBLPLOCL)/%)
63
64
65CPPFLAGS =	-I$(LPINC) $(CPPFLAGS.master)
66
67# conditional assignments
68#
69accept:=	LDLIBS += $(LIBMSG) $(LIBACC) $(LIBOAM) $(LIBLP)
70cancel:=	LDLIBS += $(LIBREQ) $(LIBMSG) $(LIBOAM) $(LIBLP)
71lp:=		LDLIBS += $(LIBPRT) $(LIBREQ) $(LIBMSG) $(LIBOAM) $(LIBLP)
72lpfilter:=	LDLIBS += $(LIBFLT) $(LIBMSG) $(LIBACC) $(LIBOAM) $(LIBLP) \
73			-lgen -z lazyload -lsecdb -z nolazyload
74lpforms:=	LDLIBS += $(LIBFRM) $(LIBMSG) $(LIBREQ) $(LIBOAM) \
75			$(LIBACC) $(LIBLP) \
76			-z lazyload -lsecdb -z nolazyload
77lpmove:=	LDLIBS += $(LIBMSG) $(LIBACC) $(LIBOAM) $(LIBLP)
78lpshut:=	LDLIBS += $(LIBMSG) $(LIBOAM) $(LIBLP)
79lpsystem:=	LDLIBS += $(LIBSYS) $(LIBMSG) $(LIBACC) $(LIBOAM) $(LIBLP) \
80			-lnsl -z lazyload -lsecdb -z nolazyload
81lpusers:=	LDLIBS += $(LIBMSG) $(LIBACC) $(LIBOAM) $(LIBUSR) $(LIBLP)
82
83.KEEP_STATE:
84
85all:		$(PROG) $(SUBDIRS)
86
87accept:		$(COMMONOBJ)
88		$(LINK.c) -o $@ $(COMMONOBJ) $(LDFLAGS) $(LDLIBS)
89		$(POST_PROCESS)
90
91
92install:	$(PROG) $(ROOTLIBLPLOCLPROG) $(ROOTSBINPROG) \
93		$(ROOTSYMLINKS) $(ROOTSYMLINKS2) $(SUBDIRS)
94
95catalog:	$(SUBDIRS) $(POFILE)
96		$(CP) $(POFILE) ..
97
98clean:		$(SUBDIRS)
99		$(RM) $(OBJS)
100
101clobber:	$(SUBDIRS) local_clobber
102
103local_clobber:
104		$(RM) $(OBJS) $(PROG) lpmove.o lpsystem.o $(CLOBBERFILES)
105
106strip:		$(SUBDIRS)
107		$(STRIP) $(PROG)
108
109lint:
110		$(LINT.c) $(SRCS) $(LDLIBS)
111
112$(LOCALPROG1) $(SBINPROG): $$@.o
113		$(LINK.c) -o $@ $@.o $(LDFLAGS) $(LDLIBS)
114		$(POST_PROCESS)
115
116$(ROOTSYMLINKS):
117		$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
118
119$(ROOTSYMLINKS2):
120		$(RM) $@; $(SYMLINK) ./accept $@
121
122$(SUBDIRS):	FRC
123		@cd $@; pwd; $(MAKE) $(TARGET)
124
125include		../Makefile.lp.msg
126
127FRC:
128