# $Id: Makefile,v 1.7 1993/07/17 00:32:44 dhb Exp $
# $Log: Makefile,v $
# 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)
INSTALL_DIR =	$(INSTALL)
OBJ = \
      eval.o \
      parse.o \
      script.o \
      strsave.o \
      symtab.o

default: ss.o

.SUFFIXES: .c,v .c .h,v .h

.h,v.h:
	co -r$(RCSRELEASE) $*.h

.c,v.o:
	co -r$(RCSRELEASE) $*.c
	cc -c $(CFLAGS) $(SIMINCLUDE) $*.c
	rm -f $*.c

ss.o: $(OBJ)
	$(LD) -r $(OBJ) -o ss.o

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 *.o y.tab.h y.tab.c lex.yy.c)

install: ss.o
	-(cp ss.o $(INSTALL_DIR)/lib)

freeze:
	rcsclean
	rcsfreeze $(VERSION)
	co Makefile *.h,v script.y script.l

clean:
	-(rm -rf *.o)

rcsclean: clean
	- rcsclean
	co -r$(RCSRELEASE) Makefile *.h,v script.y script.l

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