Roberto Lopez wrote:
- Modified: HMG installation is portable now, so it could be installed
in a different folder than c:\hmg and work without need to reconfigure.
This is correct when <working dir> is under <hmg_root_dir>
Sorry; but this isn't an unexpected test. All my <work_dirs> are in drive D:
Best Regards
--
Esgici
I've installed at d:\experiment\hmg and it still working...
@echo off
cls
rem ***************************************************************************
rem HMG 3.0 Build batch
rem Roberto Lopez (2009.10.22)
rem ***************************************************************************
rem ***************************************************************************
rem Set variables
rem ***************************************************************************
Set HmgPath=%~dp0
Set Path=%HmgPath%\util;%HmgPath%\mingw\bin;%HmgPath%\harbour\bin;
Set Resources=%HmgPath%\resources\minigui.o
set GT=-gtgui
set DEBUG=""
set BUILDTYPE=""
set REBUILDALL=""
set RUN=.T.
set MT=
rem ***************************************************************************
rem
rem Syntax:
rem
rem Build [/i|/r|/d|/cs|/ci/cr] <PrgFile> | <filelist.hbp> [config.hbc]
rem
rem [/i] : incremental build
rem [/r] : incremental build (rebuild all)
rem
rem [/cs] : Console/mixed mode (std build)
rem [/ci] : Console/mixed mode (incremental build)
rem [/cr] : Console/mixed mode (incremental rebuild all)
rem
rem [/d] : Debug mode (gui and console)
rem
rem
rem <filelist.hbm> : A text file with .hbp extension containing a source list
rem <configfile.hbc>: A text file with configuration parameters as additional
rem libs, include paths and lib paths.
rem
rem <configfile.hbc> Syntax:
rem
rem incpaths = incpath1 incpath2 ... incpathn
rem
rem libpaths = libpath1 libpath2 ... libpathn
rem
rem libs = lib1 lib2 ... libn
rem
rem - library names must not include 'lib' prefix nor '.a' extension.
rem
rem - build.bat will create an 'error.log' file in the app folder when build
rem process ends with an error condition.
rem
rem
rem ***************************************************************************
cls
echo building...
if exist hbmk.log del hbmk.log
if exist windres.log del windres.log
if exist error.log del error.log
if exist _hmg_resconfig.h del _hmg_resconfig.h
rem ---------------------------------------------------------------------------
rem Parameters Processing
rem ---------------------------------------------------------------------------
rem ***************************************************************************
rem NO PARAMETERS OR HELP REQUESTED
rem ***************************************************************************
if "%1"=="" goto syntax
if "%1"=="/?" goto syntax
if "%1"=="-?" goto syntax
if "%1"=="/h" goto syntax
if "%1"=="/H" goto syntax
if "%1"=="-h" goto syntax
if "%1"=="-H" goto syntax
if "%1"=="-help" goto syntax
if "%1"=="-HELP" goto syntax
rem ***************************************************************************
rem No run after build
rem ***************************************************************************
if "%1"=="/n" goto norun
if "%1"=="/N" goto norun
:continue0
rem ***************************************************************************
rem Multi Thread
rem ***************************************************************************
if "%1"=="/mt" goto multithread
if "%1"=="/MT" goto multithread
:continue1
rem ***************************************************************************
rem Console Incremental Rebuild
rem ***************************************************************************
if "%1"=="/cr" goto consoleincrebuild
if "%1"=="/CR" goto consoleincrebuild
rem ***************************************************************************
rem Console Incremental
rem ***************************************************************************
if "%1"=="/ci" goto consoleincremental
if "%1"=="/CI" goto consoleincremental
rem ***************************************************************************
rem GUI Incremental Rebuild
rem ***************************************************************************
if "%1"=="/r" goto increbuild
if "%1"=="/R" goto increbuild
rem ***************************************************************************
rem Console Standard Build
rem ***************************************************************************
if "%1"=="/cs" goto console
if "%1"=="/CS" goto console
rem ***************************************************************************
rem If debug mode specified, use GTWIN and pass -b parameter
rem ***************************************************************************
if "%1"=="/d" goto debug
if "%1"=="/D" goto debug
rem ***************************************************************************
rem If /i parameter rceived set BUILDTYPE to incremental
rem ***************************************************************************
if "%1"=="/i" goto incremental
if "%1"=="/I" goto incremental
rem ***************************************************************************
rem If /i parameter rceived set BUILDTYPE to incremental
rem ***************************************************************************
if "%1"=="/i" goto incremental
if "%1"=="/I" goto incremental
:continue
if exist %~n1.exe del %~n1.exe
if exist %~n1.exe goto error
rem ***************************************************************************
rem If a resource with the same base name as the first parameter exist compile it
rem ***************************************************************************
if exist %~n1.rc echo #define HMGRPATH %HmgPath%\RESOURCES > _hmg_resconfig.h
if exist %~n1.rc copy /b %HmgPath%\resources\minigui.rc+%~n1.rc+%HmgPath%\resources\filler _temp.rc >NUL
if exist %~n1.rc redir -e windres.log windres -i _temp.rc -o _temp.o
if exist %~n1.rc Set Resources=_temp.o
rem ***************************************************************************
rem invoke HBMK2
rem ***************************************************************************
redir -eo hbmk2 -o%~n1.exe %GT% %DEBUG% %MT% -head=real %BUILDTYPE% %REBUILDALL% -incpath=%HmgPath%\include -incpath=%CD% -L%HmgPath%\lib -lminigui -lhbmysql -lmysql -lcrypt -ledit -leditex -lgraph -lini -lreport -lhbwin -lhbziparc -lhbmzip -lmsvfw32 -lvfw32 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -lhbvpdf -lhbmemio -lhbsqlit3 -lsqlite3 -lhbfimage.a -lhbpgsql -lpq -lhbtip -lhbct -lhbmisc -lhbnetio -prgflag=/q %1 %2 %3 %4 %5 %6 %7 %8 %9 %Resources% >hbmk.log
goto end
rem ***************************************************************************
rem Procedure increbuild
rem ***************************************************************************
:increbuild
set BUILDTYPE=-inc
set REBUILDALL=-rebuild
shift
goto continue
rem ***************************************************************************
rem Procedure Console
rem ***************************************************************************
:console
set GT=-gtwin
shift
goto continue
rem ***************************************************************************
rem Procedure Debug
rem ***************************************************************************
:debug
set GT=-gtwin
set DEBUG=-b
echo Options NoRunAtStartup > Init.cld
shift
goto continue
rem ***************************************************************************
rem Procedure Incremental
rem ***************************************************************************
:Incremental
set BUILDTYPE=-inc
shift
goto continue
rem ***************************************************************************
rem Procedure IncConsole
rem ***************************************************************************
:consoleincremental
set BUILDTYPE=-inc
set GT=-gtwin
shift
goto continue
rem ***************************************************************************
rem Procedure IncConsole
rem ***************************************************************************
:consoleincrebuild
set BUILDTYPE=-inc
set GT=-gtwin
set REBUILDALL=-rebuild
shift
goto continue
rem ***************************************************************************
rem Procedure NoRun
rem ***************************************************************************
:norun
set RUN=.F.
shift
goto continue0
rem ***************************************************************************
rem Procedure Multithread
rem ***************************************************************************
:multithread
set MT=-mt
shift
goto continue1
rem ***************************************************************************
rem Procedure Error
rem ***************************************************************************
:error
echo Can't delete previous %~n1.exe version (still running?) > error.log
goto showlog
rem ***************************************************************************
rem Procedure Syntax
rem ***************************************************************************
:syntax
cls
echo :: Syntax:
echo ::
echo :: "Build [/i|/r|/d|/cs|/ci/cr] <PrgFile> | <filelist.hbp> [config.hbc]"
echo ::
echo :: [/i] : incremental build
echo :: [/r] : incremental build (rebuild all)
echo :: [/cs] : Console/mixed mode (std build)
echo :: [/ci] : Console/mixed mode (incremental build)
echo :: [/cr] : Console/mixed mode (incremental rebuild all)
echo :: [/d] : Debug mode (gui and console)
echo :: filelist.hbm : A text file with .hbp extension containing a source list
echo :: configfile.hbc: A text file with configuration parameters as additional
echo :: libs, include paths and lib paths.
echo ::
echo :: configfile.hbc Syntax:
echo ::
echo :: incpaths = incpath1 incpath2 ... incpathn
echo :: libpaths = libpath1 libpath2 ... libpathn
echo :: libs = lib1 lib2 ... libn
echo ::
echo :: library names must not include 'lib' prefix nor '.a' extension.
echo :: build.bat will create an 'error.log' file in the app folder when build
echo :: process ends with an error condition.
echo ::
pause
goto stop
:end
rem ***************************************************************************
rem Cleanup
rem ***************************************************************************
rem If build error, create 'error.log' ----------------------------------------
if errorlevel 1 if exist windres.log copy /b windres.log+hbmk.log error.log >nul
if errorlevel 1 if not exist windres.log copy /b hbmk.log error.log >nul
rem If no error run the exe ---------------------------------------------------
if "%RUN%"==".T." if not errorlevel 1 if exist %~n1.exe %~n1.exe
rem Delete temporary files ----------------------------------------------------
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 if exist delete debugger file ---------------------------------------------
if exist init.cld del init.cld
:showlog
if exist error.log type error.log
:stop
Then change the samples build.bat with the following: