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