#######################################################################
##                             Copyright (C) 1999                    ##
##              Keldysh Institute of Appllied Mathematics            ##
#######################################################################

# dvm/fdvm/parser/makefile.win

#	HDR	traditional header files.
#	HDRg	header files generated by programs.
#	SRC	traditional  source files.
#	SRCg	source files generated by programs.
#	OBJS	object files required to load the program.
#

OUTDIR = ..\obj
BINDIR = ..\..\bin
LIBDIR = ..\lib

SAGEROOT =../Sage
LIBINCLUDE = $(SAGEROOT)/lib/include
HINCLUDE = $(SAGEROOT)/h
FDVMINCL = ../include
EXECUTABLES =	parse

INCL = -I. -I$(FDVMINCL) -I$(LIBINCLUDE) -I$(HINCLUDE) 
TOOLBOX_HDR =  $(LIBINCLUDE)/macro.h $(LIBINCLUDE)/bif_node.def  $(LIBINCLUDE)/type.def  $(LIBINCLUDE)/symb.def 
FDVM =  $(DVMINCLUDE)/dvm_tag.h
# -w don't issue warning now.
#CFLAGS=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" \
#  	/D "YYDEBUG" /D "MSDOS" /D "SYS5" /D "WIN" $(INCL) \
#	/Fp"$(OUTDIR)/newsrc.pch" /YX /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c 
CFLAGS=/nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" \
  	/D "YYDEBUG" /D "MSDOS" /D "SYS5" /D "WIN" $(INCL) \
	/Fp"$(OUTDIR)/newsrc.pch" /Fo"$(OUTDIR)/" /Fd"$(OUTDIR)/" /c 



.c{$(OUTDIR)/}.obj:
    echo $(CC) $(CFLAGS) $<
    $(CC) $(CFLAGS) $<

$(OUTDIR)/gram1.tab.obj:	gram1.tab.c
	$(CC) $(CFLAGS) /D "YYDEBUG" -c gram1.tab.c

LINK=$(LINKER)
 
LINK_FLAGS=/nologo /subsystem:console /incremental:no\
 /pdb:"$(OUTDIR)\$(EXECUTABLES).pdb" /out:"$(BINDIR)\$(EXECUTABLES).exe" 

LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
 advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
 odbccp32.lib /nologo /subsystem:console /incremental:no\
 /pdb:"$(OUTDIR)\$(EXECUTABLES).pdb" /out:"$(BINDIR)\$(EXECUTABLES).exe" 


LIBS = $(LIBDIR)/libdb.lib 

HDR	= $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h  \
      $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h  \
	  $(DVMINCLUDE)/extern.h $(HINCLUDE)/sets.h tag tokens

HDRg	= tag.h tokdefs.h

HDRS	= $(HDR) $(HDRg)
# !!
SRC	= cftn.c init.c hash.c lexfdvm.c lists.c\
	  misc.c stat.c  errors.c types.c sym.c low_hpf.c unparse_hpf.c
#!!
SRCg	= gram.tab.c

SRCS	= $(SRC) $(SRCg)
#!! 
OBJS	= $(OUTDIR)/cftn.obj $(OUTDIR)/errors.obj $(OUTDIR)/hash.obj $(OUTDIR)/init.obj \
	$(OUTDIR)/lexfdvm.obj $(OUTDIR)/lists.obj $(OUTDIR)/misc.obj $(OUTDIR)/stat.obj \
	$(OUTDIR)/types.obj $(OUTDIR)/gram1.tab.obj $(OUTDIR)/sym.obj \
	$(OUTDIR)/low_hpf.obj $(OUTDIR)/unparse_hpf.obj


$(BINDIR)/$(EXECUTABLES).exe: $(OBJS)
	$(LINK) @<<
	$(LINK_FLAGS) $(OBJS) $(LIBS)
<<

all: $(BINDIR)/$(EXECUTABLES).exe
    @echo "*** COMPILING EXECUTABLE $(EXECUTABLES) DONE"

clean:

cleanall:

# ***********************************************************

###
cftn.obj: $(HINCLUDE)/db.h $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/bif.h \
	$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
ftn.gram: $(DVMINCLUDE)/extern.h $(HINCLUDE)/defines.h $(HINCLUDE)/defs.h \
        $(DVMINCLUDE)/fdvm.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
	$(HINCLUDE)/sets.h
commsym.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
	$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
	$(HINCLUDE)/sets.h
errors.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h  $(DVMINCLUDE)/extern.h \
	$(HINCLUDE)/db.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h
exec.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag
gram.obj: $(HINCLUDE)/defs.h \
	$(HINCLUDE)/tag $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h \
	$(HINCLUDE)/sets.h  $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/defines.h 
hash.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h \
	$(HINCLUDE)/db.h $(HINCLUDE)/bif.h  $(HINCLUDE)/ll.h $(HINCLUDE)/sets.h $(HINCLUDE)/tag
init.obj:  $(DVMINCLUDE)/inc.h $(HINCLUDE)/defs.h $(HINCLUDE)/bif.h  $(HINCLUDE)/defines.h \
	$(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h $(HINCLUDE)/db.h $(HINCLUDE)/tag
# !!
lexfdvm.obj: $(DVMINCLUDE)/extern.h
lists.obj:$(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/bif.h
misc.obj: $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/defines.h $(HINCLUDE)/db.h \
	$(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h $(HINCLUDE)/sets.h
stat.obj:	$(HINCLUDE)/defs.h $(HINCLUDE)/bif.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h\
        $(HINCLUDE)/sets.h $(HINCLUDE)/defines.h $(DVMINCLUDE)/extern.h
sym.obj:  $(HINCLUDE)/defs.h $(HINCLUDE)/tag $(HINCLUDE)/symb.h $(HINCLUDE)/defines.h \
	$(HINCLUDE)/bif.h $(DVMINCLUDE)/extern.h $(HINCLUDE)/db.h $(HINCLUDE)/ll.h \
	$(HINCLUDE)/sets.h $(DVMINCLUDE)/fdvm.h
types.obj:$(HINCLUDE)/defs.h $(HINCLUDE)/ll.h $(HINCLUDE)/symb.h
low_hpf.obj: $(FDVM) $(TOOLBOX_HDR)         
unparse_hpf.obj:  $(FDVM) $(TOOLBOX_HDR) $(DVMINCLUDE)/unparse.hpf





