# Win32 Makefile for dynamic library interface to Thomas Boutell's gd image package

# The runtime system must be compiled with support for dynamic libraries.
# Thomas Boutell's gd image package must be installed.

# Where to find gd header file and compiled library

GDDIR=w32gd

#CC=cl
#OPTS= /nologo /Za /LD /MT /W1 /GB /O2 /Oy- /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS"
#OPTS= /nologo /Za /LD /MTd /W1 /GB /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS"

!include ..\..\Makedefs.w32

#CFLAGS= -Dunix $(OPTS) /I ..\..\runtime /I $(GDHDIR)
#LIBS= $(GDDIR)\libgd.lib ..\..\runtime\camlrt.lib

MOSMLTOOLS=camlrunm $(MOSMLHOME)\tools
MOSMLC=mosmlc -c
MOSMLL=mosmlc
MOSMLLEX=mosmllex
MOSMLYACC=mosmlyac

all: libmgd.so Graphs.uo
    @echo
    @echo "Now type  nmake install "

libmgd.so:
    cd $(GDDIR)
    nmake -f libmgd.mak CFG="libmgd - Win32 Release"
    cd $(MOSMLHOME)\src\dynlibs\mgd

test:
	mosml testgdimage.sml

install:
	copy /b libmgd.so $(BINDIR)\libmgd.so
	@echo
	@echo "Then execute  mosml testgdimage.sml"

clean:
    cd $(GDDIR)
    nmake -f libmgd.mak CFG="libmgd - Win32 Release" CLEAN
    cd $(MOSMLHOME)\src\dynlibs\mgd
    -del *.obj
    -del *.so
    -del *.exp
    -del *.lib
    -del *.ui
    -del *.uo
    -del *.png

.sig.ui:
    $(MOSMLC) $<

.sml.uo:
    $(MOSMLC) $<

depend: 
    del Makefile.bak
    copy Makefile Makefile.bak
    $(MOSMLTOOLS)\cutdeps < Makefile.bak > Makefile
    $(MOSMLTOOLS)\mosmldep >> Makefile

### EVERYTHING THAT GOES BEYOND THIS COMMENT WILL BE ERASED WITHOUT WARNING
### DO NOT DELETE THIS LINE
