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 1996, 2001-2003 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # Makefile for logical volume management 
  27 #
  28 
  29 PROG= rpc.metamhd 
  30 
  31 RPCMOD = metamhd
  32 
  33 DERIVED_FILES = \
  34                 $(RPCMOD)_svc.c \
  35                 $(RPCMOD)_xdr.c \
  36                 mhdx_xdr.c
  37 
  38 OBJECTS=        \
  39                 mhd_drive.o \
  40                 mhd_error.o \
  41                 mhd_failfast.o \
  42                 mhd_freeresult.o \
  43                 mhd_init.o \
  44                 mhd_mem.o \
  45                 mhd_metamhd.o \
  46                 mhd_set.o \
  47                 mhd_synch.o \
  48                 mhd_time.o
  49 
  50 LINTOBJECTS=    \
  51                 mhd_drive.o \
  52                 mhd_error.o \
  53                 mhd_failfast.o \
  54                 mhd_freeresult.o \
  55                 mhd_init.o \
  56                 mhd_mem.o \
  57                 mhd_metamhd.o \
  58                 mhd_set.o \
  59                 mhd_synch.o \
  60                 mhd_time.o
  61 
  62 OBJECTS += $(DERIVED_FILES:.c=.o)
  63 
  64 SRCS = $(OBJECTS:%.o=../%.c)
  65 LINTSRCS = $(LINTOBJECTS:%.o=../%.c)
  66 
  67 include ../../../Makefile.cmd
  68 include ../../Makefile.lvm
  69 
  70 
  71 MDLIBS =
  72 LDLIBS +=       -ladm -lsocket -lnsl
  73 
  74 POFILES= $(OBJECTS:%.o=%.po)
  75 
  76 
  77 $(RPCMOD)_svc.c := RPCGENFLAGS += -A -K -1
  78 
  79 DEFINES += -D_REENTRANT
  80 CFLAGS += $(DEFINES)
  81 
  82 
  83 #
  84 #
  85 lint := LINTFLAGS += -m
  86 
  87 .KEEP_STATE:
  88 
  89 %.o:    ../%.c
  90         $(COMPILE.c) $<
  91 
  92 all:    $(PROG)
  93 
  94 $(PROG): $(OBJECTS)
  95         $(LINK.c) -o $@ $(OBJECTS) $(LDLIBS)
  96         $(POST_PROCESS)
  97 
  98 
  99 ROOTUSRSBINPROG=$(PROG:%=$(ROOTUSRSBIN)/%)
 100 install: all $(ROOTUSRSBINPROG)
 101 
 102 catalog:
 103 
 104 cstyle:
 105         ${CSTYLE} ${SRCS}
 106 
 107 lint:
 108         ${LINT.c} $(LINTFLAGS) ${LINTSRCS}
 109 
 110 clean:
 111         ${RM} ${OBJECTS} ${DERIVED_FILES} *.o a.out core metamhd.x
 112 
 113 clobber: clean
 114         ${RM} $(PROG)
 115 
 116 metamhd_svc.c: $(SRC)/head/metamhd.x
 117         $(CP) $(SRC)/head/metamhd.x .
 118         $(RPCGEN) $(RPCGENFLAGS_SERVER) metamhd.x -o $@
 119         ${RM} metamhd.x
 120 
 121 metamhd_xdr.c: $(SRC)/head/metamhd.x
 122         $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metamhd.x -o $@
 123 
 124 mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x
 125         $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \
 126         /usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head") ; print $$0}' >$@