xref: /titanic_41/usr/src/cmd/lvm/rpc.metamedd/Makefile.com (revision 6185db853e024a486ff8837e6784dd290d866112)
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 2002-2003 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# Architecture independent makefile for rpc.metamedd
29#
30# cmd/lvm/rpc.metamedd/Makefile.com
31
32PROG = rpc.metamedd
33
34RPC_DIR = $(SRC)/uts/common/sys/lvm
35
36RPC_OBJS = \
37	meta_basic.x \
38	metamed.x \
39	meta_arr.x
40
41DERIVED_OBJS = \
42	metamed_svc.o \
43	metamed_xdr.o \
44	meta_basic_xdr.o
45
46LOCAL_OBJS= \
47	med_db.o \
48	med_error.o \
49	med_freeresult.o \
50	med_hash.o \
51	med_init.o \
52	med_mem.o \
53	med_synch.o \
54	med_svc_subr.o
55
56LOCAL_SRCS   = $(LOCAL_OBJS:%.o=../%.c)
57DERIVED_SRCS = $(DERIVED_OBJS:%.o=%.c)
58
59include ../../../Makefile.cmd
60include ../../Makefile.lvm
61
62LDLIBS += -lmeta -lsocket -lnsl
63
64CPPFLAGS += $(DEFINES)
65
66lint := LINTFLAGS += -m
67
68metamed_svc.c := RPCGENFLAGS += -K -1
69
70.KEEP_STATE:
71
72%.o:    ../%.c
73	$(COMPILE.c) $<
74	$(POST_PROCESS_O)
75
76all:	$(PROG)
77
78$(PROG): $(LOCAL_OBJS) $(DERIVED_OBJS)
79	$(LINK.c) -o $@ $(LOCAL_OBJS) $(DERIVED_OBJS) $(LDLIBS)
80	$(POST_PROCESS)
81
82install: all $(ROOTUSRSBINPROG)
83
84cstyle:
85	$(CSTYLE) $(LOCAL_SRCS)
86
87lint:
88	$(LINT.c) $(LINTFLAGS) $(LOCAL_SRCS)
89
90clean:
91	$(RM) $(DERIVED_SRCS) $(DERIVED_OBJS) $(LOCAL_OBJS) $(RPC_OBJS)
92
93clobber: clean
94	$(RM) $(PROG)
95
96$(RPC_OBJS): $$(@:%=$(RPC_DIR)/%)
97	$(RM) $@
98	$(CP) $(RPC_DIR)/$@ .
99
100meta_basic_xdr.c: meta_basic.x
101	$(RPCGEN) $(RPCGENFLAGS) -c meta_basic.x > $@
102
103metamed_xdr.c: metamed.x meta_arr.x
104	$(RPCGEN) $(RPCGENFLAGS) -c metamed.x > $@
105
106metamed_svc.c: metamed.x meta_arr.x
107	$(RPCGEN) $(RPCGENFLAGS_SERVER) metamed.x > $@
108