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
31PROG= rpc.metamhd 
32
33RPCMOD = metamhd
34
35DERIVED_FILES = \
36		$(RPCMOD)_svc.c \
37		$(RPCMOD)_xdr.c \
38		mhdx_xdr.c
39
40OBJECTS=	\
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
52LINTOBJECTS=	\
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
64OBJECTS += $(DERIVED_FILES:.c=.o)
65
66SRCS = $(OBJECTS:%.o=../%.c)
67LINTSRCS = $(LINTOBJECTS:%.o=../%.c)
68
69include ../../../Makefile.cmd
70include ../../Makefile.lvm
71
72
73MDLIBS =
74LDLIBS +=	-ladm -lsocket -lnsl
75
76POFILES= $(OBJECTS:%.o=%.po)
77
78
79$(RPCMOD)_svc.c := RPCGENFLAGS += -A -K -1
80
81DEFINES += -D_REENTRANT
82CFLAGS += $(DEFINES)
83
84
85#
86#
87lint := LINTFLAGS += -m
88
89.KEEP_STATE:
90
91%.o:	../%.c
92	$(COMPILE.c) $<
93
94all:	$(PROG)
95
96$(PROG): $(OBJECTS)
97	$(LINK.c) -o $@ $(OBJECTS) $(LDLIBS)
98	$(POST_PROCESS)
99
100
101ROOTUSRSBINPROG=$(PROG:%=$(ROOTUSRSBIN)/%)
102install: all $(ROOTUSRSBINPROG)
103
104catalog:
105
106cstyle:
107	${CSTYLE} ${SRCS}
108
109lint:
110	${LINT.c} $(LINTFLAGS) ${LINTSRCS}
111
112clean:
113	${RM} ${OBJECTS} ${DERIVED_FILES} *.o a.out core metamhd.x
114
115clobber: clean
116	${RM} $(PROG)
117
118metamhd_svc.c: $(SRC)/head/metamhd.x
119	$(CP) $(SRC)/head/metamhd.x .
120	$(RPCGEN) $(RPCGENFLAGS_SERVER) metamhd.x -o $@
121	${RM} metamhd.x
122
123metamhd_xdr.c: $(SRC)/head/metamhd.x
124	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metamhd.x -o $@
125
126mhdx_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}' >$@
129