########                    Definitions

#OPT = -O2 -static -DARCPC -Df2cFortran
OPT = -g -DARCPC -Df2cFortran

PROGRAM = grb

GROCODE  = offline/include
GROLIB   = offline/lib
CERNINC  = software/cern/2000/include/cfortran
CERNLIB  = software/cern/2000/lib

RECONGRO_OBJS = main.opc grb_finder_init.opc grb_finder.opc pois.opc grb_finder_evaldata_bins.opc grb_finder_evaldata_table.opc grb_finder_util.opc grb_finder_publish.opc grb_finder_backmap.opc j2c.opc grb_finder_fileopen.opc grb_finder_logger.opc checkEvent.opc

########			Unix compile and link

COMPILE = cc $(OPT) -c $*.c -o $*.opc -I$(CERNINC) -I$(GROCODE)    

LINK_RECONGRO = cc $(OPT) -dm -o $(PROGRAM) $(RECONGRO_OBJS) -L$(CERNLIB) \
	-L$(GROLIB) -lpacklib -loffline_pc -lg2c -lm -lnsl -lz

########                     Targets

$(PROGRAM): $(RECONGRO_OBJS)
	$(LINK_RECONGRO)

########                 Default Rules

.SUFFIXES:
.SUFFIXES: .c .opc

.c.opc:; $(COMPILE)


########                 Dependencies

main.opc:                       main.c                       grb.h $(GROLIB) makefile
grb_finder_init.opc:            grb_finder_init.c            grb.h $(GROLIB) makefile
grb_finder.opc:                 grb_finder.c                 grb.h $(GROLIB) makefile
init_grb.opc:                   init_grb.c                   grb.h $(GROLIB) makefile
grb_finder_evaldata_bins.opc:   grb_finder_evaldata_bins.c   grb.h $(GROLIB) makefile
grb_finder_evaldata_table.opc:  grb_finder_evaldata_table.c  grb.h $(GROLIB) makefile
grb_finder_backmap.opc:         grb_finder_backmap.c         grb.h $(GROLIB) makefile
grb_finder_util.opc:            grb_finder_util.c            grb.h $(GROLIB) makefile
grb_finder_publish.opc:         grb_finder_publish.c         grb.h $(GROLIB) makefile
pois.opc:                       pois.c                                       makefile
j2c.opc:                        j2c.c                                        makefile
grb_finder_fileopen.opc:        grb_finder_fileopen.c        grb.h $(GROLIB) makefile
grb_finder_logger.opc:          grb_finder_logger.c          grb.h $(GROLIB) makefile
checkEvent.opc:                 checkEvent.c                 grb.h $(GROLIB) makefile


