# DO NOT MODIFY THIS MAKEFILE.
# It was generated automatically by fixmake
# from input file makefile.gen and writing to makefile.
#
# Makefile for cmploop
#
#   Copyright (c) 1987 Robert E. Bruccoleri
#   All Rights Reserved
#
#   Copyright (c) 1990 Bristol-Myers Squibb Company
#   All Rights Reserved
#
#   This program is available under a license from the
#   Bristol-Myers Squibb Pharmaceutical Research Institute.
#   Please contact Dr. Robert E. Bruccoleri at the
#   Bristol-Myers Squibb Pharmaceutical Research Institute,
#   P. O. Box 4000, Princeton, NJ 08543-4000 for more information.
#
# Makefile macros for a Linux machine running gfortran and gcc.

# Flags -- note that common flags go on the binary definitions

CFLAGS        = -g
COPTFLAGS     = -g -O2 
CSPECOPTFLAGS = -g -O0
CPPFLAGS      = -DLANGUAGE_C -Dlinux -Dunix
FFLAGS        = -g
FOPTFLAGS     = -g -O2 
FSPECOPTFLAGS = -g -O0
FCPPFLAGS     = -Dlinux -Dunix 
ARFLAGS       = qs
LDFLAGS       = 
MAXPROCS      = 20

# Binaries

CC            = gcc44 -ffloat-store -pthread
CPP	      = gcc44 -E
FC            = gfortran44 -std=gnu -fno-second-underscore -fno-f2c -ffloat-store -pthread -fdump-core -fbacktrace 
FLECS         = $(CGBIN)/flecs
FCPP          = $(CGBIN)/fcpp -F
YACC          = $(CGBIN)/myacc
LEX           = flex
INSTALL	      = $(CGBIN)/install
MKPROTO	      = $(CGBIN)/mkproto
SHELL	      = /bin/sh

.SUFFIXES :			# Roll our own below.
.SUFFIXES : .o .c .flx

BIN = $(CGBIN)

FOBJS = cmploop.o

COBJS = cmploopc.o 

OBJS = $(FOBJS) $(COBJS) wrappers_c.o

FLXSRCS = $(FOBJS:.o=.flx)

CSRCS = $(COBJS:.o=.c)

SOURCES = $(FLXSRCS) $(CSRCS) makefile.gen makefile descrip.mms wrap_cdef.proto

all cmploop :	$(OBJS)
	$(FC) $(OBJS) -o cmploop $(CGLIB)congen.a $(LDFLAGS)

install:	cmploop
	$(INSTALL) -m 555 -c cmploop $(BIN)

wrappers_c.c: wrappers_f.h 

wrappers_f.h: wrap_cdef.proto $(CGS)wrappers_f.h
	wrapgen -c -i wrap_cdef.proto -h wrappers_f.h -o wrappers_c.c
	cat $(CGS)wrappers_f.h >>wrappers_f.h

cmploop.o: wrappers_f.h

clean prepare:
	- rm -f cmploop *.f *.fi *.fli *.o *.BAK wrappers_?.? core

.c.o:
	$(CC) -c $(CFLAGS) $(CPPFLAGS) -I$(CGS) $*.c

.flx.o:
	$(FCPP) $(FCPPFLAGS) -I$(CGS) $*.flx $*.fi
	$(FLECS)  $*.fi
	$(FC) -c $(FFLAGS) $*.f

tovax: tovax.time

tovax.time: $(SOURCES) 
	cp $? dino
	(cd dino/; chmod u+w $?)
	touch tovax.time

.DEFAULT:
	co $<

depend:
	cp makefile.gen makefile.gen.BAK
	mkdepend -c "cc -M -I$(CGS) -cckr" \
		 -e 's/olx/o/g' \
		 -e '/\/usr\/include/d' \
	         -e 's:$(CGS):../../../source:g' \
		 -e 's/.\///' \
		 makefile.gen \
		 $(FLXSRCS) $(CSRCS)
	$(MAKE) makefile

makefile: makefile.gen $(CG)/$(CGPLATFORM).make
	$(CGBIN)/fixmake $(CG)/$(CGPLATFORM) makefile.gen makefile

# DO NOT DELETE THIS LINE -- make depend uses it
cmploop.o: ../../../source/aaalimits.fcm ../../../source/config.h \
	 ../../../source/constants.fcm ../../../source/coord.fcm \
	 ../../../source/psf.fcm ../../../source/stack.fcm cmploop.flx \
	 wrappers_f.h
cmploopc.o: ../../../source/config.h  ../../../source/constants.h  \
	 ../../../source/macros.h  cmploopc.c 
# DO NOT DELETE THIS 2nd LINE -- make depend uses it
