xref: /titanic_52/usr/src/cmd/mv/Makefile (revision 1cb6af97c6f66f456d4f726ef056e1ebc0f73305)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# cmd/mv/Makefile
29#
30
31PROG=		mv
32XPG4PROG=	mv
33OBJS=           mv.o
34CPFILE=		cp
35LNFILE=		ln
36XPG4OBJS=	$(OBJS:%.o=xpg4_%.o)
37SRCS=		$(OBJS:%.o=%.c)
38ROOTLINKS= $(ROOTBIN)/$(CPFILE) $(ROOTBIN)/$(LNFILE)
39ROOTXPG4LINKS= $(ROOTXPG4BIN)/$(CPFILE) $(ROOTXPG4BIN)/$(LNFILE)
40
41include ../Makefile.cmd
42
43clean $(XPG4)	:= OBJS += values-xpg4.o
44
45CLOBBERFILES += $(CPFILE) $(LNFILE)
46CFLAGS	+=	$(CCVERBOSE)
47$(XPG4) := CFLAGS += -DXPG4
48LINTFLAGS += -DXPG4
49XGETFLAGS += -a -x mv.xcl
50CPPFLAGS += -D_FILE_OFFSET_BITS=64
51LINTFLAGS += -DXPG4
52
53lint :=	LDLIBS += -lcmdutils -lavl
54$(PROG) := LDLIBS += $(ZLAZYLOAD) -lcmdutils -lavl $(ZNOLAZYLOAD)
55$(XPG4) := LDLIBS += $(ZLAZYLOAD) -lcmdutils -lavl $(ZNOLAZYLOAD)
56
57.KEEP_STATE:
58
59all:	$(PROG) $(CPFILE) $(LNFILE) $(XPG4)
60
61
62
63$(PROG):	$$(OBJS)
64	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
65	$(POST_PROCESS)
66
67$(XPG4):	$$(XPG4OBJS)
68	$(LINK.c) -o $@ $(XPG4OBJS) $(LDLIBS)
69	$(POST_PROCESS)
70
71xpg4_%.o:	%.c
72	$(COMPILE.c) -o $@ $<
73
74%values-xpg4.o: ../../lib/common/common/values-xpg4.c
75	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
76
77$(CPFILE):	$(PROG)
78	@$(RM) $(CPFILE); $(LN) $(PROG) $(CPFILE)
79
80$(LNFILE):	$(PROG)
81	@$(RM) $(LNFILE); $(LN) $(PROG) $(LNFILE)
82
83install: all $(ROOTXPG4PROG) $(ROOTLINKS) $(ROOTXPG4LINKS)
84
85$(ROOTLINKS):	$(ROOTPROG)
86	$(RM) $@
87	$(LN) $(ROOTPROG) $@
88
89$(ROOTXPG4LINKS):	$(ROOTXPG4PROG)
90	$(RM) $@
91	$(LN) $(ROOTXPG4PROG) $@
92
93clean:
94	$(RM) $(OBJS) $(XPG4OBJS)
95
96lint:	lint_SRCS
97
98include ../Makefile.targ
99