#
# Make file for ipdisp
#
#  this program is split in 3 parts
#	(a) ipdisp.f    program
#	(b) dskio.c     some io routines
#
# The following pack routines are assumed to be the ccp4 library so are not
# compiled here
#	(c) pack_c.c    routines for compressing/uncompressing packed
#                       images (J-P. Abrahams)
#       (d) pack_f.f    Fortran interface routines for pack_c
#
# Compilation
FCOMP = f77
FLINK = f77
CCOMP = cc -DPROTOTYPE -w
XDL_LIB  = $(CCP4_LIB)/libxdl_view.a
CCP4LIB = $(CCP4_LIB)/libccp4.a
LIBS  = $(CCP4LIB) $(XDL_LIB)  -lXt -lX11 
BIN   = $(CBIN)
INSTALL = /usr/bin/installbsd -c

ipdisp_objects = ipdisp.o dskio.o pck.o

ipdisp.exe:   $(CCP4LIB)(pack_c.o) $(CCP4LIB)(pack_f.o) $(ipdisp_objects)
	$(FLINK) -o ipdisp.exe $(ipdisp_objects) $(LIBS)

$(CCP4LIB)(pack_c.o) $(CCP4LIB)(pack_f.o):
	@echo 'You need to make mosflm-bits in the library for the image-packing stuff'
	exit 1

install: ipdisp.exe
	$(INSTALL) ipdisp.exe $(BIN)

ipdisp.f: dsplyc.h mxdinc.h mxdkbb.h spdpar.h dsdinc.h
 
.f.o:
	$(FCOMP) -c $<

.c.o:
	$(CCOMP) -O -c $<

clean:
	-rm -f *.o ipdisp.exe
