/*
 * Imakefile
 *
 * Author: Khalil Amiri
 */
/*
 * Copyright (c) of Carnegie Mellon University, 1997,1998,1999.
 *
 * Permission to reproduce, use, and prepare derivative works of
 * this software for internal use is granted provided the copyright
 * and "No Warranty" statements are included with all reproductions
 * and derivative works. This software may also be redistributed
 * without charge provided that the copyright and "No Warranty"
 * statements are included in all redistributions.
 *
 * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS.
 * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER
 * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED
 * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY
 * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE
 * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT
 * TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
 */

#include "NASD.tmpl"

LOCALDEFINES = -DCHEOPS_PRINT_ERROR

#if BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_NONE
RPCOBJS = nasd_cheops_cl_norpc.o
RPCSRCS = nasd_cheops_cl_norpc.c
#endif /* BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_NONE */

#if BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE
RPCOBJS = nasd_cheops_mgr_cstub.o nasd_cheops_cl_dce.o
RPCSRCS = nasd_cheops_mgr_cstub.c nasd_cheops_cl_dce.c
#endif /* BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE */

#if BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_SRPC
RPCOBJS = nasd_cheops_mgr_cstub.o nasd_cheops_cl_srpc.o
RPCSRCS = nasd_cheops_mgr_cstub.c nasd_cheops_cl_srpc.c
#endif /* BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_SRPC */

SRCS = \
	$(RPCSRCS) \
	nasd_cheops_cl_raid0.c \
	nasd_cheops_cl_raid1.c \
	nasd_cheops_cl_raid5.c \
	nasd_cheops_cl_noraid.c \
	nasd_cheops_cl_init.c \
	nasd_cheops_cl_vnasd.c \
	nasd_cheops_cl_doio.c \
	nasd_cheops_aio.c \
	nasd_cheops_cl_switch.c \
	nasd_cheops_cl_modinit_user.c \
	nasd_cheops_cl_test.c

#if 0
/*	nasd_cheops_cl_stats.c \ */
/*	nasd_cheops_cl_ftmgr.c \ */
#endif

CLERK_OBJS = \
	$(RPCOBJS) \
	nasd_cheops_cl_raid0.o \
	nasd_cheops_cl_raid1.o \
	nasd_cheops_cl_raid5.o \
	nasd_cheops_cl_noraid.o \
	nasd_cheops_cl_init.o \
	nasd_cheops_cl_vnasd.o \
	nasd_cheops_cl_doio.o \
	nasd_cheops_aio.o \
	nasd_cheops_cl_switch.o \
	nasd_cheops_cl_modinit_user.o \
	nasd_cheops_cl_test.o

#if 0
/*	nasd_cheops_cl_stats.o \*/
/*CO	nasd_cheops_cl_ftmgr.o \*/
#endif

CLERKLIB_OBJS = \
	$(RPCOBJS) \
	nasd_cheops_cl_raid0.o \
	nasd_cheops_cl_raid1.o \
	nasd_cheops_cl_raid5.o \
	nasd_cheops_cl_noraid.o \
	nasd_cheops_cl_init.o \
	nasd_cheops_cl_vnasd.o \
	nasd_cheops_cl_doio.o \
	nasd_cheops_aio.o \
	nasd_cheops_cl_switch.o \
	nasd_cheops_cl_modinit_user.o

#if 0
/*CO	nasd_cheops_cl_stats.o \*/
/*CO	nasd_cheops_cl_ftmgr.o \*/
#endif

NASD_CCCLibTargetSimple(cheops_clerk,$(CLERK_OBJS))
NormalLibraryTarget($(CHEOPS_CLRKLIBNAME),$(CLERKLIB_OBJS))

#if BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE
NASD_IDLGenClient($(THE_TOP)/include/nasd/nasd_cheops_mgr.idl,nasd_cheops_mgr_cstub,nasd_cheops_mgr.h)
#endif /* BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_DCE */

#if BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_SRPC
NASD_RPCSimpleGenClient(nasd_cheops_mgr)
#endif /* BUILD_NASD_RPC_PACKAGE == NASD_RPC_PACKAGE_SRPC */

InstallLibrary($(CHEOPS_CLRKLIBNAME),$(NASD_DESTLIB))

#undef InstallManPage
#define InstallManPage(file,dest)

cheops_clerk.third: cheops_clerk Imakefile
	atom -o /usr/tmp/atom.out -tool third cheops_clerk \
	-env threads -excobj libc.so -excobj libc_r.so -excobj libpthreads.so \
	-shlibdir /usr/tmp/atom
	mv /usr/tmp/atom.out $@

NASD_Depend()

/*
 * Don't put anything after this
 */
#include "NASD.trailer"
