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 2004 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28 29LIBRARY= libmeta.a 30VERS= .1 31COMMON = $(SRC)/common/lvm 32 33CMN_OBJS = md_crc.o 34 35DERIVED_OBJS = \ 36 mdiox_xdr.o \ 37 meta_basic_xdr.o \ 38 metad_clnt.o \ 39 metad_xdr.o \ 40 metamed_clnt.o \ 41 metamed_xdr.o \ 42 metamhd_clnt.o \ 43 metamhd_xdr.o \ 44 mdmn_commd_xdr.o \ 45 mhdx_xdr.o 46 47LOCAL_OBJS= \ 48 metad_svc_stubs.o \ 49 meta_admin.o \ 50 meta_attach.o \ 51 meta_db.o \ 52 meta_db_balance.o \ 53 meta_devadm.o \ 54 meta_devstamp.o \ 55 meta_error.o \ 56 meta_getdevs.o \ 57 meta_hotspares.o \ 58 meta_import.o \ 59 meta_init.o \ 60 meta_lib_prv.o \ 61 meta_mdcf.o \ 62 meta_med_err.o \ 63 meta_mem.o \ 64 meta_metad.o \ 65 meta_metad_subr.o \ 66 meta_med.o \ 67 meta_mh.o \ 68 meta_mirror.o \ 69 meta_mirror_resync.o \ 70 meta_mn_comm.o \ 71 meta_mn_changelog.o \ 72 meta_mn_handlers.o \ 73 meta_mn_msg_table.o \ 74 meta_mn_subr.o \ 75 meta_mount.o \ 76 meta_name.o \ 77 meta_nameinfo.o \ 78 meta_namespace.o \ 79 meta_notify.o \ 80 meta_se_notify.o \ 81 meta_patch.o \ 82 meta_patch_root.o \ 83 meta_print.o \ 84 meta_raid.o \ 85 meta_raid_resync.o \ 86 meta_rename.o \ 87 meta_repartition.o \ 88 meta_replace.o \ 89 meta_reset.o \ 90 meta_resync.o \ 91 meta_runtime.o \ 92 meta_set.o \ 93 meta_set_drv.o \ 94 meta_set_hst.o \ 95 meta_set_med.o \ 96 meta_set_prv.o \ 97 meta_set_tkr.o \ 98 meta_setup.o \ 99 meta_smf.o \ 100 meta_stat.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 122MAPDIR= $(SRC)/lib/lvm/libmeta/spec/$(TRANSMACH) 123SPECMAPFILE = $(MAPDIR)/mapfile 124OBJECTS64 = $(LOCAL_OBJS) $(DERIVED_OBJS) $(CMN_OBJS) 125OBJECTS = $(OBJECTS64) $(SPC_OBJS) 126 127include $(SRC)/lib/lvm/Makefile.lvm 128 129# install this library in the root filesystem 130include ../../../Makefile.rootfs 131 132LIBS = $(DYNLIB) $(LINTLIB) 133SRCS = $(CMN_SRCS) $(LOCAL_SRCS) $(DERIVED_SRCS) 134$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 135lint := SRCS = $(CMN_SRCS) $(LOCAL_SRCS) $(SPC_SRCS) 136CPPFLAGS += -I$(SRC)/lib/lvm/libmeta/common/hdrs 137LDLIBS += -lnsl -lc -ladm -ldevid -lgen -lefi -ldevinfo -lscf 138CLEANFILES += $(DERIVED_SRCS) 139 140.KEEP_STATE: 141 142BIG_TARGETS = $(OBJECTS64:%=pics/%) 143 144$(BIG_TARGETS) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 145 146$(LINTLIB) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 147 148all: $(LIBS) 149 150objs/%.o profs/%.o pics/%.o: $(COMMON)/%.c 151 $(COMPILE.c) -o $@ $< 152 $(POST_PROCESS_O) 153 154mdiox_xdr.c: $(SRC)/uts/common/sys/lvm/mdiox.x 155 $(RPCGEN) $(RPCGENFLAGS) -c -i 100 $(SRC)/uts/common/sys/lvm/mdiox.x | \ 156 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 157 158meta_basic_xdr.c: $(SRC)/uts/common/sys/lvm/meta_basic.x 159 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/meta_basic.x | \ 160 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 161 162metad_clnt.c: $(SRC)/head/metad.x 163 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metad.x -o $@ 164 165metad_xdr.c: $(SRC)/head/metad.x 166 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metad.x -o $@ 167 168metamed_clnt.c: $(SRC)/uts/common/sys/lvm/metamed.x 169 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/uts/common/sys/lvm/metamed.x | \ 170 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 171 172metamed_xdr.c: $(SRC)/uts/common/sys/lvm/metamed.x 173 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/metamed.x | \ 174 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 175 176metamhd_clnt.c: $(SRC)/head/metamhd.x 177 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metamhd.x -o $@ 178 179metamhd_xdr.c: $(SRC)/head/metamhd.x 180 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metamhd.x -o $@ 181 182mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x 183 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \ 184 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 185 186mdmn_commd_xdr.c: $(SRC)/uts/common/sys/lvm/mdmn_commd.x 187 $(RPCGEN) -c $(SRC)/uts/common/sys/lvm/mdmn_commd.x -o $@ 188 189include $(SRC)/lib/lvm/Makefile.targ 190