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