\mshush\mswinsrc\hushlib.mak

Hush Libray Makefile

Running this makefile will rebuild the Hush library for MS-Windows

Main target
    all : lib
Target platform
    WIN32=1
Global definitions
    !include resource.mak
Local definitions
    HUSHLIB=$(LIBDIR)\hush.lib
    HUSHLIBCONFIG = $(MSHUSH)\hushlib.cfg

Targets


The library itself:
- create the configuration files
- build the resource file
- show a message to say it's doing something
- build the library
- clean the configuration files
    lib:    $(HUSHLIBCONFIG)       \
            $(LIBDIR)\hush.res     \
            msgcompilelib          \
            $(HUSHLIB)             \
            cleancfg
        echo *** Library Passed Examination ***
How to do some cleanup:
    clean: cleanconfig delobjs delbatches

    delobjs: $(RM)
        echo *** cleaning api object files ***
        $(RM) *.o

    cleanconfig: $(RM)
        $(RM) $(HUSHLIBCONFIG)

    cleancfg: $(RM)
        echo *** Removing configuration files ***
        rem $(RM) bcc32.cfg
        rem $(RM) $(HUSHLIBCONFIG)
Display a message
    msgcompilelib:
        echo *** Checking Library Components ***

Hush Library dependencies
    !include widgets.mk
    !include hush.mk
    !include src.mk
    !include mswin.mk

    HUSHLIBOBJS =       \
        $(WIDGETOBJS)   \
        $(HUSHOBJS)     \
        $(SRC)          \
        $(MSWINOBJS)

    $(HUSHLIB) : $(HUSHLIBOBJS)
            echo *** Building Library $(HUSHLIB) ***
            @echo $(WARNING) building $<
            &$(LIBRARIAN) $(HUSHLIB) {-+$** }
            $(RM) $(HUSH)\lib\*.bak
Implicit rules
    .suffixes: .c .o .cpp

    .c.o:
        @echo $(WARNING) compiling $<
        $(CCWIN32) -o$&.o +$(HUSHLIBCONFIG) $<

    .cpp.o:
        @echo $(WARNING) compiling $<
        $(CCWIN32) -o$&.o +$(HUSHLIBCONFIG) $<

    .rc.res:
        echo *** Builing Resources ***
    !if $d(FROM_IDE)
        @echo $(WARNING) compiling $<
    !endif
        $(RC)  @&&|
    $(RCFLAGS32)
    -I$(INCLUDES)
    $(RCRESONLY)
    -FO$@
    | $<
Configuration file for complier and librarian
    $(HUSHLIBCONFIG): $(MKDIR)
        echo *** Setting Compiler Options ***
        $(CP) &&|
    -D$(DEFINES)
    -D$(SCRIPTPATHDEFS)
    -I$(HUSHLIBINCLUDES)
    $(CCWIN32FLAGS)
    | $(HUSHLIBCONFIG) >NUL