# 
# (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.
# 

CC            = gcc
IDL           = ../../../../rpc/idl/idl_compiler/idl

CFLAGS        = -D_BSD $(INCFLAGS) $(DEBUG_FLAGS) -DLINUX -D_REENTRANT
INCFLAGS      = -I. -I$(INCDIR) 
IDLFLAGS      = -no_mepv -keep c_source -I$(INCDIR) -cc_cmd "gcc -D_BSD -DLINUX -D_REENTRANT -c"
INCDIR        = ../../../../inc

INSTALL	      = /etc/install

LD	      = $(CC)

LDFLAGS	      = $(DEBUG_FLAGS)
DEBUG_FLAGS   =

LIBS	      = ../../../../rpc/runtime/libnck.a \
		../../../../rpc/idl/lib/libidl.a \
		../../../../threads/libpthreads-ext.a

MAKEFILE      = Makefile

CLIENT_OBJS   = client.o \
		perf_cstub.o \
		perfb_cstub.o \
                perfc_sstub.o \
		perfg_cstub.o \
                util.o

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

SHELL         = /bin/sh

CLIENT        = client

SERVER        = server

PROGRAM       = $(CLIENT) $(SERVER)

all:		$(PROGRAM)

clean:;         @rm -f $(CLIENT_OBJS) $(SERVER_OBJS) \
                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

clobber:;       @rm -f $(CLIENT_OBJS) $(SERVER_OBJS) $(CLIENT) $(SERVER) \
                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

$(CLIENT):    $(CLIENT_OBJS) $(LIBS)
		@echo "Linking $(CLIENT) ..."
		$(LD) $(LDFLAGS) $(CLIENT_OBJS) $(LIBS) -o $(CLIENT) \
		-lm -lpthread
#s -lc_r -lc_p -lmach
		@echo "done"

$(SERVER):    $(SERVER_OBJS) $(LIBS)
		@echo "Linking $(SERVER) ..."
		$(LD) $(LDFLAGS) $(SERVER_OBJS) $(LIBS) -o $(SERVER) \
		-lm -lpthread
#s -lc_r -lc_p -lmach
		@echo "done"

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.c perf_sstub.c perf.h: perf.idl
	$(IDL) $(IDLFLAGS) perf.idl

perfb_cstub.c perfb_sstub.c perfb.h: perfb.idl
	$(IDL) $(IDLFLAGS) perfb.idl

perfc_cstub.c perfc_sstub.c perfc.h: perfc.idl
	$(IDL) $(IDLFLAGS) perfc.idl

perfg_cstub.c perfg_sstub.c perfg.h: perfg.idl
	$(IDL) $(IDLFLAGS) perfg.idl
