Makefile For Vb Classic Build

last modified: February 6, 2009

Use GNU make to automate VbClassic builds.

Mmmm... that is a recursive Makefile, and some would argue that RecursiveMakeConsideredHarmful. The alternative is to include every component Makefile into the master Makefile (make sure you get the directories right, though).


A sample makefile for VisualBasic:

LOGFILE=vbcompile.log
BC=vb6 /out $(LOGFILE)
DLLFLAG=/makedll
DLLUN=regsvr32 /s /u /c

%.dll : %.vbp;
        @echo Compiling $@ ...
        @if exist $@ $(DLLUN) $@
        @$(BC) $(DLLFLAG) $<

fwSessionManager.dll: fwSessionManager.res modError.bas modFrameworkTypes.bas modGuid.bas modRegistry.bas modResource.bas modResSessionManager.bas modSqlFunc.bas SessionManager.cls ../IAuthUser/fwIAuthUser.tlb ../Datasource/fwDatasource.dll

../IAuthUser/fwIAuthUser.tlb:
        $(MAKE) -C ../IAuthUser

../Datasource/fwDatasource.dll:
        $(MAKE) -C ../Datasource

clean:
        @if exist fwSessionManager.dll $(DLLUN) fwSessionManager.dll
        -@del *.dll
        -@del *.exp
        -@del *.lib
        -@del $(LOGFILE)

I especially invite comments/advice from non-VBers on this topic. I found this way to simplify our VisualBasic builds with makefiles, but if I'm not applying the tool correctly, tell me. -- MattGarland


Would you want to unregister the DLLs before deleting them?

Something like...

foreach %%f in (*.DLL) do regsvr32 /u %f

(Not that I really remember how to do that in MS-DUNCE anymore. ;-)


Make? Yuch!!! Use Ant!

http://jakarta.apache.org/ant/index.html


Why not write a little program or script to obtain the dependencies for a given target from the project file?


CategoryVbClassic


Loading...