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 # Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24 # Use is subject to license terms. 25 # 26 # Copyright (c) 2012 by Delphix. All rights reserved. 27 # Copyright 2016 Nexenta Systems, Inc. All rights reserved. 28 # 29 include $(SRC)/cmd/Makefile.cmd 30 31 ROOTOPTPKG = $(ROOT)/opt/nfsv4-tests 32 TESTBIN = $(ROOTOPTPKG)/bin 33 34 PROGS = nfsh 35 BINS = $(PROGS:%=$(TESTBIN)/%) 36 $(BINS) := FILEMODE = 0555 37 38 LINTOBJS= nfs_main.o nfs_proc.o nfs_ops.o nfs_attr.o nfs_utils.o \ 39 nfs_open.o 40 OBJS= $(LINTOBJS) nfs4_clnt.o nfs4_xdr.o 41 NFS4X= ../nfs4_prot.x 42 43 CFLAGS = -erroff=%all # Ignore all lint msg now 44 CFLAGS += -I/usr/include 45 LDLIBS += -lnsl -lsocket -ltcl8.5 46 LDFLAGS += -zignore 47 48 all install: $(BINS) 49 50 $(BINS): $(OBJS) 51 $(LINK.c) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS) 52 $(POST_PROCESS) 53 54 nfs4_prot.h nfs4_clnt.c nfs4_xdr.c: $(NFS4X) 55 $(CP) $(NFS4X) . 56 $(RPCGEN) -C -c nfs4_prot.x > nfs4_xdr.c 57 $(RPCGEN) -C -h nfs4_prot.x > nfs4_prot.h 58 $(RPCGEN) -C -l nfs4_prot.x > nfs4_clnt.c 59 60 nfs_proc.o: nfs4_prot.h 61 $(COMPILE.c) $(CPPFLAGS) $(CFLAGS) -c nfs_proc.c 62 $(POST_PROCESS) 63 64 nfs_main.o: nfs_main.c 65 $(COMPILE.c) $(CFLAGS) -c nfs_main.c 66 $(POST_PROCESS) 67 68 $(OBJS): nfs4_prot.h 69 70 clobber clean: 71 $(RM) *.o nfs4*.? 72 $(RM) $(PROGS) $(TCLLIB) 73 74 lint: 75 $(LINT.c) $(CFLAGS) $(LINTOBJS:.o=.c) 76 77 $(TESTBIN)/%: % 78 $(INS.file)