Build.bat

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Build.bat

Post by danielmaximiliano »

Hola a Todos:
en Minigui los ejemplos se compilan con un click sobre Compile.bat, si hay varios ejemplos se compilan si esperar.
en HMG no pasa lo mismo, no es un pedido de que esto suceda; asi que un granito de arena hace montañas, me dispuse a modificar Build.bat en la carpeta de ejemplos.
se puede usar como siempre , sino un doble click sobre en mismo y te da la opcion de ingresar el nombre del archivo a compilar.
toma por defecto .HBP si este no existe asume .PRG
si el archivo ingresado no existe sigue pidiendo el nombre para poder compilar ya que puede ser que se haya ingresado mal el nombre.
falta darle la salida del mismo no encontre una solucion.

con el anterior Build.bat en la carpeta de ejemplos, al hacer doble click me genera un .exe.exe
Build.log con el siguiente contenido
C:\HMG3.0.38\\mingw\bin\nm.exe: 'C:/DOCUME~1/DANIEL~2/CONFIG~1/Temp/hbmk_jsqt1e.dir/.c': No such file

Code: Select all

@echo off
@echo  
if "%1"=="" goto Input
call ..\..\build.bat  %*
goto Finish

:Input
@cls
@echo *******************************************************************************
@echo SYNTAX
@echo *******************************************************************************
@echo   "Build [ /n ] [ /d ] [ /c ] <program.prg>"
@echo   "Build <project.hbp> [<hbmk2 params>]"
@echo.
@echo   /n	no run after build
@echo   /d	enabled debugger
@echo   /c	console mode
@echo.
@echo.
@echo   This batch file passes information to hbmk2 to make possible an easy (zero
@echo   configuration build of HMG applications).
@echo.
@echo   You can achieve a customized build passing parameters directly to hbmk2.
@echo   Please, take a look at hbmk2 help:
@echo.
@echo   hbmk2 --help
@echo.
@echo ********************************************************************************
@echo.
@echo Enter Filename to compile, Filename.hbp assume if it exists
rem @echo Enter <Esc> for Exit
@Set /p Filename=  Input name :
rem @if %Filename% 
@if EXIST %Filename%.hbp Goto HBP 
@if EXIST %Filename%.prg Goto PRG
@echo.
@echo 
@echo File %filename% Not Exist
@echo Press any key for Continue
@pause > nul
@goto Input

:HBP
@Echo Compile %Filename%.hbp
call ..\..\build.bat %filename%.hbp 
goto Input

:PRG
@Echo Compile %Filename%.prg
call ..\..\build.bat %filename%.prg
goto Input


:Finish
@exit

Attachments
Build.jpg
Build.jpg (127.28 KiB) Viewed 3293 times
bad filename.jpg
bad filename.jpg (81.54 KiB) Viewed 3293 times
Last edited by danielmaximiliano on Thu Jul 21, 2011 12:54 pm, edited 1 time in total.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Build.bat

Post by danielmaximiliano »

Copie el codigo como BUILD2.BAT , luego pegue en cada carpeta de ejemplo.

Ej: C:\HMG3.0.38\SAMPLES\TIMER.2

doble click sobre C:\HMG3.0.38\SAMPLES\TIMER.2\Build2.bat

ingrese "demo" y compilara DEMO.HBP
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Build.bat

Post by danielmaximiliano »

Hola a todos:
simplificando Build.bat en la carpeta de aplicacion, el mismo no funciona fuera de dicha carpeta
call ..\..\build.bat %*
no se puede hacer un doble click ya que necesita el nombre de la aplicacion a compilar, ahora si no tiene en nombre pide uno.
se puede o no ingresar parametro de compilacion todo ello de forma sencilla.

espero que les sirva.
un defecto; ingresar el path de su instalacion HMG.

Translate Google
Hi all
Build.bat simplifying the application folder, it does not work outside of that folder
call .. \ .. \ build.bat% *
can not double click and you need the name of the application to compile, now if it does not ask for one name.
may or may not enter all compilation parameters easily.

I hope they serve.
a defect, enter the installation path of HMG.

Code: Select all

@echo off
@echo  
SET HMGPATH=C:\HMG3.0.38\
if "%1"=="" goto Input
call %HMGPATH%build.bat  %*
goto Finish

:Input
SET Filename=
SET Parameter=
@cls
@echo ********************************************************************************
@echo   This batch file passes information to hbmk2 to make possible an easy 
@echo   (zero configuration build of HMG applications).
@echo ********************************************************************************
@echo.
rem @color 01
@echo Enter Filename to compile, Filename.hbp assume if it exists
@echo.
rem @echo Enter <Esc> for Exit
@Set /p Filename=                        Application Name :
@echo.
if {%Filename%}=={} goto :Finish
@echo *******************************************************************************
@echo  Extra parameters
@echo                           /n	no run after build
@echo                           /d	enabled debugger
@echo                           /c	console mode
@echo Note: " <Enter> key entering no parameter is passed "
@echo *******************************************************************************
@echo.
@Set /p Parameter=                      passing parameters :
@echo.
rem @if %Filename% 
If "%Parameter%"=="" goto Continue
@echo compilation with parameters
@if EXIST %Filename%.hbp Goto HBPParameters 
@if EXIST %Filename%.prg Goto PRGParameters
@echo 
@echo HMG Source not found !!!!!
@echo Press any key and Retry.....
@Pause >nul
goto Input



:HBPParameters
@Echo Compile %Filename%.hbp With %Parameter%
call %HMGPATH%build.bat %Parameter% %filename%.hbp 
goto Input

:PRGParameters
@Echo Compile %Filename%.PRG With %Parameter%
call %HMGPATH%build.bat %Parameter% %%filename%.prg
@Pause
goto Input


:Continue
@echo no parameters compilation
@if EXIST %Filename%.hbp Goto HBP 
@if EXIST %Filename%.prg Goto PRG
@echo.
@echo 
@echo HMG Source not found !!!!!
@echo Press any key and Retry.....
@pause > nul
@goto Input

:HBP
@Echo Compile %Filename%.hbp
call %HMGPATH%build.bat %filename%.hbp 
goto Input

:PRG
@Echo Compile %Filename%.prg
call %HMGPATH%build.bat %filename%.prg
goto Input


:Finish
@exit

Attachments
build.rar
unzip the folder of your application HMG
Example: c: \ my application hmg \
(763 Bytes) Downloaded 299 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Post Reply