Makefile revision 734b6a94890be549309b21156f8ed6d4561cac51
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# CDDL HEADER START
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# The contents of this file are subject to the terms of the
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# Common Development and Distribution License (the "License").
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# You may not use this file except in compliance with the License.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# or http://www.opensolaris.org/os/licensing.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# See the License for the specific language governing permissions
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# and limitations under the License.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# When distributing Covered Code, include this CDDL HEADER in each
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# If applicable, add the following below this CDDL HEADER, with the
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# fields enclosed by brackets "[]" replaced with your own identifying
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# information: Portions Copyright [yyyy] [name of copyright owner]
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
7190e58eec40192c9719d2f2593471eda14e7e7cfuankg# CDDL HEADER END
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# Use is subject to license terms.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# ident "%Z%%M% %I% %E% SMI"
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# Makefile for volume management daemon
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg# cmd/volmgt/vold/Makefile
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg#
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesPROG= vold
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesinclude ../../../lib/Makefile.lib
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesinclude ../../Makefile.cmd
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesinclude ../Makefile.volmgt
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesSED= sed
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesOBJS= nfs_server.o nfs_trace.o vold_err.o vold_main.o vold_proc.o \
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg vold_node.o vold_util.o vold_dev.o vold_config.o vold_vol.o \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes vold_label.o vold_db.o vold_path.o vold_props.o vold_action.o \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes vold_obj.o vold_mnt.o medium.o partition.o \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes hsfs_partition.o pcfs_partition.o fdisk_partition.o \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes solaris_partition.o udfs_partition.o ufs_partition.o \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes blank_partition.o vtoc.o name_factory.o vold_sysevent.o
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
0662ed52e814f8f08ef0e09956413a792584eddffuankgTMPOBJ= nfs_prot.o
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# drivers for devices
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesDEV_VERS=1
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesDEVS= dev_cdrom.so.${DEV_VERS} dev_floppy.so.${DEV_VERS} \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes dev_test.so.${DEV_VERS} dev_pcmem.so.${DEV_VERS} \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes dev_cdtest.so.${DEV_VERS} \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes dev_rmdisk.so.${DEV_VERS}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# drivers for labels
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLABEL_VERS=1
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLABS= label_test.so.${LABEL_VERS} label_cdrom.so.${LABEL_VERS} \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes label_sun.so.${LABEL_VERS} label_dos.so.${LABEL_VERS}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# databases
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholesDB_VERS=1
8d6e239d0e0aa0593fd93b4fef193d8c51b61b3cfuankgDBS= db_nis.so.${DB_VERS} db_mem.so.${DB_VERS}
b387b9d37fc71c534f4718777454a8f5a1169017fuankg
b387b9d37fc71c534f4718777454a8f5a1169017fuankgSOFILES= ${LABS} ${DEVS} ${DBS}
b387b9d37fc71c534f4718777454a8f5a1169017fuankg
b387b9d37fc71c534f4718777454a8f5a1169017fuankgCFLAGS += $(CCVERBOSE) -D_FILE_OFFSET_BITS=64
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(PROG) := LDLIBS += -lmd -lnsl -ladm -lsmedia -lrpcsvc -lsysevent -lnvpair
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(SOFILES) := LDLIBS += -lc
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# to get the correct DSO flags used for compilation/linking
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# (should also use "-zdefs" for DYNFLAGS, but SOFILES aren't yet self-contained)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(SOFILES) := CFLAGS += $(C_PICFLAGS)
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg$(SOFILES) := HSONAME =
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(SOFILES) := ZDEFS =
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# for bug that causes db_nis.c to fail compilation (for some compilers?)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# with "-xO3" or "-xO2" on SPARC
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesdb_nis.so.$(DB_VERS) := COPTFLAG = -xO1
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Rules for making shared objects out of .c files. Works well if
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# we have a one-to-one mapping. Applies in all cases so far.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.SUFFIXES: .so.${DB_VERS} .so.${LABEL_VERS} .so.${DEV_VERS} ${SUFFIXES}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.c.so.${DB_VERS}:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${CC} ${CPPFLAGS} ${CFLAGS} $(GSHARED) -o $@ $< $(DYNFLAGS) $(LDLIBS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(POST_PROCESS_SO)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.c.so.${LABEL_VERS}:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${CC} ${CPPFLAGS} ${CFLAGS} $(GSHARED) -o $@ $< $(DYNFLAGS) $(LDLIBS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(POST_PROCESS_SO)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.c.so.${DEV_VERS}:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${CC} ${CPPFLAGS} ${CFLAGS} $(GSHARED) -o $@ $< $(DYNFLAGS) $(LDLIBS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(POST_PROCESS_SO)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# for messaging catalog
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesPOFILE= vold.po
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesXFILE= ${ROOT}/usr/include/rpcsvc/nfs_prot.x
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesSRCS= ${OBJS:%.o=%.c} ${DEVS:%.so.${DEV_VERS}=%.c} \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${LABS:%.so.${LABEL_VERS}=%.c} ${DBS:%.so.${DB_VERS}=%.c}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCPPFLAGS += -D_REENTRANT -DSUN_THREADS -DLABEL_VERS=${LABEL_VERS}\
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes -DDB_VERS=${DB_VERS} -DDEV_VERS=${DEV_VERS}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# install macros and rule
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesGROUP= sys
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesROOTVOLD= ${ROOTLIB}/vold
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesROOTSOFILES= ${SOFILES:%=${ROOTVOLD}/%}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg.KEEP_STATE:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesall: $(PROG) $(SOFILES)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesdso dsos libs: $(SOFILES)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescatalog: $(POFILE)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(POFILE): $(SRCS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(RM) $@
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(COMPILE.cpp) $(SRCS) | \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(XGETTEXT) $(XGETFLAGS) -
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(SED) -e '/^domain/d' messages.po > $@
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(RM) messages.po
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes${PROG}: ${OBJS} ${TMPOBJ}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${LINK.c} ${OPT} -o $@ ${OBJS} ${TMPOBJ} ${LDLIBS}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${POST_PROCESS}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLINTFLAGS += -errchk=longptr64
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
ce22ce4743d79a889dca64df4459c598e2c188c7fuankglint:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(LINT.c) ${SRCS}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgcstyle:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${CSTYLE} ${SRCS}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
6c080a25f5991f40225209541c989d7e76c4a39dbnicholesinstall: all ${ROOTVOLD} ${ROOTUSRSBINPROG} ${ROOTSOFILES}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesclean:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${RM} $(OBJS) ${TMPOBJ} $(SOFILES) nfs_prot.c core a.out
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesclobber: clean
b387b9d37fc71c534f4718777454a8f5a1169017fuankg ${RM} $(PROG)
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes
41022996c916eb4ab2ec3204eb491b64779eb100bnicholesnfs_prot.c: $(XFILE)
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes $(RPCGEN) -c $(XFILE) -o $@
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes${ROOTVOLD}/%: %
036436f4f4cdcd76186c0058891216545967043bbnicholes ${INS.file}
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes${ROOTVOLD}:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ${INS.dir}
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg