############################################################################
# $Id: Makefile,v 1.1.1.1 1996/06/30 00:09:17 mtp Exp $
############################################################################
# @Header@
############################################################################
# $Log: Makefile,v $
# Revision 1.1.1.1  1996/06/30 00:09:17  mtp
# Resubmission of PD DCE sources
#
# Revision 1.1.1.1  1995/12/31 05:20:06  mtp
# + Placed under CVS control
#
############################################################################
# 
# (c) Copyright 1991 OPEN SOFTWARE FOUNDATION, INC.
# (c) Copyright 1991 HEWLETT-PACKARD COMPANY
# (c) Copyright 1991 DIGITAL EQUIPMENT CORPORATION
# To anyone who acknowledges that this file is provided "AS IS"
# without any express or implied warranty:
#                 permission to use, copy, modify, and distribute this
# file for any purpose is hereby granted without fee, provided that
# the above copyright notices and this notice appears in all source
# code copies, and that none of the names of Open Software
# Foundation, Inc., Hewlett-Packard Company, or Digital Equipment
# Corporation be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.  Neither Open Software Foundation, Inc., Hewlett-
# Packard Company, nor Digital Equipment Corporation makes any
# representations about the suitability of this software for any
# purpose.
# 
include ${DCE}/Rules.mk

IDL           = ../../rpc/idl/idl_compiler/idl

DEBUG_FLAGS   = -DUSE_PTHREAD_DELAY_NP
CFLAGS        += $(INCFLAGS) $(DEBUG_FLAGS)
INCFLAGS      = -I. -I$(INCDIR) 
IDLFLAGS      += -no_mepv -I$(INCDIR)
INCDIR        = ../../inc

LIBS	      = ../../rpc/runtime/libnck.a \
		../../rpc/idl/lib/libidl.a \
                ${PTHREAD_LIBS}

#                ../../rpc/runtime/libnck.a
CLIENT_OBJS   = perf_cstub.o \
		perfb_cstub.o \
                perfc_sstub.o \
		perfg_cstub.o \
                util.o

SERVER_OBJS   = perf_sstub.o \
		perfb_sstub.o \
                perfc_cstub.o \
		perfg_sstub.o \
                perfb.o \
		perfg.o \
		perf.o \
                util.o

CLIENT        = client
SERVER        = server

all: ${SERVER} ${CLIENT} 

$(CLIENT):    client.c $(CLIENT_OBJS) $(LIBS)
	@echo + building $(CLIENT) ...
	@$(CC) -o $(CLIENT) -O2 $(CFLAGS) client.c $(CLIENT_OBJS) $(LIBS) -lm

$(SERVER):    server.c $(SERVER_OBJS) $(LIBS)
	@echo + building $(SERVER) ...
	@$(CC) -o $(SERVER) ${GDB} $(CFLAGS) server.c $(SERVER_OBJS) $(LIBS) -lm

util.o: util.c
perf.o: perf_c.h perf_p.h
client.c server.h: perf_c.h
perf_c.h: perf.h perfb.h perfc.h perfg.h

perf_cstub.o perf_sstub.o perf.h: perf.idl
	@echo "idl $(IDLFLAGS) perf.idl"
	@$(IDL) $(IDLFLAGS) perf.idl

perfb_cstub.o perfb_sstub.o perfb.h: perfb.idl
	@echo "idl $(IDLFLAGS) perfb.idl"
	@$(IDL) $(IDLFLAGS) perfb.idl

perfc_cstub.o perfc_sstub.o perfc.h: perfc.idl
	@echo "idl $(IDLFLAGS) perfc.idl"
	@$(IDL) $(IDLFLAGS) perfc.idl

perfg_cstub.o perfg_sstub.o perfg.h: perfg.idl
	@echo "idl $(IDLFLAGS) perfg.idl"
	@$(IDL) $(IDLFLAGS) perfg.idl

clean:
	@rm -f *.bak core ${CLIENT} ${SERVER}

clobber:  clean
	@rm -f *.o core perf_cstub.c perf_sstub.c perfb_cstub.c \
        perfb_sstub.c perfc_cstub.c perfc_sstub.c perfg_cstub.c perfg_sstub.c \
        perf.h perfb.h perfc.h perfg.h
