# $Id: Makefile,v 1.15 1996/06/28 23:06:53 dhb Exp $
# $Log: Makefile,v $
# Revision 1.15  1996/06/28 23:06:53  dhb
# added yyless.o to OBJECTS macro: needed for systems without
# a lex library for yyless() and yywrap() functions
#
# Revision 1.14  1996/05/23  23:01:13  dhb
# t3d/e port
#
# Revision 1.13  1995/11/01  22:33:55  venkat
# Removed-install-target-dependencies
#
# Revision 1.12  1995/05/08  21:45:39  dhb
# Now removes y.tab.[ch] and lex.yy.c on make clean.
#
# Revision 1.11  1995/04/29  01:13:34  dhb
# Added use of YACC and LEX macros to control what program to use for
# the yacc and lex files.
#
# Revision 1.10  1995/02/13  23:00:22  dhb
# Removed RCSWcheckout of RCSRELEASE versions.
#
# Revision 1.9  1994/12/19  22:14:35  dhb
# Added dependency rules for RCS files under RCS directory.  These
# rules aren't suported by all makes, but were ignored by the only
# make (SGI) which didn't support % matching.  So hopefully, this
# won't break things when distributed.
#
# Revision 1.8  1993/09/17  18:41:28  dhb
# Added -D$(MACHINE) to CFLAGS macro.
# This is part of the Solaris comparability changes.  I don't know
# why this is necessary.
#
# Revision 1.7  1993/07/17  00:32:44  dhb
# Separate clean and rcsclean targets
#
# Revision 1.6  1993/07/01  16:38:44  dhb
# clean target was not keeping script.y and script.l chacked out.  Fixed.
#
# Revision 1.5  1993/07/01  15:55:06  dhb
# Added RCSRELEASE stuff
#
# Revision 1.4  1993/03/10  23:35:06  dhb
# Added script.y and script.l to the list of files to keep checked out from
# their respective rcs files.
#
# Revision 1.3  1993/02/12  17:30:24  dhb
# added freeze target to create rcs configurations
# added rcsclean to clean target
# both targets ensure .h .g Makefile and funcs files exist
#
# Revision 1.2  1992/12/11  19:59:07  dhb
# Added RCS check out rules
#
# Revision 1.1  1992/12/11  19:05:14  dhb
# Initial revision
#

# Makefile for 'ss' library (Script Language Interpreter)
# Altered by Michael D. Speight, 1991
CFLAGS = $(COPT) -D$(OS) $(DEC_HACK) -D$(MACHINE)
INSTALL_DIR =	$(INSTALL)

LIBBUILD	=	$(LD)
LIBBUILDFLAGS	=	-r -o
LIBORDER	=	echo no lib ordering needed for
LIBEXT		=	o
TARGET_OBJ	=	ss.$(LIBEXT)

OBJ = \
      eval.o \
      parse.o \
      script.o \
      strsave.o \
      symtab.o \
      yyless.o

default: $(TARGET_OBJ)


$(TARGET_OBJ): $(OBJ)
	$(LIBBUILD) $(LIBBUILDFLAGS) $(TARGET_OBJ) $(OBJ)
	$(LIBORDER) $(TARGET_OBJ)

eval.o: y.tab.h

script.o: y.tab.c lex.yy.c
	$(CC) -c $(CFLAGS) y.tab.c
	mv y.tab.o script.o

lex.yy.c: script.l
	$(LEX) script.l

y.tab.h y.tab.c: script.y
	$(YACC) -dv script.y

realclean:
	-(rm -rf *.a *.o y.tab.h y.tab.c lex.yy.c)

install:
	-(cp $(TARGET_OBJ) $(INSTALL_DIR)/lib)
	-($(LIBORDER) $(INSTALL_DIR)/lib/$(TARGET_OBJ))

clean:
	-(rm -rf *.a *.o y.tab.h y.tab.c lex.yy.c)


# mds3
# New line needed to prevent getting default rule if using cross compilers
.c.o:
	$(CC) $(CFLAGS) $(SIMINCLUDE) $< -c
