xref: /illumos-gate/usr/src/cmd/mv/Makefile (revision be6cf6cdf685195e88e4050d17ae189a595e13bf)
17c478bd9Sstevel@tonic-gate# CDDL HEADER START
27c478bd9Sstevel@tonic-gate#
37c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
43d63ea05Sas145665# Common Development and Distribution License (the "License").
53d63ea05Sas145665# 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.
223d63ea05Sas145665# Use is subject to license terms.
237c478bd9Sstevel@tonic-gate#
247c478bd9Sstevel@tonic-gate
257c478bd9Sstevel@tonic-gatePROG=		mv
267c478bd9Sstevel@tonic-gateXPG4PROG=	mv
273d63ea05Sas145665OBJS1=		mv.o
283d63ea05Sas145665OBJS=           $(OBJS1) getresponse.o
297c478bd9Sstevel@tonic-gateCPFILE=		cp
307c478bd9Sstevel@tonic-gateLNFILE=		ln
317c478bd9Sstevel@tonic-gateXPG4OBJS=	$(OBJS:%.o=xpg4_%.o)
323d63ea05Sas145665SRCS=		$(OBJS1:%.o=%.c) $(SRC)/common/util/getresponse.c
333d63ea05Sas145665
347c478bd9Sstevel@tonic-gateROOTLINKS= $(ROOTBIN)/$(CPFILE) $(ROOTBIN)/$(LNFILE)
357c478bd9Sstevel@tonic-gateROOTXPG4LINKS= $(ROOTXPG4BIN)/$(CPFILE) $(ROOTXPG4BIN)/$(LNFILE)
367c478bd9Sstevel@tonic-gate
377c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
38*be6cf6cdSRobert Mustacchiinclude ../Makefile.ctf
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateclean $(XPG4)	:= OBJS += values-xpg4.o
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateCLOBBERFILES += $(CPFILE) $(LNFILE)
437c478bd9Sstevel@tonic-gateCFLAGS	+=	$(CCVERBOSE)
447c478bd9Sstevel@tonic-gate$(XPG4) := CFLAGS += -DXPG4
457c478bd9Sstevel@tonic-gateXGETFLAGS += -a -x mv.xcl
463d63ea05Sas145665CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
477c478bd9Sstevel@tonic-gate
4867e3a03eSrie$(PROG) := LDLIBS += -lcmdutils -lavl -lsec -lnvpair
4967e3a03eSrie$(XPG4) := LDLIBS += -lcmdutils -lavl -lsec -lnvpair
507c478bd9Sstevel@tonic-gate
51*be6cf6cdSRobert MustacchiCTF_MODE = link
52*be6cf6cdSRobert Mustacchi
537c478bd9Sstevel@tonic-gate.KEEP_STATE:
547c478bd9Sstevel@tonic-gate
557c478bd9Sstevel@tonic-gateall:	$(PROG) $(CPFILE) $(LNFILE) $(XPG4)
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gate$(PROG):	$$(OBJS)
587c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
597c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate$(XPG4):	$$(XPG4OBJS)
627c478bd9Sstevel@tonic-gate	$(LINK.c) -o $@ $(XPG4OBJS) $(LDLIBS)
637c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
647c478bd9Sstevel@tonic-gate
653d63ea05Sas145665%.o:    $(SRC)/common/util/%.c
663d63ea05Sas145665	$(COMPILE.c) $(OUTPUT_OPTION) $<
673d63ea05Sas145665	$(POST_PROCESS_O)
683d63ea05Sas145665
697c478bd9Sstevel@tonic-gatexpg4_%.o:    %.c
707c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
713d63ea05Sas145665	$(POST_PROCESS_O)
723d63ea05Sas145665
733d63ea05Sas145665xpg4_%.o:    $(SRC)/common/util/%.c
743d63ea05Sas145665	$(COMPILE.c) -o $@ $<
753d63ea05Sas145665	$(POST_PROCESS_O)
767c478bd9Sstevel@tonic-gate
773e76f9d6SRichard Lowe%values-xpg4.o:		../../lib/crt/common/values-xpg4.c
783e76f9d6SRichard Lowe	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gate$(CPFILE):	$(PROG)
817c478bd9Sstevel@tonic-gate	@$(RM) $(CPFILE); $(LN) $(PROG) $(CPFILE)
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gate$(LNFILE):	$(PROG)
847c478bd9Sstevel@tonic-gate	@$(RM) $(LNFILE); $(LN) $(PROG) $(LNFILE)
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gateinstall: all $(ROOTXPG4PROG) $(ROOTLINKS) $(ROOTXPG4LINKS)
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gate$(ROOTLINKS):	$(ROOTPROG)
897c478bd9Sstevel@tonic-gate	$(RM) $@
907c478bd9Sstevel@tonic-gate	$(LN) $(ROOTPROG) $@
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gate$(ROOTXPG4LINKS):	$(ROOTXPG4PROG)
937c478bd9Sstevel@tonic-gate	$(RM) $@
947c478bd9Sstevel@tonic-gate	$(LN) $(ROOTXPG4PROG) $@
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gateclean:
977c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(XPG4OBJS)
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
100