# DO NOT MODIFY THIS MAKEFILE.
# It was generated automatically by fixmake
# from input file /net/freedom/work1/congen/linux/v2/support/src//diris/makefile.gen and writing to /net/freedom/work1/congen/linux/v2/support/src//diris/makefile.
#
# DIRIS Makefile. To be used with make.
#
# 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)

EXES = diris sphrgb

SOURCES = diris.flx display.c makefile makefile.gen sphere.inp sphrgb.c

IMGINCLUDEDIR = /usr/include/gl

IMGLIB = /usr/lib/libimage.a

all:	$(EXES)

install: $(EXES)
	for f in $(EXES) ; do \
	    $(INSTALL) -m 555 -c $${f} $(BIN) ; \
	done

diris:	diris.o display.o
	$(FC) diris.o display.o $(CGLIB)/congen.a -lgl \
	      -o diris $(LDFLAGS)

sphrgb: sphrgb.o
	-$(FC) sphrgb.o $(CGLIB)/congen.a $(IMGLIB) \
	       -o sphrgb $(LDFLAGS)

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

clean prepare:
	-rm -f $(EXES) core *.o *.fi *.fli *.f foo.* sphere.out

tovax: tovax.time

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

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

.DEFAULT :
	co $<

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

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



