#
# Makefile for MIT profile DB programs
#

KRB5    = /afs/net/project/krb5
PROFILE = ../common
#PROFILE = /mit/krb5/build/build/util/profile
#KRB5	= /pkg/krb5
#PROFILE = $(KRB5)
ECATCOM	= ../common

SHELL	= bash
CC	= gcc
#CC	= cc

# uncomment the following for Solaris threads
THRCPP=-DSOLARIS_THREADS
THRLIB=-lthread

# uncomment the following for Posix threads
#THRCPP=-DPOSIX_THREADS
#THRLIB=-lpthread

# uncomment the following for fork (and no threads)
#THRCPP=-DNO_THREADS
#THRLIB=

CPPFLAGS= $(THRCPP) -I$(ECATCOM) \
	-I$(KRB5)/include
CFLAGS	= -O
#CFLAGS	= -g
LDFLAGS	=
LOADLIBES=
LDLIBS	= -L$(KRB5)/lib -L$(PROFILE) -lprofile -lcom_err \
	-L/mit/gnu/lib -lgdbm -lsocket $(THRLIB) -lnsl

%.ps: %.c
	psf -1 -E -h -x -c80 -l66 $< >$@

TARGETS	= profiled
SRC	= profiled.c
OBJ	= $(SRC:.c=.o) thr.o

all:	$(TARGETS)

clean:
	- rm -f *.o $(TARGETS)

$(TARGETS): $(OBJ)

thr.o:	$(ECATCOM)/thr.c
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $?
