\mshush\install.mak

MS-Hush Installation: install.mak

main target
    all : install
the next line is here just to suppress warnings from general.mak
    WIN32=1
includes
    !include resource.mak
    !include general.mak
now we'll just check if requirements are met
    !if !$d(HUSH)
    !error HUSH not defined
    !endif
    !if !$d(API)
    !error API not defined
    !endif
    !if !$d(TCLTK)
    !error TCLTK not defined
    !endif
    !if !$d(TOOLS)
    !error TOOLS not defined
    !endif
if SIM or EXAMPLES are defined, the corresponding installations will be activated
    !ifdef SIM
    INSTALL_SIM = install-sim
    !endif
    !ifdef EXAMPLES
    INSTALL_EXAMPLES = install-examples
    !endif
one can put the statement
outputredirect = > make.out
here to redirect the output of the make commands

Main Targets

    build:  build-api build-sim build-examples

    clean:  $(RM) $(RMTREE) clean-api clean-sim clean-examples delbatches

    unpack: unpack-api unpack-sim unpack-examples

    install: $(MKDIR) $(RM) install-api $(INSTALL_SIM) $(INSTALL_EXAMPLES)

Sub-targets

the next target will install the api into the hush directory
    install-api:
        $(MKDIR) $(HUSH)
        $(MKDIR) $(HUSH)\include
        $(MKDIR) $(HUSH)\lib
        $(MKDIR) $(HUSH)\dv
        cls
        echo *** install api ***
        echo *** checking directory structure ***
        echo *** install patches ***
        xcopy /s patches\src $(API)
        xcopy /s patches\include $(API)\include
        echo *** install library ***
        xcopy /s $(API)\dv $(HUSH)\dv   > nul
        echo *** install binaries ***
        xcopy /s lib $(HUSH)\lib        > nul
        echo *** install include files ***
        xcopy /s $(API)\include $(HUSH)\include > nul
the next target will call mswinsrc\hushlib.mak to build the library
    build-api:
        $(RM) $(HUSH)\lib\hush.lib
        cd mswinsrc
        echo *** build api ***
        -make -f hushlib.mak SRCDIR=$(API) MSHUSH=. OBJDIR=..\obj LIBDIR=$(HUSH)\lib lib $(outputredirect)
        cd ..
the next target will call sim\sim.mak to build the sim libraries
    build-sim:
    !ifdef SIM
        $(RM) $(HUSH)\lib\sim.lib
        $(RM) $(HUSH)\lib\asciisim.lib
        cd sim
        -make -f sim.mak LIBDIR=$(HUSH)\lib $(outputredirect)
        cd ..
    !endif
the next target will call sim\sim.mak to install sim in the hush directory
    install-sim:
        cd sim
        -make -f sim.mak install $(outputredirect)
        cd ..
the next target will call examples\examples.mak to install the examples in the hush\examples directory
    install-examples:
        cd examples
        -make -f examples.mak install $(outputredirect)
        cd ..
the next target will goto the examples directory and build all examples
    build-examples:
        echo *** build examples ***
        cd $(HUSH)\examples
        -build
the next target will call mswinsrc\hushlib.mak to clean the library object files
    clean-api:
        cd mswinsrc
        echo *** clean api ***
        -make -f hushlib.mak SRCDIR=$(API) MSHUSH=. OBJDIR=..\obj LIBDIR=$(HUSH)\lib clean
        cd ..
the next target will call sim\sim.mak to clean the library object files
    clean-sim:
        cd sim
        echo *** clean sim ***
        -make -f sim.mak clean
        cd ..
the next target will try to clean the example object files
    clean-examples:
        echo *** clean examples ***
        echo please do it yourself

the next target will unpack the api package
    unpack-api:
        cd ..
        unzip $(API_PACKAGE)
        cd $(MSHUSH)
the next target will unpack the examples package
    unpack-examples:
        $(MKDIR) $(EXAMPLES)
        cd $(EXAMPLES)
        unzip $(EXAMPLE_PACKAGE)
        cd $(MSHUSH)
the next target will unpack the sim package
    unpack-sim:
        cd ..
        unzip $(SIM_PACKAGE)
        cd $(MSHUSH)