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 1989,1996-2003 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # ident "%Z%%M% %I%     %E% SMI"
  27 #
  28 # cmd/fs.d/cachefs/common
  29 #
  30 
  31 FSTYPE=         cachefs
  32 
  33 include         ../../Makefile.fstype
  34 
  35 PROGOBJS=       objs/subr.o objs/stats_create.o objs/stats_stats.o \
  36                 objs/stats_log.o objs/stats_dbm.o objs/cachefsd_clnt.o \
  37                 objs/cachefsd_xdr.o
  38 
  39 PROGOBJSMT=     objsmt/subr.o objsmt/stats_create.o objsmt/stats_stats.o \
  40                 objsmt/stats_log.o objsmt/stats_dbm.o objsmt/cachefsd_clnt.o \
  41                 objsmt/cachefsd_xdr.o
  42 
  43 include         ../Makefile.cachefs
  44 
  45 ARFLAGS=        rc
  46 CLEANFILES +=   cachefsd_clnt.c cachefsd_xdr.c $(PROGOBJS) $(PROGOBJSMT)
  47 CLOBBERFILES += $(LIBRARY) $(LIBRARYMT) cachefsd.h
  48 RPCGENFLAGS=    -M -C -T
  49 CPPFLAGS +=     -D_LARGEFILE64_SOURCE
  50 CPPFLAGSMT +=   ${CPPFLAGS} -D_REENTRANT
  51 
  52 all:    $(LIBRARY) $(LIBRARYMT)
  53 
  54 
  55  objs objsmt:
  56         -@mkdir -p $@
  57 
  58  objs/%.o : %.c
  59         $(CC) ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
  60  
  61  objsmt/%.o : %.c
  62         $(CC) ${CFLAGS} ${CPPFLAGSMT} -c -o $@ $<
  63 
  64 
  65 $(LIBRARY):     objs cachefsd.h $(PROGOBJS) 
  66         -$(RM) $(LIBRARY)
  67         $(AR) $(ARFLAGS) $(LIBRARY) $(PROGOBJS)
  68  
  69 $(LIBRARYMT):   objsmt cachefsd.h $(PROGOBJSMT)
  70         -$(RM) $(LIBRARYMT)
  71         $(AR) $(ARFLAGS) $(LIBRARYMT) $(PROGOBJSMT)
  72 
  73 cachefsd_clnt.c : cachefsd.x
  74         $(RPCGEN) $(RPCGENFLAGS) -l -o cachefsd_clnt.c cachefsd.x
  75 
  76 cachefsd_xdr.c : cachefsd.x
  77         $(RPCGEN) $(RPCGENFLAGS) -c -o cachefsd_xdr.c cachefsd.x
  78 
  79 cachefsd.h : cachefsd.x
  80         $(RPCGEN) $(RPCGENFLAGS) -h -o cachefsd.h cachefsd.x
  81