# DO NOT MODIFY THIS MAKEFILE.
# It was generated automatically by fixmake
# from input file /net/freedom/work1/congen/linux/v2/support/src//peer/makefile.gen and writing to /net/freedom/work1/congen/linux/v2/support/src//peer/makefile.
#
# Makefile for various incarnations of peer
#
# 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 .f .h_proto

BIN = $(CGBIN)
MAN = $(CGD)/cat1

SOURCES = peer.c peer.1 peercg peercg.awk makefile

all:	peer

peer:	peer.o 
	$(FC) -o peer peer.o $(CGLIB)/congen.a -lsphere -lgl -lm $(LDFLAGS)

peer.o:	peer.c peer.h_proto
	cc -c -I$(CGS) $(CFLAGS) $(CPPFLAGS) peer.c

.c.h_proto:
	$(MKPROTO) -p -l 1 -i $*_h_proto $*.c >$*.h_proto.new
	cmp -s $*.h_proto.new $*.h_proto || /bin/mv -f $*.h_proto.new $*.h_proto
	-rm -f $*.h_proto.new

peer.pixie: peer
	pixie -o peer.pixie peer

install: peer peer.man peercg peercg.awk
	$(INSTALL) -m 555 -c peer $(BIN)
	$(INSTALL) -m 444 -c peer.man $(MAN)
	$(INSTALL) -m 444 -c peercg.awk $(BIN)
	$(INSTALL) -m 555 -c peercg $(BIN)

peer.man: peer.1
	tbl peer.1 | nroff -man >peer.man
	
prepare clean:
	- rm -f peer core *.BAK *.CKP peer.man *.o foo.* \
	        peer.pixie peer.Addrs peer.Counts peer.h_proto makefile

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

tovax: tovax.time

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

.DEFAULT:
	co $<


