xref: /illumos-gate/usr/src/cmd/mv/Makefile (revision d3b5f563)
17c478bd9Sstevel@tonic-gate# CDDL HEADER START
27c478bd9Sstevel@tonic-gate#
37c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
43d63ea05Sas# Common Development and Distribution License (the "License").
53d63ea05Sas# You may not use this file except in compliance with the License.
67c478bd9Sstevel@tonic-gate#
77c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
87c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
97c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
107c478bd9Sstevel@tonic-gate# and limitations under the License.
117c478bd9Sstevel@tonic-gate#
127c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
137c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
147c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
157c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
167c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
177c478bd9Sstevel@tonic-gate#
187c478bd9Sstevel@tonic-gate# CDDL HEADER END
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate#
2167e3a03eSrie# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
223d63ea05Sas# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gatePROG=		mv
267c478bd9Sstevel@tonic-gateXPG4PROG=	mv
273d63ea05SasOBJS1=		mv.o
283d63ea05SasOBJS=           $(OBJS1) getresponse.o
297c478bd9Sstevel@tonic-gateCPFILE=		cp
307c478bd9Sstevel@tonic-gateLNFILE=		ln
317c478bd9Sstevel@tonic-gateXPG4OBJS=	$(OBJS:%.o=xpg4_%.o)
323d63ea05SasSRCS=		$(OBJS1:%.o=%.c) $(SRC)/common/util/getresponse.c
333d63ea05Sas
347c478bd9Sstevel@tonic-gateROOTLINKS= $(ROOTBIN)/$(CPFILE) $(ROOTBIN)/$(LNFILE)
357c478bd9Sstevel@tonic-gateROOTXPG4LINKS= $(ROOTXPG4BIN)/$(CPFILE) $(ROOTXPG4BIN)/$(LNFILE)
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
387c478bd9Sstevel@tonic-gate
397c478bd9Sstevel@tonic-gateclean $(XPG4)	:= OBJS += values-xpg4.o
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gateCLOBBERFILES += $(CPFILE) $(LNFILE)
427c478bd9Sstevel@tonic-gateCFLAGS	+=	$(CCVERBOSE)
437014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
447014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
45*d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
467c478bd9Sstevel@tonic-gate$(XPG4) := CFLAGS += -DXPG4
473d63ea05SasLINTFLAGS += -DXPG4 -u
487c478bd9Sstevel@tonic-gateXGETFLAGS += -a -x mv.xcl
493d63ea05SasCPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
507c478bd9Sstevel@tonic-gate
51da6c28aaSamwlint :=	LDLIBS += -lcmdutils -lavl -lsec -lnvpair
5267e3a03eSrie$(PROG) := LDLIBS += -lcmdutils -lavl -lsec -lnvpair
5367e3a03eSrie$(XPG4) := LDLIBS += -lcmdutils -lavl -lsec -lnvpair
547c478bd9Sstevel@tonic-gate
557c478bd9Sstevel@tonic-gate.KEEP_STATE:
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gateall:	$(PROG) $(CPFILE) $(LNFILE) $(XPG4)
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gate$(PROG):	$$(OBJS)
607c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
617c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
627c478bd9Sstevel@tonic-gate
637c478bd9Sstevel@tonic-gate$(XPG4):	$$(XPG4OBJS)
647c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(XPG4OBJS) $(LDLIBS)
657c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
667c478bd9Sstevel@tonic-gate
673d63ea05Sas%.o:    $(SRC)/common/util/%.c
683d63ea05Sas	$(COMPILE.c) $(OUTPUT_OPTION) $<
693d63ea05Sas	$(POST_PROCESS_O)
703d63ea05Sas
713d63ea05Sasxpg4_%.o:    %.c
723d63ea05Sas	$(COMPILE.c) -o $@ $<
733d63ea05Sas	$(POST_PROCESS_O)
743d63ea05Sas
753d63ea05Sasxpg4_%.o:    $(SRC)/common/util/%.c
767c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
773d63ea05Sas	$(POST_PROCESS_O)
787c478bd9Sstevel@tonic-gate
793e76f9d6SRichard Lowe%values-xpg4.o:		../../lib/crt/common/values-xpg4.c
803e76f9d6SRichard Lowe	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gate$(CPFILE):	$(PROG)
837c478bd9Sstevel@tonic-gate	@$(RM) $(CPFILE); $(LN) $(PROG) $(CPFILE)
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate$(LNFILE):	$(PROG)
867c478bd9Sstevel@tonic-gate	@$(RM) $(LNFILE); $(LN) $(PROG) $(LNFILE)
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gateinstall: all $(ROOTXPG4PROG) $(ROOTLINKS) $(ROOTXPG4LINKS)
897c478bd9Sstevel@tonic-gate
907c478bd9Sstevel@tonic-gate$(ROOTLINKS):	$(ROOTPROG)
917c478bd9Sstevel@tonic-gate	$(RM) $@
927c478bd9Sstevel@tonic-gate	$(LN) $(ROOTPROG) $@
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gate$(ROOTXPG4LINKS):	$(ROOTXPG4PROG)
957c478bd9Sstevel@tonic-gate	$(RM) $@
967c478bd9Sstevel@tonic-gate	$(LN) $(ROOTXPG4PROG) $@
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gateclean:
997c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(XPG4OBJS)
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gatelint:	lint_SRCS
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
104