#
# makefile for emx html
#

SRC=/emx/src/doc/
HHC="\\WinApp\\HTML Help Workshop\\hhc.exe"

default: html chm

html: emxrt.htm emxdev.htm emxlib.htm emxgnu.htm emxbsd.htm

emxrt.htm:      $(SRC)emxrt.src
        emxdoc -H -iiso8859-1 -o emxrt.htm $(SRC)emxrt.src

emxdev.htm:     $(SRC)emxdev.src emxbook.dir
        emxdoc -H -iiso8859-1 -n1000 -o emxdev.htm -x emxbook.dir $(SRC)emxdev.src

emxgnu.htm:     $(SRC)emxgnu.src emxbook.dir
        emxdoc -H -iiso8859-1 -n2000 -o emxgnu.htm -x emxbook.dir $(SRC)emxgnu.src

emxbsd.htm:     $(SRC)emxbsd.src emxbook.dir
        emxdoc -H -iiso8859-1 -n3000 -o emxbsd.htm -x emxbook.dir $(SRC)emxbsd.src

emxlib.htm:     $(SRC)emxlib.src emxbook.dir
        emxdoc -H -iiso8859-1 -n1 -o emxlib.htm -x emxbook.dir $(SRC)emxlib.src

emxbook.dir:    st-dir
st-dir:         emxdev.dir emxgnu.dir emxbsd.dir emxlib.dir
        emxdoc -Mo tmp emxdev.dir emxgnu.dir emxbsd.dir emxlib.dir
        updt tmp emxbook.dir
        del tmp
        touch st-dir

emxdev.dir:     $(SRC)emxdev.src
        emxdoc -Ig -icp850 -n1000 -o emxdev.dir $(SRC)emxdev.src

emxgnu.dir:     $(SRC)emxgnu.src
        emxdoc -Ig -iiso8859-1 -n2000 -o emxgnu.dir $(SRC)emxgnu.src

emxbsd.dir:     $(SRC)emxbsd.src
        emxdoc -Ig -iiso8859-1 -n3000 -o emxbsd.dir $(SRC)emxbsd.src

emxlib.dir:     $(SRC)emxlib.src
        emxdoc -Ig -icp850 -n1 -o emxlib.dir $(SRC)emxlib.src


chm:  emxrt.chm emxdev.chm emxlib.chm \
    emxgnu.chm emxbsd.chm

emxrt.chm: emxrt.htm
        splithtm emxrt.htm
        -$(HHC) emxrt.hhp

emxdev.chm: emxdev.htm
        splithtm emxdev.htm
        -$(HHC) emxdev.hhp

emxgnu.chm: emxgnu.htm
        splithtm emxgnu.htm
        -$(HHC) emxgnu.hhp

emxbsd.chm: emxbsd.htm
        splithtm emxbsd.htm
        -$(HHC) emxbsd.hhp

emxlib.chm: emxlib.htm
        splithtm emxlib.htm
        -$(HHC) emxlib.hhp

clean:
        -del *.dir
        -del *.htm
        -del st-dir
        -del *.hhc
        -del *.hhk
        -del *.hhp
