Lib File
Posted: Wed Aug 03, 2011 3:06 am
Hi
I need some help. How to make lib file with harbour?
Thanks & Regards,
Tristan
I need some help. How to make lib file with harbour?
Thanks & Regards,
Tristan
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://hmgforum.com/
Code: Select all
-hblib
-inc
-ol3wlib
-w3 -es2
source1.prg
source2.prg
Code: Select all
#
# $Id: hbvpdf.hbp 16868 2011-06-07 22:29:10Z vszakats $
#
-hblib
-inc
-olib/${hb_plat}/${hb_comp}/${hb_name}
-w3 -es2
-instfile=inc:hbvpdf.ch
hbvpdf.prg
hbvpdft.prg
hbvpsup.prg
Code: Select all
#
# $Id: hbvpdf.hbc 14687 2010-06-04 11:08:35Z vszakats $
#
incpaths=.
libpaths=lib/${hb_plat}/${hb_comp}
libs=${hb_name}
Code: Select all
@echo off
@echo
if "%1"=="" goto Input
rem %* es toda la linea de parametros pasados a createlib.bat
rem %1 %2 %3 %4 %5 %6 %7 %8 %9
rem
c:\hb31\bin\hbmk2 %*
goto Finish
:Input
@cls
@echo *******************************************************************************
@echo SYNTAX
@echo *******************************************************************************
@echo "Build [ /n ] [ /d ] [ /c ] <program.prg>"
@echo " or "
@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 LIB name to compile, Extension .hbp assume if it exists
@Set /p Libname= Input lib name :
@if EXIST %Libname%.hbp Goto HBP
@if EXIST %Libname%.prg Goto PRG
@echo.
@echo
@echo File %Libname% Not Exist
@echo Press any key for Continue
@pause > nul
@goto Input
:HBP
@Echo Compile %Libname%.hbp
c:\hb31\bin\hbmk2 %libname%.hbp
goto Input
:PRG
Hi Luigi :l3whmg wrote:Hi Daniel,
I suggest to see within harbour examples folder
Code: Select all
@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
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
echo %~dp0%
echo %hmgpath%
pause
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"=="/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 ******************************************************************************
HBMK2 -o%~n1.exe %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%"==".t." if exist %~n1.exe %~n1.exe
Code: Select all
@echo off
REM
REM $Id: buildlib.bat 438 2010-10-19 02:37:12Z roblez $
REM
SET HB_COMPILER=mingw
SET SAVPATH=%PATH%
SET HRBHOME=D:\HMiniGui\HARBOUR
SET HRBBIN=%HRBHOME%\bin
SET MGWHOME=%HRBHOME%\comp\mingw
SET MGWBIN=%MGWHOME%\bin
SET HMGPATH=%~dp0
rem this was the original row that I remarks SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
SET PATH=%HRBBIN%;%MGWBIN%;%PATH%
hbmk2 hmg.hbp > hbmk.log 2>&1
SET PATH=%SAVPATH%
SET HB_COMPILER=
SET HRBHOME=
SET HRBBIN=
SET MGWHOME=
SET MGWBIN=
SET HMGPATH=
SET SAVPATH=
and check buildlib.bat and build.bat commands with many resources file (not only hmg.rc)<drive>:\Myprojects\<ubfolders>
<drive>:\HMG\<subfolders>
<drive>:\HARBOUR\<subfolders>
and if someone want it
<drive>:\MINGW\<subfolders>