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 2005 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 md_convert.o md_revchk.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_statconcise.o \ 102 meta_sp.o \ 103 meta_stripe.o \ 104 meta_systemfile.o \ 105 meta_tab.o \ 106 meta_time.o \ 107 meta_trans.o \ 108 meta_userflags.o \ 109 metarpcopen.o \ 110 metasplitname.o \ 111 metagetroot.o \ 112 sdssc_bind.o 113 114SPC_OBJS= meta_check.o 115 116CMN_SRCS = $(CMN_OBJS:%.o=$(COMMON)/%.c) 117LOCAL_SRCS = $(LOCAL_OBJS:%.o=../common/%.c) 118DERIVED_SRCS = $(DERIVED_OBJS:%.o=%.c) 119SPC_SRCS = $(SPC_OBJS:%.o=../common/%.c) 120 121include ../../../Makefile.lib 122 123MAPDIR= $(SRC)/lib/lvm/libmeta/spec/$(TRANSMACH) 124SPECMAPFILE = $(MAPDIR)/mapfile 125OBJECTS64 = $(LOCAL_OBJS) $(DERIVED_OBJS) $(CMN_OBJS) 126OBJECTS = $(OBJECTS64) $(SPC_OBJS) 127 128include $(SRC)/lib/lvm/Makefile.lvm 129 130# install this library in the root filesystem 131include ../../../Makefile.rootfs 132 133LIBS = $(DYNLIB) $(LINTLIB) 134SRCS = $(CMN_SRCS) $(LOCAL_SRCS) $(DERIVED_SRCS) 135$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 136lint := SRCS = $(CMN_SRCS) $(LOCAL_SRCS) $(SPC_SRCS) 137CPPFLAGS += -I$(SRC)/lib/lvm/libmeta/common/hdrs 138LDLIBS += -lnsl -lc -ladm -ldevid -lgen -lefi -ldevinfo -lscf 139CLEANFILES += $(DERIVED_SRCS) 140 141.KEEP_STATE: 142 143BIG_TARGETS = $(OBJECTS64:%=pics/%) 144 145$(BIG_TARGETS) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 146 147$(LINTLIB) := CPPFLAGS += -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 148 149all: $(LIBS) 150 151objs/%.o profs/%.o pics/%.o: $(COMMON)/%.c 152 $(COMPILE.c) -o $@ $< 153 $(POST_PROCESS_O) 154 155mdiox_xdr.c: $(SRC)/uts/common/sys/lvm/mdiox.x 156 $(RPCGEN) $(RPCGENFLAGS) -c -i 100 $(SRC)/uts/common/sys/lvm/mdiox.x | \ 157 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 158 159meta_basic_xdr.c: $(SRC)/uts/common/sys/lvm/meta_basic.x 160 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/meta_basic.x | \ 161 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 162 163metad_clnt.c: $(SRC)/head/metad.x 164 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metad.x -o $@ 165 166metad_xdr.c: $(SRC)/head/metad.x 167 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metad.x -o $@ 168 169metamed_clnt.c: $(SRC)/uts/common/sys/lvm/metamed.x 170 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/uts/common/sys/lvm/metamed.x | \ 171 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 172 173metamed_xdr.c: $(SRC)/uts/common/sys/lvm/metamed.x 174 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/metamed.x | \ 175 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 176 177metamhd_clnt.c: $(SRC)/head/metamhd.x 178 $(RPCGEN) $(RPCGENFLAGS) -l $(SRC)/head/metamhd.x -o $@ 179 180metamhd_xdr.c: $(SRC)/head/metamhd.x 181 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/head/metamhd.x -o $@ 182 183mhdx_xdr.c: $(SRC)/uts/common/sys/lvm/mhdx.x 184 $(RPCGEN) $(RPCGENFLAGS) -c $(SRC)/uts/common/sys/lvm/mhdx.x | \ 185 nawk '{sub(/uts\/common\/sys\/lvm/, "head"); print $$0}' >$@ 186 187mdmn_commd_xdr.c: $(SRC)/uts/common/sys/lvm/mdmn_commd.x 188 $(RPCGEN) -c $(SRC)/uts/common/sys/lvm/mdmn_commd.x -o $@ 189 190include $(SRC)/lib/lvm/Makefile.targ 191