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