#
# makefile:
#       makefile for src directory and subdirectories.
#       For use with IBM NMAKE, which comes with the IBM compilers,
#       the Developer's Toolkit, and the DDK.
#
#       Called from:    main makefile.
#
#       This is only a management makefile. It neither compiles
#       nor links. The only purpose of this is to go thru
#       the subdirectories and invoke their makefiles in
#       turn with a proper target.
#
#   SUBTARGET is defined by the main makefile to be one of:
#
#       -- all: this will invoke "nmake all" on the subdirs.
#
#       -- dep: this will invoke "nmake dep" on the subdirs.
#

# Say hello to yourself.
!if [@echo +++++ Entering $(MAKEDIR)]
!endif

# store current directory so we can change back later
CURRENT_DIR = $(MAKEDIR)

# V0.9.13 (2001-06-27) [umoeller]
# Teemu, the wip stuff doesn't build here. If you want
# to build it, define WIPTARGET externally.
WIPTARGET =
!ifdef WPI_WIP
    WIPTARGET = wipengine wipengine\wiptest
!endif

# Subdirectories to run into. Mind the order;
# "base" creates the necessary libs and WPIRTL.DLL, which
# is required by wic and the others.
# Note also that before "src" gets called, the helpers
# have already be built by the main makefile.
SUBDIRS = libbz2 wiarchive base engine frontend stub wic wicpm $(WIPTARGET)
# wpi2exe  wiarchive2 wizilla net

# "all" gets called from ..\makefile when either
# "nmake all" or "nmake really_all" is running.
# In that case, SUBTARGET is "all" also so we
# run "nmake all" on the subdirs.
all: $(SUBDIRS)
    @echo ----- Leaving $(MAKEDIR)

# "dep" gets called from ..\makefile when
# "nmake dep" is running.
# In that case, SUBTARGET is "dep" also so we
# run "nmake dep" on the subdirs.
dep: $(SUBDIRS)
    @echo ----- Leaving $(MAKEDIR)

!ifdef RUNDEPONLY
SUBMAKESTRING = "NOINCLUDEDEPEND=1"
!endif

base:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

engine:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

frontend:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

libbz2:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wiarchive:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

stub:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wic:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wicpm:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wipengine:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wipengine\wiptest:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wpi2exe:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

#
# the following are currently not used
#

net:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wizilla:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)

wiarchive2:
    @echo $(MAKEDIR)\makefile: Going for subdir src\$@
    @cd $@
    @$(MAKE) -nologo $(SUBTARGET) $(SUBMAKESTRING) "MAINMAKERUNNING=YES"
    @cd $(CURRENT_DIR)


