HMG 3.3.0 - Grid
Posted: Thu Jun 12, 2014 3:32 am
Which is the final build.bat ? of the previous post or of this post http://hmgforum.com/viewtopic.php?p=28074#p28074Pablo César wrote:In this case, the main Build.bat should no takeplace for compiling. So I propose to change main at C:\hmg.3.3.0\Build.bat as follows:Pablo César wrote:Que sugieres como hacerlo ? Hay que tomar en cuenta que pueden haber vários demos, varios prgs en la misma carpeta...danielmaximiliano wrote:el build necesita correccion, al faltar el archivo .hbp al hacer doble click sobre build.bat se genera un .exe sin nombre.
See at first line of PROCESS PARAMETERS. This Build.bat is also prepared to build for long names for hbp or prg files names.@echo off
rem *******************************************************************************
rem SYNTAX
rem *******************************************************************************
rem build [ /n ] [ /d ] [ /c ] <program.prg> | <project.hbp> [<hbmk2 params>]
rem
rem /n no run after build
rem /d enabled debugger
rem /c console mode
rem
rem
rem This batch file passes information to hbmk2 to make possible an easy (zero
rem configuration build of HMG applications).
rem
rem You can achieve a customized build passing parameters directly to hbmk2.
rem Please, take a look at hbmk2 help:
rem
rem hbmk2 --help
rem *******************************************************************************
rem SET DEFAULT OPTIONS
rem *******************************************************************************
set gtdrivers=-gtgui -gtwin
set runafterbuild=.t.
set debug=
rem ******************************************************************************
rem DELETE FILES FROM PREVIOUS BUILD
rem ******************************************************************************
if exist build.log del build.log
if exist error.log del error.log
if exist init.cld del init.cld
rem ******************************************************************************
rem SET HMGPATH
rem ******************************************************************************
rem
rem Using %~dp0 the HMGPATH is automatically set to current (hmg) folder making it
rem portable (zero config)
SET HMGPATH=%~dp0
rem ******************************************************************************
rem SET BINARIES PATHS
rem ******************************************************************************
SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
rem *******************************************************************************
rem PROCESS PARAMETERS
rem *******************************************************************************
rem
rem /n no run after build
rem /d enabled debugger
rem /c console mode
rem
if "%1"=="" goto End
if [%1]==[/n] set runafterbuild=.f.
if [%1]==[/n] shift
if [%1]==[/d] set gtdrivers=-gtwin -gtgui
if [%1]==[/d] set debug=-b
if [%1]==[/d] echo options norunatstartup > init.cld
if [%1]==[/d] shift
if [%1]==[/c] set gtdrivers=-gtwin -gtgui
if [%1]==[/c] shift
rem ******************************************************************************
rem COMPILE RESOURCES
rem ******************************************************************************
echo #define HMGRPATH %HmgPath%\RESOURCES > _hmg_resconfig.h
COPY /b %HMGPATH%\resources\hmg.rc+"%~n1.rc"+%HMGPATH%\resources\filler _temp.rc >NUL
windres -i _temp.rc -o _temp.o >windres.log 2>&1
rem *******************************************************************************
rem SET PROJECT OUTPUT FILE NAME
rem *******************************************************************************
rem
rem The first parameter sent to hbmk2 is -o%~n1.exe. I've added to it create the
rem application with the project basename (<projectname.hbp> specified by the user.
rem *******************************************************************************
rem SET DEFAULT CONFIGURATION FILE
rem *******************************************************************************
rem
rem The second parameter sent to hbmk2 is the hmg.hbc script to set config required.
rem *******************************************************************************
rem SET QUIET MODE
rem *******************************************************************************
rem
rem The third parameter sent to hbmk2 is -q (Harbour quiet mode)
rem ******************************************************************************
rem CALL HBMK2
rem ******************************************************************************
rem HBMK2 -mt -o%~n1.exe %HMGPATH%\hmg.hbc %gtdrivers% %debug% -q %1 %2 %3 %4 %5 %6 %7 %8 >hbmk.log 2>&1
HBMK2 -mt -o"%~n1" %HMGPATH%\hmg.hbc %gtdrivers% %debug% -q %1 %2 %3 %4 %5 %6 %7 %8 >hbmk.log 2>&1
rem ******************************************************************************
rem CREATE LOGS
rem ******************************************************************************
if errorlevel 1 if exist windres.log copy /a windres.log+hbmk.log error.log >nul
if errorlevel 1 if not exist windres.log copy /a hbmk.log error.log >nul
if errorlevel 0 if exist windres.log copy /a windres.log+hbmk.log build.log >nul
if errorlevel 0 if not exist windres.log copy /a hbmk.log build.log >nul
rem ******************************************************************************
rem CLEANUP
rem ******************************************************************************
if exist windres.log del windres.log
if exist hbmk.log del hbmk.log
if exist _hmg_resconfig.h del _hmg_resconfig.h
if exist _temp.rc del _temp.rc
if exist _temp.o del _temp.o
rem ******************************************************************************
rem SHOW LOG
rem ******************************************************************************
if exist error.log type error.log
if exist build.log type build.log
rem ******************************************************************************
rem RUN APPLICATION
rem ******************************************************************************
if [%runafterbuild%]==[.f.] goto END
if exist dat GOTO OTHER
if exist "%~n1".exe "%~n1".exe
GOTO END
:OTHER
SET /p "OTHER=" <dat
COPY "%~n1".exe %other%
if errorlevel 1 goto END
if exist "%~n1".exe %other%\"%~n1".exe
:END