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 2007 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25
26 LIBRARY= libmeta.a
27 VERS= .1
28 COMMON = $(SRC)/common/lvm
29
30 CMN_OBJS = md_crc.o md_convert.o md_revchk.o
31
32 DERIVED_OBJS = \
33 mdiox_xdr.o \
34 meta_basic_xdr.o \
35 metad_clnt.o \
36 metad_xdr.o \
37 metamed_clnt.o \
38 metamed_xdr.o \
39 metamhd_clnt.o \
40 metamhd_xdr.o \
41 mdmn_commd_xdr.o \
42 mhdx_xdr.o
43
44 LOCAL_OBJS= \
45 metad_svc_stubs.o \
46 meta_admin.o \
47 meta_attach.o \
48 meta_db.o \
49 meta_db_balance.o \
50 meta_devadm.o \
51 meta_devstamp.o \
52 meta_error.o \
53 meta_getdevs.o \
54 meta_hotspares.o \
55 meta_import.o \
56 meta_init.o \
57 meta_lib_prv.o \
58 meta_mdcf.o \
59 meta_med_err.o \
60 meta_mem.o \
61 meta_metad.o \
62 meta_metad_subr.o \
63 meta_med.o \
64 meta_mh.o \
65 meta_mirror.o \
66 meta_mirror_resync.o \
67 meta_mn_comm.o \
68 meta_mn_changelog.o \
69 meta_mn_handlers.o \
70 meta_mn_msg_table.o \
71 meta_mn_subr.o \
72 meta_mount.o \
73 meta_name.o \
74 meta_nameinfo.o \
75 meta_namespace.o \
76 meta_notify.o \
77 meta_se_notify.o \
78 meta_patch.o \
79 meta_patch_root.o \
80 meta_print.o \
81 meta_raid.o \
82 meta_raid_resync.o \
83 meta_rename.o \
84 meta_repartition.o \
85 meta_replace.o \
86 meta_reset.o \
87 meta_resync.o \
88 meta_runtime.o \
89 meta_set.o \
90 meta_set_drv.o \
91 meta_set_hst.o \
92 meta_set_med.o \
93 meta_set_prv.o \
94 meta_set_tkr.o \
95 meta_setup.o \
96 meta_smf.o \
97 meta_stat.o \
98 meta_statconcise.o \
99 meta_sp.o \
100 meta_stripe.o \
101 meta_systemfile.o \
102 meta_tab.o \
103 meta_time.o \
104 meta_trans.o \
105 meta_userflags.o \
106 metarpcopen.o \
107 metasplitname.o \
108 metagetroot.o \
109 sdssc_bind.o
110
111 SPC_OBJS= meta_check.o
112
113 CMN_SRCS = $(CMN_OBJS:%.o=$(COMMON)/%.c)
114 LOCAL_SRCS = $(LOCAL_OBJS:%.o=../common/%.c)
115 DERIVED_SRCS = $(DERIVED_OBJS:%.o=%.c)
116 SPC_SRCS = $(SPC_OBJS:%.o=../common/%.c)
117
118 OBJECTS64 = $(LOCAL_OBJS) $(DERIVED_OBJS) $(CMN_OBJS)
119 OBJECTS = $(OBJECTS64) $(SPC_OBJS)
120
121 include $(SRC)/lib/lvm/Makefile.lvm
122
123 MSGSRCS = $(LOCAL_SRCS) $(SPC_SRCS)
124 MSGFILES = $(MSGSRCS:%.c=%.i)
125 POFILE = libmeta.po
126
127 DCFILES = ../common/meta_print.po
128 DCFILE = libmeta.dc
129
130 CLOBBERFILES += $(POFILE) $(DCFILE)
131
132 # install this library in the root filesystem
133 include ../../../Makefile.rootfs
134
135 LIBS = $(DYNLIB) $(LINTLIB)
136 SRCS = $(CMN_SRCS) $(LOCAL_SRCS) $(DERIVED_SRCS)
137 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
138 lint := SRCS = $(CMN_SRCS) $(LOCAL_SRCS) $(SPC_SRCS)
139 CPPFLAGS += -I$(SRC)/lib/lvm/libmeta/common/hdrs
140 LDLIBS += -lnsl -lc -ladm -ldevid -lgen -lefi -ldevinfo -lscf
141 CLEANFILES += $(DERIVED_SRCS) $(MSGFILES) $(DCFILES)
142
143 .KEEP_STATE:
144
145 BIG_TARGETS = $(OBJECTS64:%=pics/%)
146
147 $(BIG_TARGETS) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
148
149 $(LINTLIB) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
150
151 all: $(LIBS)
152
153 install debug: all $(ROOTLIBS) $(ROOTLINT) $(ROOTLINKS)
154
155 objs/%.o profs/%.o pics/%.o: $(COMMON)/%.c
156 $(COMPILE.c) -o $@ $<
157 $(POST_PROCESS_O)
158
159 mdiox_xdr.c: $(SRC)/uts/common/sys/lvm/mdiox.x
160 $(RPCGEN) $(RPCGENFLAGS) -c -i 100 $(SRC)/uts/common/sys/lvm/mdiox.x | \
161 /usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
162
163 meta_basic_xdr.c: $(SRC)/uts/common/sys/lvm/meta_basic.x
164 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/meta_basic.x | \
165 /usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
166
167 metad_clnt.c: $(SRC)/head/metad.x
168 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metad.x -o $@
169
170 metad_xdr.c: $(SRC)/head/metad.x
171 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metad.x -o $@
172
173 metamed_clnt.c: $(SRC)/uts/common/sys/lvm/metamed.x
174 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/uts/common/sys/lvm/metamed.x | \
175 /usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
176
177 metamed_xdr.c: $(SRC)/uts/common/sys/lvm/metamed.x
178 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/metamed.x | \
179 /usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
180
181 metamhd_clnt.c: $(SRC)/head/metamhd.x
182 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metamhd.x -o $@
183
184 metamhd_xdr.c: $(SRC)/head/metamhd.x
185 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metamhd.x -o $@
186
187 mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x
188 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \
189 /usr/xpg4/bin/awk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@
190
191 mdmn_commd_xdr.c: $(SRC)/uts/common/sys/lvm/mdmn_commd.x
192 $(RPCGEN) -c $(SRC)/uts/common/sys/lvm/mdmn_commd.x -o $@
193
194 $(DCFILE):= XGETFLAGS = -c TRANSLATION_NOTE_LC_TIME -t
195
196 $(DCFILE): $(DCFILES)
197 $(CAT) $(DCFILES) > $(DCFILE)
198
199 $(POFILE): $(MSGFILES)
200 $(BUILDPO.msgfiles)
201
202 _msg: $(MSGDOMAINPOFILE)
203
204 _dc: $(DCMSGDOMAINPOFILE)
205
206 include $(SRC)/lib/lvm/Makefile.targ
207 include $(SRC)/Makefile.msg.targ