#!/bin/sh

# MODEX make script for Windows PCs with Visual Studio C++ compiler
# also required: bison, lex, rm, mv, grep (cygwin/mks)
#
# Before compiling:
#	copy defaults.lut to a location of your choice
#	set the location of the defaults.lut file by
#		defining DEFAULT_LUT
#		(it is used in xtract.c and
#		 defaults to c:/cygwin/usr/local/share/defaults.lut)
#	set the location of the C preprocessor CPP_PATH
#	set the location of the install directory BINDIR
#	type make

bison -v -d gram.y
	mv gram_tab.c gram.c
	mv gram_tab.h gram.h

flex lexer.l
	mv lex.yy.c lexer.c

cl -nologo -DPC -o modex \
	modex.c xtract.c heap.c nmetab.c symtab.c \
	token.c tree.c treestk.c lexer.c gram.c dflow.c \
	prnttree.c modex_pp.c ps_graph.c

rm -f *.obj gram.output # lexer.c gram.c gram.h
# cygwin:
mv modex.exe /usr/bin
