# DO NOT MODIFY THIS MAKEFILE.
# It was generated automatically by fixmake
# from input file makefile.gen and writing to makefile.
#
# Makefile for Modular Yacc (myacc)
# This makefile derives from the the Berkeley Yacc makefile
# 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
SHELL = /bin/sh

SRCS=	closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \
	skeleton.c symtab.c verbose.c warshall.c

OBJS=   $(SRCS:.c=.o)

SOURCES = $(SRCS) makefile.gen descrip.mms defs.h myacc.1 README ACKNOWLEDGEMENTS \
	  NEW_FEATURES

all:	myacc myacc.man

install: all
	$(INSTALL) -c -m 555 myacc $(BIN)
	$(INSTALL) -c -m 444 myacc.man $(MAN)

prepare clean:
	rm -f *.o myacc core foo.* myacc.man

myacc:	$(OBJS)
	$(CC) -o myacc $(LDFLAGS) $(OBJS)

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

#
#	The commands in this section should be converted into a standalone
#	script for processing Berkeley nroff/troff documents.
#
myacc.man: myacc.1
	- ln -s $(CGD)/bsd/tmac.andoc tmac.andoc
	- ln -s $(CGD)/bsd/tmac.doc tmac.doc
	- ln -s $(CGD)/bsd/tmac.doc.old tmac.doc.old
	- ln -s $(CGD)/bsd/doc-ditroff tmac.doc-ditroff
	- ln -s $(CGD)/bsd/doc-nroff tmac.doc-nroff
	- ln -s $(CGD)/bsd/doc-common tmac.doc-common
	- ln -s $(CGD)/bsd/doc-syms tmac.doc-syms
	-nroff  tmac.andoc myacc.1 >myacc.man
	- rm -f tmac.andoc tmac.doc tmac.doc.old tmac.doc-ditroff tmac.doc-nroff tmac.doc-common tmac.doc-syms 

# Get all pieces into a shar file.
myacc.shar: all makefile $(SOURCES)
	( set +e; \
	  makes=`cd $(CG); /bin/ls *.make`; \
	  defdir=`pwd`; \
	  (cd $(CG); cp $$makes $$defdir); \
	  shar >myacc.shar \
	       $(SOURCES) makefile myacc.man $$makes ; \
	  rm -f $$makes )

# Get all pieces into a tar file.
myacc.tar: all makefile $(SOURCES)
	( set +e; \
	  makes=`cd $(CG); /bin/ls *.make`; \
	  defdir=`pwd`; \
	  (cd $(CG); cp $$makes $$defdir); \
	  tar cvf myacc.tar \
	       $(SOURCES) makefile myacc.man $$makes ; \
	  rm -f $$makes )

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

.DEFAULT:
	co $<
