# A simple Makefile created by Scott Deifik scottd@amgen.com Jul-09-1996 to 
# create Bison 1.25 with Microsoft C/C++ 1.52 AKA MSC 8.00c.  This makefile 
# is intended to be used with dmake 3.8.
#
# 15-Jul-96 Darrel Hankerson <hankedr@mail.auburn.edu>
# Minor changes for building OS/2 and DOS version with MSC v6.

CC        = cl
LINKER    = link
O         = .obj

# names of parser files
PFILE = bison.sim
PFILE1 = bison.hai

PFILES = -DXPFILE=\"$(PFILE)\" -DXPFILE1=\"$(PFILE1)\"

CFLAGS = -AL -W3 -c
OPTIONAL_CFLAGS = -nologo

# options for MSC, producing a DOS-only exe
DEFINES = 
LDFLAGS = /STACK:30000 /NOE
BIND = 

# options for MSC v6, producing a bound OS/2 and DOS exe
#DEFINES = -D_MSDOS -DOS2
#LDFLAGS = /STACK:30000 /NOE /NOD:llibce llibcep, bison.def
#BIND = bind $@

OBJS =         \
    allocate$O \
    closure$O  \
    conflict$O \
    derives$O  \
    files$O    \
    getargs$O  \
    getopt$O   \
    getopt1$O  \
    gram$O     \
    lalr$O     \
    lex$O      \
    lr0$O      \
    main$O     \
    nullable$O \
    output$O   \
    print$O    \
    reader$O   \
    reduce$O   \
    symtab$O   \
    version$O  \
    warshall$O

.SUFFIXES : .exe $O .c

.c$O: 
	$(CC) $(DEFINES) $(INCLUDES) $(CFLAGS) $(OPTIONAL_CFLAGS) $<

all: bison.exe

# This file is different to pass the parser file names to the compiler.
# Note: This CC line is just about at DOS's brain-dead 128 char limit.  If
# you change this makefile, beware!
files$O: files.c
	$(CC) $(PFILES) $(DEFINES) $(INCLUDES) $(CFLAGS) $*.c

bison.exe: $(OBJS)
	$(LINKER) @$(mktmp $(OBJS:t"+\n") setargv$O, bison,, $(LDFLAGS);)
	$(BIND)

LR0$O: system.h machine.h new.h gram.h state.h
closure$O: system.h machine.h new.h gram.h
conflicts$O: system.h machine.h new.h files.h gram.h state.h
derives$O: system.h new.h types.h gram.h
files$O: system.h files.h new.h gram.h
getargs$O: system.h files.h
lalr$O: system.h machine.h types.h state.h new.h gram.h
lex$O: system.h files.h symtab.h lex.h
main$O: system.h machine.h
nullable$O: system.h types.h gram.h new.h
output$O: system.h machine.h new.h files.h gram.h state.h
print$O: system.h machine.h new.h files.h gram.h state.h
reader$O: system.h files.h new.h symtab.h lex.h gram.h
reduce$O: system.h machine.h files.h new.h gram.h
symtab$O: system.h new.h symtab.h gram.h
warshall$O: system.h machine.h

