xref: /titanic_41/usr/src/lib/lvm/libmeta/Makefile.com (revision 74e20cfe817b82802b16fac8690dadcda76f54f5)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBRARY=       	libmeta.a
29VERS=          	.1
30COMMON =	$(SRC)/common/lvm
31
32CMN_OBJS = md_crc.o md_convert.o md_revchk.o
33
34DERIVED_OBJS = \
35	mdiox_xdr.o \
36	meta_basic_xdr.o \
37	metad_clnt.o \
38	metad_xdr.o \
39	metamed_clnt.o \
40	metamed_xdr.o \
41	metamhd_clnt.o \
42	metamhd_xdr.o \
43	mdmn_commd_xdr.o \
44	mhdx_xdr.o
45
46LOCAL_OBJS=        \
47	metad_svc_stubs.o \
48	meta_admin.o \
49	meta_attach.o \
50	meta_db.o \
51	meta_db_balance.o \
52	meta_devadm.o \
53	meta_devstamp.o \
54	meta_error.o \
55	meta_getdevs.o \
56	meta_hotspares.o \
57	meta_import.o \
58	meta_init.o \
59	meta_lib_prv.o \
60	meta_mdcf.o \
61	meta_med_err.o \
62	meta_mem.o \
63	meta_metad.o \
64	meta_metad_subr.o \
65	meta_med.o \
66	meta_mh.o \
67	meta_mirror.o \
68	meta_mirror_resync.o \
69	meta_mn_comm.o \
70	meta_mn_changelog.o \
71	meta_mn_handlers.o \
72	meta_mn_msg_table.o \
73	meta_mn_subr.o \
74	meta_mount.o \
75	meta_name.o \
76	meta_nameinfo.o \
77	meta_namespace.o \
78	meta_notify.o \
79	meta_se_notify.o \
80	meta_patch.o \
81	meta_patch_root.o \
82	meta_print.o \
83	meta_raid.o \
84	meta_raid_resync.o \
85	meta_rename.o \
86	meta_repartition.o \
87	meta_replace.o \
88	meta_reset.o \
89	meta_resync.o \
90	meta_runtime.o \
91	meta_set.o \
92	meta_set_drv.o \
93	meta_set_hst.o \
94	meta_set_med.o \
95	meta_set_prv.o \
96	meta_set_tkr.o \
97	meta_setup.o \
98	meta_smf.o \
99	meta_stat.o \
100	meta_statconcise.o \
101	meta_sp.o \
102	meta_stripe.o \
103	meta_systemfile.o \
104	meta_tab.o \
105	meta_time.o \
106	meta_trans.o \
107	meta_userflags.o \
108	metarpcopen.o \
109	metasplitname.o \
110	metagetroot.o \
111	sdssc_bind.o
112
113SPC_OBJS= meta_check.o
114
115CMN_SRCS =	$(CMN_OBJS:%.o=$(COMMON)/%.c)
116LOCAL_SRCS =	$(LOCAL_OBJS:%.o=../common/%.c)
117DERIVED_SRCS =	$(DERIVED_OBJS:%.o=%.c)
118SPC_SRCS = 	$(SPC_OBJS:%.o=../common/%.c)
119
120include ../../../Makefile.lib
121
122OBJECTS64 =	$(LOCAL_OBJS) $(DERIVED_OBJS) $(CMN_OBJS)
123OBJECTS =	$(OBJECTS64) $(SPC_OBJS)
124
125include $(SRC)/lib/lvm/Makefile.lvm
126
127# install this library in the root filesystem
128include ../../../Makefile.rootfs
129
130LIBS =		$(DYNLIB) $(LINTLIB)
131SRCS =		$(CMN_SRCS) $(LOCAL_SRCS) $(DERIVED_SRCS)
132$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
133lint :=		SRCS = $(CMN_SRCS) $(LOCAL_SRCS) $(SPC_SRCS)
134CPPFLAGS +=     -I$(SRC)/lib/lvm/libmeta/common/hdrs
135LDLIBS += 	-lnsl -lc -ladm -ldevid -lgen -lefi -ldevinfo -lscf
136CLEANFILES += 	$(DERIVED_SRCS)
137
138.KEEP_STATE:
139
140BIG_TARGETS = $(OBJECTS64:%=pics/%)
141
142$(BIG_TARGETS) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
143
144$(LINTLIB) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
145
146all: $(LIBS)
147
148objs/%.o profs/%.o pics/%.o: $(COMMON)/%.c
149	$(COMPILE.c) -o $@ $<
150	$(POST_PROCESS_O)
151
152mdiox_xdr.c: $(SRC)/uts/common/sys/lvm/mdiox.x
153	$(RPCGEN) $(RPCGENFLAGS) -c -i 100 $(SRC)/uts/common/sys/lvm/mdiox.x | \
154	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
155
156meta_basic_xdr.c: $(SRC)/uts/common/sys/lvm/meta_basic.x
157	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/meta_basic.x | \
158	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
159
160metad_clnt.c: $(SRC)/head/metad.x
161	$(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metad.x -o $@
162
163metad_xdr.c: $(SRC)/head/metad.x
164	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metad.x -o $@
165
166metamed_clnt.c: $(SRC)/uts/common/sys/lvm/metamed.x
167	$(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/uts/common/sys/lvm/metamed.x | \
168	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
169
170metamed_xdr.c: $(SRC)/uts/common/sys/lvm/metamed.x
171	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/metamed.x | \
172	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
173
174metamhd_clnt.c: $(SRC)/head/metamhd.x
175	$(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metamhd.x -o $@
176
177metamhd_xdr.c: $(SRC)/head/metamhd.x
178	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metamhd.x -o $@
179
180mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x
181	$(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \
182	nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
183
184mdmn_commd_xdr.c: $(SRC)/uts/common/sys/lvm/mdmn_commd.x
185	$(RPCGEN) -c $(SRC)/uts/common/sys/lvm/mdmn_commd.x -o $@
186
187include $(SRC)/lib/lvm/Makefile.targ
188