Is compiler possible portable ?
Posted: Sun Sep 19, 2010 4:27 am
I couldn't use specified pc exculsively, therefor I need a portable compiler in usb disk.
Is that possible? How should I do for that?
Best Regards
chen min
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://mail.hmgforum.com/
Dear cdsaenz:cdsaenz wrote:As far as I know HMG.4 is fully portable, shouldn't be writing anything in the registry (you only have to locate the QT* runtime libraries in the path for execution) and I saw that build.bat is using relative paths. I think HMG3.x's paths may need some touch-up to make it work from a drive different than C: but maybe the more experienced guys can confirm. In short, try putting the HMG folder in your thumb drive and see how it goes.
Code: Select all
SET HmgPath=D:\HMG\MiniGuiCode: Select all
SET PATH=%HmgPath%\util;%HmgPath%\mingw\bin;%HmgPath%\harbour\bin;Code: Select all
SET Resources=_temp.oCode: Select all
@ECHO OFF
CLS
REM ****************************************************************************
REM batch file to compile programs with HarbourMinigui
REM ****************************************************************************
SET IntError=0
REM ****************************************************************************
REM Set HMG environment and compiler environment
REM ****************************************************************************
SET HmgPath=D:\HMG\MiniGui
SET HmgVer=""
SET /p HmgVer=<%HmgPath%\version.txt
SET Resources=%HmgPath%\resources\hmg.o
SET GT=-gtgui
SET DEBUG=""
SET BUILDTYPE=""
SET REBUILDALL=""
SET MT=
REM ****************************************************************************
REM preserve PATH value and add HMG path
REM ****************************************************************************
SET Tpath=%PATH%
SET PATH=%HmgPath%\util;%HmgPath%\mingw\bin;%HmgPath%\harbour\bin;
REM ****************************************************************************
REM repeat params check
REM ****************************************************************************
:elabparms
REM ***************************************************************************
REM syntax help
REM ***************************************************************************
IF "%1"=="?" GOTO syntax
IF "%1"=="-h" GOTO syntax
IF "%1"=="/h" GOTO syntax
REM ***************************************************************************
REM go to compilers section
REM ***************************************************************************
GOTO befcheck
REM ***************************************************************************
REM Syntax
REM ***************************************************************************
:syntax
ECHO :: Syntax:
ECHO ::
ECHO :: "nbuild <PrgFile> | <filelist.hbp> [config.hbc]"
ECHO ::
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 :: <.hbc> files in the current folder are automatically processed.
PAUSE
GOTO cleanup
REM ****************************************************************************
REM start
REM ****************************************************************************
:befcheck
IF EXIST %~n1.exe DEL %~n1.exe
IF EXIST %~n1.exe GOTO error00
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 %~n1.hbp GOTO cmpres
IF EXIST %~n1.prg GOTO cmpres
GOTO error01
REM ***************************************************************************
REM resource compile
REM ***************************************************************************
:cmpres
IF NOT EXIST %~n1.rc GOTO cmpprg
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
SET Resources=_temp.o
REM ***************************************************************************
REM .prg | .hbp compile
REM ***************************************************************************
:cmpprg
hbmk2 -o%~n1.exe %GT% %DEBUG% %MT% %BUILDTYPE% %REBUILDALL% -incpath=%HmgPath%\include -L%HmgPath%\lib -lhmg -lhbmysql -lmysql -lcrypt -ledit -leditex -lgraph -lini -lreport -lhbwin -lhbziparc -lhbmzip -lmsvfw32 -lvfw32 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -lhbvpdf -lhbmemio -lhbsqlit3 -lsqlite3 -lhbfimage -lhbpgsql -lpq -lhbtip -lhbct -lhbmisc -lhbnetio -lxhb -prgflag=/q -cflag=-O3 %1 %2 %3 %4 %5 %6 %7 %8 %9 %Resources% >hbmk.log 2>&1
IF ERRORLEVEL 1 GOTO error04
GOTO cleanup
REM ***************************************************************************
REM errors
REM ***************************************************************************
:error00
CLS
ECHO Can't remove %~n1.exe
SET IntError=1
GOTO cleanup
:error01
CLS
ECHO Can't find %~n1
SET IntError=1
GOTO cleanup
:error03
CLS
ECHO Resource compiler error
SET IntError=1
GOTO cleanup
:error04
CLS
ECHO Source compiler error
SET IntError=1
GOTO cleanup
REM ***************************************************************************
REM end and clean
REM ***************************************************************************
:cleanup
IF EXIST _hmg_resconfig.h DEL _hmg_resconfig.h
IF EXIST _temp.rc DEL _temp.rc
IF EXIST _temp.o DEL _temp.o
IF EXIST *.o DEL *.o
IF EXIST *.c DEL *.c
SET PATH=%Tpath%
SET HmgPath=
SET HmgVer=
SET Resources=
SET GT=
SET DEBUG=
SET BUILDTYPE=
SET REBUILDALL=
SET MT=
SET L3wSys=
REM ***************************************************************************
REM if is there one error dont' delete log files
REM ***************************************************************************
IF %IntError%==1 GOTO nodel
IF EXIST windres.log DEL windres.log
IF EXIST hbmk.log DEL hbmk.log
:nodel
SET IntError=
REM ***************************************************************************
REM end
REM ***************************************************************************
:end