###
### Makefile for mopac   Tripos Associates, December, 1988 
### 
### The following make targets are available....
###
###     all       --  figure out what machine from the local environment
###                   an execute the appropriate make.
###     iris4d    --  make mopac for the iris4d series of machines
###     sun4      --  make mopac for the sun4 series of machines
###	sun3	  --  make mopac for the sun3 series of machines
###
SHELL=/bin/sh
.IGNORE:
all:
	@test -x /bin/4d   && /bin/4d   && $(MAKE) iris4d; exit 0 
	@test -x /bin/sun4 && /bin/sun4 && $(MAKE) sun4;   exit 0 
	@test -x /bin/sun3 && /bin/sun3 && $(MAKE) sun3;   exit 0 
	
	@if [ -x mopac ] \
	;then echo mopac has been created in `pwd` \
	;else echo I do not know how to make mopac on this type of machine \
	;fi
install:
	$(MAKE) all
	cp mopac $(TA_ROOT)/bin/mopac

clean:
	rm -f *.o mopac

iris4d:
	f77 -O2 -Olimit 1024 -G 8 -static *.f -o mopac

sun4:
	for i in *.f \
		; do cp $$i `basename $$i .f`.F \
                ; f77 -O -c `basename $$i .f`.F \
	; done 
	f77 -O *.o -o mopac
	rm -f *.F
sun3:
	for i in *.f \
		; do cp $$i `basename $$i .f`.F \
                ; f77 -O -fswitch -c `basename $$i .f`.F \
	; done 
	f77 -O -fswitch *.o -o mopac
	rm -f *.F

