Use GNU make to automate VbClassic builds.

	*For each project, create a makefile (see example below).
	*The primary target for the makefile is the DLL or EXE you're building.
	*Each module, class, form, etc. is a dependency for the target component.
	*Add component dependencies (from the References or Components dialog) by relative path references.
	*Write a master makefile one directory higher that calls each of the component makefiles in turn (use $(MAKE) -C <subdir>).

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 S''''''essionManager.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