CAMACDIR = /home/rips/camac/
#REMOTEDIR = /home/exp/remote/ccnet/remote-camac/
OPT = -O2 -DDEBUG
DRIVER  = pcc

CC = gcc
FC = g77

LIBRARY = $(CAMACDIR)camac.o bshm.o ridf.o
#LIBRARY = $(REMOTEDIR)clientlib.c $(REMOTEDIR)message.c

PROGRAM = command  executer analyzer offline analyzer_client analyzer_server

CERNLIB = /cern/pro/lib
LIBF2C  = `g77 -print-file-name=libg2c.a`
ANALIB = -L$(CERNLIB) -lpacklib $(LIBF2C) -lnsl -lm

#all: $(PROGRAM)
all: bexecuter

command: command.c $(LIBRARY) $(CAMACDIR)pcc.h
	$(CC) $(OPT) -o command command.c $(LIBRARY) -I$(CAMACDIR)

executer: executer.c $(LIBRARY) $(CAMACDIR)pcc.h
	$(CC) $(OPT) -o executer executer.c $(LIBRARY) -I$(CAMACDIR)

bexecuter: bexecuter.c $(LIBRARY) $(CAMACDIR)pcc.h
	$(CC) $(OPT) -o bexecuter bexecuter.c $(LIBRARY) -I$(CAMACDIR)

analyzer: analyzer.o event1.o 
	$(CC) -o analyzer analyzer.c event1.o $(ANALIB)

offline: offline.o event1_off.o 
	$(CC) -o offline offline.c event1_off.o $(ANALIB)

analyzer_client: analyzer_client.o $(REMOTEDIR)message.c
	$(CC) -o analyzer_client analyzer_client.o $(REMOTEDIR)message.c

analyzer_server: analyzer_server.o $(REMOTEDIR)message.c event1.o
	$(CC) -o analyzer_server analyzer_server.o event1.o \
	$(REMOTEDIR)message.c $(ANALIB)

analyzer_server.o: analyzer_server.c
	$(CC) -c analyzer_server.c -D__ANANET__

analyzer_client.o: analyzer_client.c
	$(CC) -c analyzer_client.c -D__ANANET__

clean:
	rm -f *.o *~ core
	rm -f $(PROGRAM)

