NI Provides the "NI LabVIEW Command Line Interface" to support building LabVIEW Build Specs through a command line. This a free add on to LabVIEW that can be downloaded from ni.com. So you would just install this add on, as well as LabVIEW itself.
There are other third party tools as well like the "G CLI" Toolkit for LabVIEW that does similar things as the NI one. (Downloaded through VIPM).
I prefer the NI one, as it's faster in my testing and I have to go through less hoops with IT since it's part of the NI install, but they each work.
If using the NI LabVIEW CLI, you would just do something in the command line like:
"LabVIEWCLI -OperationName ExecuteBuildSpec -ProjectPath "%folder%\HAL\DeviceCfg\DeviceCfg\DeviceCfg.lvproj" -LabVIEWPath "%EXE%" -PortNumber %Port% "
And that would build any dll's, exe's, lvlibp's that are part of the Projects build specs. (Note in my example I'm using variables because I pulled this from one of our batch files, so you would replace those with actual values in yours).