sl@0: # makefile to replace BLD.CMD
sl@0: #
sl@0: # Full syntax:
sl@0: #    plat is wins,marm
sl@0: #    cfg is rel,deb,urel,udeb,clean
sl@0: #    target is component to build
sl@0: #
sl@0: 
sl@0: !if "$(PLAT)" == "marm"
sl@0: TARGETS=edbms edbsrv
sl@0: !else
sl@0: TARGETS=edbms
sl@0: !endif
sl@0: 
sl@0: MAKE_DIR=\epoc32\make\$(PLAT)
sl@0: 
sl@0: MAKE=nmake -nologo
sl@0: MAKMAKE=makmake
sl@0: MAKCLEAN=makmake -clean
sl@0: 
sl@0: !if "$(PLAT)" == "marm"
sl@0: CPP_FLAG=-Wno-non-virtual-dtor
sl@0: !endif
sl@0: 
sl@0: all: $(TARGETS)
sl@0: 
sl@0: $(TARGETS):
sl@0: !if "$(PLAT)" == "ide"
sl@0: # build the IDE makfile in the current directory
sl@0: #
sl@0:     $(MAKMAKE) -d $(*B) $(CFG)
sl@0: !else if "$(CFG)" == "clean"
sl@0: # use Makmake's clean verb to delete all generated files
sl@0: #
sl@0:     $(MAKCLEAN) -d $(*B) $(PLAT)
sl@0:     @if exist $(MAKE_DIR)\$(*B).$(PLAT) erase $(MAKE_DIR)\$(*B).$(PLAT)
sl@0: !else
sl@0: 	@$(MAKE) -c $(MAKE_DIR)\$(*B).$(PLAT)
sl@0: 	$(MAKE) -kcs -f$(MAKE_DIR)\$(*B).$(PLAT) $(CFG) USERDEFS=$(CPP_FLAG) 1>$(*B).$(PLAT).$(CFG).log 2>&1
sl@0: !endif
sl@0: 
sl@0: .SUFFIXES: .$(PLAT) .mmp
sl@0: 
sl@0: .mmp{$(MAKE_DIR)}.$(PLAT):
sl@0: 	$(MAKMAKE) -d $(*B) $(PLAT)
sl@0: 
sl@0: wins:
sl@0:     @$(MAKE) plat=wins cfg=urel
sl@0:     @$(MAKE) plat=wins cfg=udeb
sl@0: 
sl@0: marm:
sl@0:     @$(MAKE) plat=marm cfg=urel
sl@0:     @$(MAKE) plat=marm cfg=udeb
sl@0: 
sl@0: clean:
sl@0:     @$(MAKE) plat=wins cfg=clean
sl@0: 	@$(MAKE) plat=marm cfg=clean