2010-07-23 13:04 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* utils/hbmk2/hbmk2.prg
    - Deleted handling of .hbi extension.
    - Deleted -target and -alltarget cmdline options as an
      effort for simplification. Now all cmdline options apply
      to all targets.
    + .hbp file references will now be executed as sub-projects,
      using an internal recursive call to the hbmk2 engine.
      This means that projects can now be embedded. INCOMPATIBLE
      if someone used .hbp file references inside other make
      files. If you want to create common settings in a separate
      file, always use .hbm extension.
      Pls note that sub-projects will inherit all cmdline options
      of original hbmk2 invocation.
    + Added ${hb_targetname} macro to return the parent project
      name.
    + Added ${hb_targettype} macro. Returning target type.
    + Changed -run option to only run the top level project.
    + Changed --hbinfo to return a flat list of information
      about all projects involved. Currently the main project
      is the last one in the list (order of execution).
    + Filters can now be used also for file inclusion and -skip
      options (which means they can now be used for all possible
      cmdline and .hbm/.hbp options)
    ! Fixed the way automatic cmdline options based on
      hbmk2's own filename are created. From now -hbcmp, -hblnk,
      -hbcc, -rtlink, -xhb, -hb10 will be added to the left side
      of the existing option (to precede everything else), while
      the rest (f.e. -hblib, -hbexe, -hbdyn) will be added last.
    ; NOTE: Quite heavy changes so pls expect (and report) any
            regressions. Most probably there will be room for
            tweaks here and there to make the new cascading build
            feature as smooth as possible.

  * contrib/make.hbs
    % Internally simplified since now the handling of sub-projects
      is the job of hbmk2 and .hbp make files.
    + In standalone mode it will now detect the name of the project
      in current dir, so the codepaths are much similar to the
      GNU Make mode now and stdalone mode will also rely on pkglist,
      instead of trying to detect what to build on its own.
    + Not require pkglist to list any sub-projects anymore, now
      it's simple list of main .hbp files.
    + Changed along with hbmk2 to deal with multiple project
      information returned by --hbinfo.
    + Avoid using the word "contrib", use "package" instead.

  * contrib/pkglist
    * Simplified to a mere list of main .hbp files for packages.

  * utils/hbrun/hbrun.prg
  * contrib/make.hbs
  * config/postinst.hbs
    * PathSepToSelf() rewritten to not make assumptions about
      __PLATFORM__* macro vs hb_ps() value, instead use hb_ps()
      value to decide what to do.

  * utils/hbrun/hbrun.prg
    ! Fixed to not save the (empty) history after each non-interactive
      session.

  * config/win/cygwin.mk
    ! Fixed to add z and pcre libs if the locally hosted ones
      aren't used.

  * contrib/hbqt/generator/hbqtgen.prg
    ! Fixed OS names in doc output.
    * Formatting.

  * contrib/gtalleg/gtalleg.hbm
  * contrib/gtalleg/gtalleg.hbp
  * contrib/gtalleg/gtallegs.hbp
  * contrib/hbcurl/hbcurl.hbm
  * contrib/hbcurl/hbcurl.hbp
  * contrib/hbcurl/hbcurls.hbp
  * contrib/hbtip/hbtip.hbm
  * contrib/hbtip/hbtip.hbp
  * contrib/hbtip/hbtipssl.hbp
  * contrib/hbssl/hbssl.hbm
  * contrib/hbssl/hbssl.hbp
  * contrib/hbssl/hbssls.hbp
  * contrib/hbqt/hbqt_common.hbm
  - contrib/hbqt/hbqt.hbm
  + contrib/hbqt/filelist.hbm
  * contrib/hbqt/hbqt.hbp
  * contrib/hbqt/hbqts.hbp
  * contrib/hbqt/hbqtgui.hbp
  * contrib/hbqt/hbqtguis.hbp
  * contrib/hbqt/hbqtcore.hbp
  * contrib/hbqt/hbqtcores.hbp
  * contrib/hbqt/hbqtnetwork.hbp
  * contrib/hbqt/hbqtnetworks.hbp
  - contrib/hbqt/gtqtc/gtqtc.hbm
  + contrib/hbqt/gtqtc/filelist.hbm
  * contrib/hbqt/gtqtc/gtqtc.hbp
  * contrib/hbqt/gtqtc/gtqtcs.hbp
  * contrib/hbqt/qtwebkit/hbqtwebkit.hbp
  * contrib/hbqt/qtwebkit/hbqtwebkits.hbp
  * contrib/hbqt/qtdesigner/hbqtdesigner.hbp
  * contrib/hbqt/qtdesigner/hbqtdesigners.hbp
  * contrib/hbqt/hbqscintilla/hbqscintilla.hbp
    * Cleanup along with latest changes:
      Using ${hb_targetname} instead of ${hb_name}, so it's safe to
      use it inside .hbm file, instead of replicating them in every
      .hbp file.
    + Now primary .hbp project files always reference the sub-project
      .hbp files:
         - hbqt
           + hbqts
           + hbqtcore
             + hbqtcores
           + hbqtgui
             + hbqtguis
           + hbqtnetwork
             + hbqtnetworks
      Which means that 'hbmk2 hbqt.hbp' will rebuild the whole
      stuff (all libs, and even static libs if requested) in one pass.
    * Renamed some file for more uniform layout.
This commit is contained in:
Viktor Szakats
2010-07-23 11:08:33 +00:00
parent 7dfa9982ef
commit 319d515799
39 changed files with 1041 additions and 891 deletions

View File

@@ -16,6 +16,125 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-07-23 13:04 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
- Deleted handling of .hbi extension.
- Deleted -target and -alltarget cmdline options as an
effort for simplification. Now all cmdline options apply
to all targets.
+ .hbp file references will now be executed as sub-projects,
using an internal recursive call to the hbmk2 engine.
This means that projects can now be embedded. INCOMPATIBLE
if someone used .hbp file references inside other make
files. If you want to create common settings in a separate
file, always use .hbm extension.
Pls note that sub-projects will inherit all cmdline options
of original hbmk2 invocation.
+ Added ${hb_targetname} macro to return the parent project
name.
+ Added ${hb_targettype} macro. Returning target type.
+ Changed -run option to only run the top level project.
+ Changed --hbinfo to return a flat list of information
about all projects involved. Currently the main project
is the last one in the list (order of execution).
+ Filters can now be used also for file inclusion and -skip
options (which means they can now be used for all possible
cmdline and .hbm/.hbp options)
! Fixed the way automatic cmdline options based on
hbmk2's own filename are created. From now -hbcmp, -hblnk,
-hbcc, -rtlink, -xhb, -hb10 will be added to the left side
of the existing option (to precede everything else), while
the rest (f.e. -hblib, -hbexe, -hbdyn) will be added last.
; NOTE: Quite heavy changes so pls expect (and report) any
regressions. Most probably there will be room for
tweaks here and there to make the new cascading build
feature as smooth as possible.
* contrib/make.hbs
% Internally simplified since now the handling of sub-projects
is the job of hbmk2 and .hbp make files.
+ In standalone mode it will now detect the name of the project
in current dir, so the codepaths are much similar to the
GNU Make mode now and stdalone mode will also rely on pkglist,
instead of trying to detect what to build on its own.
+ Not require pkglist to list any sub-projects anymore, now
it's simple list of main .hbp files.
+ Changed along with hbmk2 to deal with multiple project
information returned by --hbinfo.
+ Avoid using the word "contrib", use "package" instead.
* contrib/pkglist
* Simplified to a mere list of main .hbp files for packages.
* utils/hbrun/hbrun.prg
* contrib/make.hbs
* config/postinst.hbs
* PathSepToSelf() rewritten to not make assumptions about
__PLATFORM__* macro vs hb_ps() value, instead use hb_ps()
value to decide what to do.
* utils/hbrun/hbrun.prg
! Fixed to not save the (empty) history after each non-interactive
session.
* config/win/cygwin.mk
! Fixed to add z and pcre libs if the locally hosted ones
aren't used.
* contrib/hbqt/generator/hbqtgen.prg
! Fixed OS names in doc output.
* Formatting.
* contrib/gtalleg/gtalleg.hbm
* contrib/gtalleg/gtalleg.hbp
* contrib/gtalleg/gtallegs.hbp
* contrib/hbcurl/hbcurl.hbm
* contrib/hbcurl/hbcurl.hbp
* contrib/hbcurl/hbcurls.hbp
* contrib/hbtip/hbtip.hbm
* contrib/hbtip/hbtip.hbp
* contrib/hbtip/hbtipssl.hbp
* contrib/hbssl/hbssl.hbm
* contrib/hbssl/hbssl.hbp
* contrib/hbssl/hbssls.hbp
* contrib/hbqt/hbqt_common.hbm
- contrib/hbqt/hbqt.hbm
+ contrib/hbqt/filelist.hbm
* contrib/hbqt/hbqt.hbp
* contrib/hbqt/hbqts.hbp
* contrib/hbqt/hbqtgui.hbp
* contrib/hbqt/hbqtguis.hbp
* contrib/hbqt/hbqtcore.hbp
* contrib/hbqt/hbqtcores.hbp
* contrib/hbqt/hbqtnetwork.hbp
* contrib/hbqt/hbqtnetworks.hbp
- contrib/hbqt/gtqtc/gtqtc.hbm
+ contrib/hbqt/gtqtc/filelist.hbm
* contrib/hbqt/gtqtc/gtqtc.hbp
* contrib/hbqt/gtqtc/gtqtcs.hbp
* contrib/hbqt/qtwebkit/hbqtwebkit.hbp
* contrib/hbqt/qtwebkit/hbqtwebkits.hbp
* contrib/hbqt/qtdesigner/hbqtdesigner.hbp
* contrib/hbqt/qtdesigner/hbqtdesigners.hbp
* contrib/hbqt/hbqscintilla/hbqscintilla.hbp
* Cleanup along with latest changes:
Using ${hb_targetname} instead of ${hb_name}, so it's safe to
use it inside .hbm file, instead of replicating them in every
.hbp file.
+ Now primary .hbp project files always reference the sub-project
.hbp files:
- hbqt
+ hbqts
+ hbqtcore
+ hbqtcores
+ hbqtgui
+ hbqtguis
+ hbqtnetwork
+ hbqtnetworks
Which means that 'hbmk2 hbqt.hbp' will rebuild the whole
stuff (all libs, and even static libs if requested) in one pass.
* Renamed some file for more uniform layout.
2010-07-22 18:51 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbxbp/xbpbrowse.prg
+ Changed: width of the columns : maximum of data or header.
@@ -27,11 +146,11 @@
+ Implemented: ideDBU - context menu:
> Scroll to... Opens a input dialog to fetch fieldname ( case insensitive ).
Any first characters will scroll the browser to
make that column visible. Vey handy especially in
Any first characters will scroll the browser to
make that column visible. Vey handy especially in
tables with lot of fields.
> Search in Field Opens input dialog to fetch a value to be searched
sequentially on the highlighted field. This option is
sequentially on the highlighted field. This option is
available in any state of the table, indexed or natural order.
> Form View Triggers the form-view scrollable widget visible.

View File

@@ -187,10 +187,4 @@ STATIC FUNCTION FNameExtSet( cFileName, cExt )
RETURN hb_FNameMerge( cDir, cName, cExt )
STATIC FUNCTION PathSepToSelf( cFileName )
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS ) .OR. ;
defined( __PLATFORM__OS2 )
RETURN StrTran( cFileName, "/", "\" )
#else
RETURN StrTran( cFileName, "\", "/" )
#endif
RETURN StrTran( cFileName, iif( hb_ps() == "\", "/", "\" ), hb_ps() )

View File

@@ -48,6 +48,15 @@ endif
LD := $(CC)
LD_OUT := -o
ifneq ($(HB_HAS_PCRE),)
ifeq ($(HB_HAS_PCRE_LOCAL),)
SYSLIBS += pcre
endif
endif
ifeq ($(HB_HAS_ZLIB_LOCAL),)
SYSLIBS += z
endif
LIBPATHS := -L$(LIB_DIR)
LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib))

View File

@@ -5,6 +5,9 @@
-hblib
-inc
-o${hb_targetname}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_targetname}
-w3 -es2
-stop{pocc|pocc64|poccarm|xcc|dmc|watcom|mingwarm|msvcarm}

View File

@@ -4,5 +4,4 @@
gtalleg.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
gtallegs.hbp

View File

@@ -4,9 +4,6 @@
gtalleg.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
-stop{!msvc}
-cflag=-DALLEGRO_STATICLINK

View File

@@ -5,6 +5,9 @@
-hblib
-inc
-o${hb_targetname}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_targetname}
-w3 -es2
-depkeyhead=curl:curl/curl.h

View File

@@ -4,10 +4,9 @@
hbcurl.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
-depimplibs=curl:../libcurl.dll
-depimplibs=curl:../bin/libcurl.dll
-iflag={bcc}-a
hbcurls.hbp

View File

@@ -4,9 +4,6 @@
hbcurl.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
-stop{!(win|wce)}
-cflag=-DCURL_STATICLIB

View File

@@ -2,13 +2,6 @@
# $Id$
#
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
-instfile=inc:hbqt.ch
hbqt_base.cpp
hbqt_destruct.cpp
hbqt_hbqabstractitemmodel.cpp
@@ -30,6 +23,3 @@ hbqt_hbqplaintextedit.h
hbqt_hbqsyntaxhighlighter.h
hbqt_hbqtableview.h
hbqt_hbslots.h
{darwin&!HB_WITH_QT}-cflag=-I/Library/Frameworks/QtGui.framework/Headers
{darwin&!HB_WITH_QT}-cflag=-I/Library/Frameworks/QtNetwork.framework/Headers

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
#
# $Id$
#
gtqtc.cpp
gtqtc.h

View File

@@ -1,10 +0,0 @@
#
# $Id$
#
../hbqt_common.hbm
-instfile=inc:hbgtqtc.ch
gtqtc.cpp
gtqtc.h

View File

@@ -2,7 +2,10 @@
# $Id$
#
gtqtc.hbm
../hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
-instfile=inc:hbgtqtc.ch
gtqtcs.hbp

View File

@@ -2,10 +2,9 @@
# $Id$
#
gtqtc.hbm
../hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
-stop{!HB_QT_BUILD_STATIC|!allwin}

View File

@@ -4,9 +4,6 @@
../hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
-incpath=${HB_WITH_QSCINTILLA}/qt
hbqt_hbqsciscintilla.h

View File

@@ -2,7 +2,14 @@
# $Id$
#
hbqt.hbm
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
-instfile=inc:hbqt.ch
hbqts.hbp
hbqtcore.hbp
hbqtgui.hbp
hbqtnetwork.hbp

View File

@@ -7,6 +7,9 @@
-hblib
-inc
-o${hb_targetname}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_targetname}
-w3 -es2
-stop{dos|watcom|bcc|pocc|pocc64|poccarm|msvcia64}

View File

@@ -4,7 +4,6 @@
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
qtcore/filelist.hbm
hbqtcores.hbp

View File

@@ -4,9 +4,6 @@
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
qtcore/filelist.hbm
-stop{!HB_QT_BUILD_STATIC|!allwin}

View File

@@ -4,7 +4,6 @@
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
qtgui/filelist.hbm
hbqtguis.hbp

View File

@@ -4,9 +4,6 @@
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
qtgui/filelist.hbm
-stop{!HB_QT_BUILD_STATIC|!allwin}

View File

@@ -4,7 +4,6 @@
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
qtnetwork/filelist.hbm
hbqtnetworks.hbp

View File

@@ -4,9 +4,6 @@
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
qtnetwork/filelist.hbm
-stop{!HB_QT_BUILD_STATIC|!allwin}

View File

@@ -2,10 +2,9 @@
# $Id$
#
hbqt.hbm
hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
-stop{!HB_QT_BUILD_STATIC|!allwin}

View File

@@ -4,7 +4,6 @@
../hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
hbqtdesigners.hbp

View File

@@ -4,11 +4,8 @@
../hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
-stop{!HB_QT_STATIC|!allwin}
-stop{!HB_QT_BUILD_STATIC|!allwin}
-cflag=-DQT_NODLL

View File

@@ -4,7 +4,6 @@
../hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
hbqtwebkits.hbp

View File

@@ -4,11 +4,8 @@
../hbqt_common.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
filelist.hbm
-stop{!HB_QT_STATIC|!allwin}
-stop{!HB_QT_BUILD_STATIC|!allwin}
-cflag=-DQT_NODLL

View File

@@ -7,6 +7,9 @@
-hblib
-inc
-o${hb_targetname}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_targetname}
-w3 -es2
-depkeyhead=openssl:openssl/ssl.h

View File

@@ -4,9 +4,6 @@
hbssl.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
-depimplibs=openssl:../out32dll/libeay32.dll
-depimplibs=openssl:../out32dll/ssleay32.dll
-depimplibs=openssl:../dll/libeay32.dll
@@ -15,3 +12,5 @@ hbssl.hbm
-depimplibs=openssl:../ssleay32.dll
-iflag={bcc}-a
hbssls.hbp

View File

@@ -4,9 +4,6 @@
hbssl.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
-stop{!(win|wce)}
{win|wce}-cflag=-DHB_OPENSSL_STATIC

View File

@@ -5,6 +5,9 @@
-hblib
-inc
-o${hb_targetname}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_targetname}
-w3 -es2
-instfile=inc:tip.ch

View File

@@ -4,5 +4,4 @@
hbtip.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
hbtipssl.hbp

View File

@@ -4,9 +4,6 @@
hbtip.hbm
-o${hb_name}
-workdir=${hb_work}/${hb_plat}/${hb_comp}/${hb_name}
../hbssl/hbssl.hbc
-DHB_HAS_OPENSSL

View File

@@ -5,7 +5,7 @@
/*
* Harbour Project source code:
* Contrib build orchestrator script
* Package build orchestrator script
*
* Copyright 2010 Viktor Szakats (harbour.01 syenar.hu)
* www - http://harbour-project.org
@@ -42,8 +42,6 @@
with postinst.hbs logic)
7. Move some logic to hbmk2.
8. Honor paths found in --hbinfo hbctree{{}} section.
9. pkglist should not contain information about package layout.
This should rather be somehow embedded into .hbp files.
*/
#pragma warninglevel=3
@@ -86,10 +84,13 @@ PROCEDURE Main( ... )
/* Load list of packages */
s_hPackageList := LoadPkgList( s_cHome + "pkglist" )
s_hPackageList := { => }
hb_HKeepOrder( s_hPackageList, .T. )
LoadPkgListFromFile( s_hPackageList, s_cHome + "pkglist" )
LoadPkgListFromString( s_hPackageList, GetEnv( "HB_BUILD_ADDONS" ) )
/* Build */
IF Empty( GetEnv( "HB_HOST_BIN_DIR" ) )
Standalone( ... )
ELSE
@@ -110,20 +111,19 @@ PROCEDURE Main( ... )
PROCEDURE Standalone( ... )
LOCAL aParams
LOCAL aFileList
LOCAL aFile
LOCAL aSortedList
LOCAL cPWD
LOCAL cBinDir
LOCAL hProject
LOCAL cDir
LOCAL cPackage
LOCAL cMyPackage
LOCAL cOptions
LOCAL cOptionsUser
LOCAL nAction
LOCAL tmp
LOCAL tmp1
LOCAL lCustom
@@ -164,6 +164,23 @@ PROCEDURE Standalone( ... )
ENDIF
NEXT
IF ! lCustom
cPWD := hb_pwd()
/* Find out which package are we */
FOR EACH tmp IN s_hPackageList
tmp1 := hb_ps() + PathSepToSelf( tmp:__enumKey() ) + hb_ps()
IF tmp1 == Right( cPWD, Len( tmp1 ) )
cMyPackage := StrTran( tmp:__enumKey(), "\", "/" )
EXIT
ENDIF
NEXT
IF Empty( cMyPackage )
lCustom := .T.
ELSE
OutStd( hb_StrFormat( "! Package '%1$s' %2$s...", cMyPackage, hActions[ nAction ] ) + hb_eol() )
ENDIF
ENDIF
cBinDir := s_cRoot + "bin" + hb_ps()
IF lCustom
@@ -182,37 +199,20 @@ PROCEDURE Standalone( ... )
ENDIF
ENDIF
aFileList := Directory( "*.hbp" )
IF ! Empty( aFileList )
/* Query project information and dependencies and calculate build order */
aPairList := {}
/* Add the project in current dir */
s_hPackageList[ "." ] := {}
FOR EACH aFile IN aFileList
AAdd( s_hPackageList[ "." ], { "cFileName" => aFile[ F_NAME ] } )
NEXT
call_hbmk2_hbinfo( cBinDir, s_cBase + s_hPackageList[ cMyPackage ][ "cFileName" ], s_hPackageList[ cMyPackage ] )
DeptLinesToDeptPairList( aPairList, cMyPackage, s_hPackageList[ cMyPackage ][ "aDept" ] )
/* Query project information and dependencies and calculate build order */
aPairList := {}
aSortedList := TopoSort( aPairList )
FOR EACH hProject IN s_hPackageList[ "." ]
call_hbmk2_hbinfo( cBinDir, s_cBase + hProject[ "cFileName" ], hProject )
DeptLinesToDeptPairList( aPairList, ".", hProject[ "aDept" ] )
NEXT
aSortedList := TopoSort( aPairList )
/* Build the dependencies and ourselves in in sorted order */
FOR EACH cDir IN aSortedList DESCEND
FOR EACH hProject IN s_hPackageList[ cDir ]
IF cDir == "." .AND. hProject[ "cType" ] $ "hbhrb|hbppo"
LOOP
ENDIF
call_hbmk2( cBinDir,;
s_cBase + iif( cDir == ".", "", s_cHome + cDir + "/" ) + hProject[ "cFileName" ],;
iif( cDir == ".", cOptions + cOptionsUser, "" ), "" )
NEXT
NEXT
ENDIF
/* Build the dependencies and ourselves in in sorted order */
FOR EACH cPackage IN aSortedList DESCEND
call_hbmk2( cBinDir,;
s_cBase + iif( cPackage == cMyPackage, "", s_cHome + cPackage + "/" ) + s_hPackageList[ cPackage ][ "cFileName" ],;
iif( cPackage == cMyPackage, cOptions + cOptionsUser, " -inc" ), "" )
NEXT
ENDIF
ErrorLevel( 0 )
@@ -234,9 +234,8 @@ PROCEDURE Standalone( ... )
PROCEDURE GNUMake( ... )
LOCAL cBinDir
LOCAL hProject
LOCAL aProject
LOCAL cProject
LOCAL cDir
LOCAL cPackage
LOCAL cOptions
@@ -248,11 +247,7 @@ PROCEDURE GNUMake( ... )
LOCAL aGNUMakeParams
LOCAL nAction
LOCAL cName
LOCAL cItem
LOCAL aPairList
LOCAL lAnyAddons
LOCAL aSortedList
@@ -280,17 +275,6 @@ PROCEDURE GNUMake( ... )
RETURN
ENDIF
/* Load list of addons. Convert it to our internal format */
lAnyAddons := .F.
FOR EACH cItem IN hb_ATokens( GetEnv( "HB_BUILD_ADDONS" ),, .T. )
IF ! Empty( cItem )
hb_FNameSplit( PathSepToSelf( cItem ), @cDir, @cName )
s_hPackageList[ StrTran( DirDelPathSep( cDir ), "\", "/" ) ] := { "cFileName" => StrTran( cName, "\", "/" ) }
lAnyAddons := .T.
ENDIF
NEXT
/* Determine the mode of operation */
aParams := hb_AParams()
@@ -351,15 +335,13 @@ PROCEDURE GNUMake( ... )
cBinDir := GetEnv( "HB_HOST_BIN_DIR" ) + hb_ps()
OutStd( "! Calculating sorting order for contrib packages..." + hb_eol() )
OutStd( "! Calculating build order for packages..." + hb_eol() )
aPairList := {}
FOR EACH aProject IN s_hPackageList
FOR EACH hProject IN aProject
call_hbmk2_hbinfo( cBinDir, s_cBase + aProject:__enumKey() + "/" + hProject[ "cFileName" ], hProject )
DeptLinesToDeptPairList( aPairList, aProject:__enumKey(), hProject[ "aDept" ] )
NEXT
FOR EACH hProject IN s_hPackageList
call_hbmk2_hbinfo( cBinDir, s_cBase + hProject:__enumKey() + "/" + hProject[ "cFileName" ], hProject )
DeptLinesToDeptPairList( aPairList, hProject:__enumKey(), hProject[ "aDept" ] )
NEXT
aSortedList := TopoSort( aPairList )
@@ -385,50 +367,39 @@ PROCEDURE GNUMake( ... )
/* Start building */
OutStd( hb_StrFormat( "! Contribs %1$s...", hActions[ nAction ] ) + hb_eol() )
OutStd( hb_StrFormat( "! Package %1$s...", hActions[ nAction ] ) + hb_eol() )
FOR EACH cDir IN aSortedList DESCEND
FOR EACH cPackage IN aSortedList DESCEND
IF Empty( aFilter ) .OR. ;
iif( lFilterNegative,;
AScan( aFilter, {| tmp | tmp == cDir } ) == 0,;
AScan( aFilter, {| tmp | tmp == cDir } ) > 0 )
AScan( aFilter, {| tmp | tmp == cPackage } ) == 0,;
AScan( aFilter, {| tmp | tmp == cPackage } ) > 0 )
FOR EACH hProject IN s_hPackageList[ cDir ]
cProject := s_cBase + cPackage + "/" + s_hPackageList[ cPackage ][ "cFileName" ]
IF hProject[ "cType" ] $ "hbhrb|hbppo"
LOOP
ENDIF
call_hbmk2( cBinDir, cProject, cOptions, "" )
cProject := s_cBase + cDir + "/" + hProject[ "cFileName" ]
/* Highly experimental */
IF s_hPackageList[ cPackage ][ "cType" ] == "hblib" .AND. ;
GetEnv( "HB_BUILD_CONTRIB_DLL" ) == "yes" .AND. ;
hb_FileExists( PathSepToSelf( FNameExtSet( cProject, ".hbc" ) ) )
call_hbmk2( cBinDir, cProject, cOptions, "" )
/* Highly experimental */
IF hProject[ "cType" ] == "hblib" .AND. ;
GetEnv( "HB_BUILD_CONTRIB_DLL" ) == "yes" .AND. ;
hb_FileExists( PathSepToSelf( FNameExtSet( cProject, ".hbc" ) ) )
call_hbmk2( cBinDir, cProject, cOptions, " -hbdyn -nohblib- -implib " + FNameExtSet( cProject, ".hbc" ) )
ENDIF
NEXT
call_hbmk2( cBinDir, cProject, cOptions, " -hbdyn -nohblib- -implib " + FNameExtSet( cProject, ".hbc" ) )
ENDIF
/* Compile documentation */
IF nAction == _ACT_INC_INST .OR. ;
nAction == _ACT_INC_REBUILD_INST
mk_hbd( PathSepToSelf( cDir ) )
mk_hbd( PathSepToSelf( cPackage ) )
ENDIF
ELSE
/* OutStd( hb_StrFormat( "! package '%1$s' skipped due to custom filter", cDir ) + hb_eol() ) */
/* OutStd( hb_StrFormat( "! package '%1$s' skipped due to custom filter", cPackage ) + hb_eol() ) */
ENDIF
NEXT
OutStd( hb_eol() )
IF lAnyAddons
OutStd( "! Building of contrib and addon packages finished." + hb_eol() )
ELSE
OutStd( "! Building of contrib packages finished." + hb_eol() )
ENDIF
OutStd( "! Building of packages finished." + hb_eol() )
ErrorLevel( 0 )
@@ -453,16 +424,14 @@ STATIC FUNCTION call_hbmk2_hbinfo( cBinDir, cProject, hProject )
hProject[ "cType" ] := ""
hProject[ "aDept" ] := {}
hProject[ "lInc" ] := .F.
clear_hbmk2_envvars()
IF hb_processRun( PathSepToSelf( cBinDir ) + "hbmk2 --hbinfo " + StrTran( cProject, "\", "/" ),, @cStdOut ) == 0
hProject[ "cType" ] := hbmk2_hbinfo_getitem( cStdOut, "targettype" )
hProject[ "lInc" ] := ( hbmk2_hbinfo_getitem( cStdOut, "inc" ) == "yes" )
FOR EACH tmp IN hb_ATokens( hbmk2_hbinfo_getitem( cStdOut, "hbctree" ), Chr( 10 ) )
FOR EACH tmp IN hb_ATokens( hbmk2_hbinfo_getitem( cStdOut, "hbctree", .T. ), Chr( 10 ) )
IF ! Empty( tmp )
hb_FNameSplit( LTrim( tmp ), @cDir, @cName )
AAdd( hProject[ "aDept" ], { "nDepth" => Len( tmp ) - Len( LTrim( tmp ) ),;
@@ -476,17 +445,25 @@ STATIC FUNCTION call_hbmk2_hbinfo( cBinDir, cProject, hProject )
RETURN .F.
STATIC FUNCTION hbmk2_hbinfo_getitem( cString, cItem )
LOCAL nPos
STATIC FUNCTION hbmk2_hbinfo_getitem( cString, cItem, lAll )
LOCAL cRetVal := ""
LOCAL nPos := 1
LOCAL tmp
IF ( nPos := At( cItem + "{{", cString ) ) > 0
cString := SubStr( cString, nPos + Len( cItem + "{{" ) )
IF ( nPos := At( "}}", cString ) ) > 0
RETURN StrTran( Left( cString, nPos - 1 ), Chr( 13 ) )
DO WHILE ( tmp := hb_At( cItem + "{{", cString, nPos ) ) > 0
nPos := tmp + Len( cItem + "{{" )
IF ( tmp := hb_At( "}}", cString, nPos ) ) > 0
tmp := StrTran( SubStr( cString, nPos, tmp - nPos ), Chr( 13 ) )
IF lAll != NIL .AND. lAll
cRetVal += tmp
ELSE
/* Find the last occurrence, which is the root project */
cRetVal := tmp
ENDIF
ENDIF
ENDIF
ENDDO
RETURN ""
RETURN cRetVal
STATIC FUNCTION call_hbmk2( cBinDir, cProject, cOptionsPre, cOptionsPost )
LOCAL nErrorLevel
@@ -588,6 +565,14 @@ STATIC FUNCTION DirGetName( cDir )
RETURN cName
STATIC FUNCTION DirAddPathSep( cDir )
IF ! Empty( cDir ) .AND. !( Right( cDir, 1 ) == hb_ps() )
cDir += hb_ps()
ENDIF
RETURN cDir
STATIC FUNCTION DirDelPathSep( cDir )
IF Empty( hb_osDriveSeparator() )
@@ -604,13 +589,10 @@ STATIC FUNCTION DirDelPathSep( cDir )
RETURN cDir
STATIC FUNCTION PathSepToSelf( cFileName )
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS ) .OR. ;
defined( __PLATFORM__OS2 )
RETURN StrTran( cFileName, "/", "\" )
#else
RETURN StrTran( cFileName, "\", "/" )
#endif
RETURN StrTran( cFileName, iif( hb_ps() == "\", "/", "\" ), hb_ps() )
STATIC FUNCTION hb_pwd()
RETURN DirAddPathSep( hb_CurDrive() + hb_osDriveSeparator() + hb_ps() + CurDir() )
/* Convert indented list of line to tree / list of parent-child pairs */
STATIC PROCEDURE DeptLinesToDeptPairList( aPairList, cParent, aFlatTree )
@@ -693,35 +675,41 @@ STATIC FUNCTION TopoSort( aEdgeList )
RETURN aList
FUNCTION LoadPkgList( cFileName )
PROCEDURE AddPkg( hPackageList, cFileName )
LOCAL cDir
LOCAL cName
LOCAL cExt
LOCAL cFile := MemoRead( cFileName )
LOCAL cLine
LOCAL aItem
LOCAL xItem
IF ! Empty( cFileName )
LOCAL cPackageName
LOCAL hPackageList := { => }
hb_HKeepOrder( hPackageList, .T. )
cFile := StrTran( cFile, Chr( 13 ) )
FOR EACH cLine IN hb_ATokens( cFile, Chr( 10 ) )
IF "#" $ cLine
cLine := Left( cLine, At( "#", cLine ) - 1 )
hb_FNameSplit( PathSepToSelf( AllTrim( cFileName ) ), @cDir, @cName, @cExt )
IF Empty( cExt )
cExt := ".hbp"
ENDIF
IF ! Empty( cLine )
aItem := hb_ATokens( AllTrim( cLine ) )
IF Len( aItem ) >= 2
cPackageName := aItem[ 1 ]
hb_ADel( aItem, 1, .T. )
FOR EACH xItem IN aItem
xItem := { "cFileName" => FNameExtDef( StrTran( xItem, "\", "/" ), ".hbp" ) }
NEXT
hPackageList[ cPackageName ] := AClone( aItem )
ENDIF
hPackageList[ StrTran( DirDelPathSep( cDir ), "\", "/" ) ] := { "cFileName" => hb_FNameMerge(, cName, cExt ) }
ENDIF
RETURN
PROCEDURE LoadPkgListFromFile( hPackageList, cFileName )
LOCAL cFile := StrTran( MemoRead( cFileName ), Chr( 13 ) )
LOCAL cItem
FOR EACH cItem IN hb_ATokens( cFile, Chr( 10 ) )
IF "#" $ cItem
cItem := Left( cItem, At( "#", cItem ) - 1 )
ENDIF
AddPkg( hPackageList, cItem )
NEXT
RETURN hPackageList
RETURN
PROCEDURE LoadPkgListFromString( hPackageList, cString )
LOCAL cItem
FOR EACH cItem IN hb_ATokens( cString,, .T. )
AddPkg( hPackageList, cItem )
NEXT
RETURN

View File

@@ -2,52 +2,51 @@
# $Id$
#
gtalleg gtalleg.hbp gtallegs.hbp
gtwvg gtwvg.hbp
hbblat hbblat.hbp
hbblink hbblink.hbp
hbbz2 hbbz2.hbp # uses: bz2 (external)
hbcairo hbcairo.hbp
hbclipsm hbclipsm.hbp
hbcomm hbcomm.hbp
hbct hbct.hbp
hbcups hbcups.hbp
hbcurl hbcurl.hbp hbcurls.hbp
hbdoc2 hbdoc2.hbp
hbfbird hbfbird.hbp
hbfimage hbfimage.hbp
hbfoxpro hbfoxpro.hbp
hbfship hbfship.hbp
hbgd hbgd.hbp
hbgt hbgt.hbp
hbhpdf hbhpdf.hbp
hbide hbide.hbp
hbmemio hbmemio.hbp
hbmisc hbmisc.hbp
hbmysql hbmysql.hbp
hbmzip hbmzip.hbp # uses: minizip (external)
hbnetio hbnetio.hbp
hbnetio/utils hbnetio.hbp
hbnf hbnf.hbp
hbodbc hbodbc.hbp
hbpgsql hbpgsql.hbp
hbqt hbqt.hbp hbqts.hbp hbqtcore.hbp hbqtcores.hbp hbqtgui.hbp hbqtguis.hbp hbqtnetwork.hbp hbqtnetworks.hbp
hbsms hbsms.hbp
hbsqlit3 hbsqlit3.hbp # uses: sqlite3 (external)
hbssl hbssl.hbp hbssls.hbp
hbtip hbtip.hbp hbtipssl.hbp
hbtpathy hbtpathy.hbp
hbwin hbwin.hbp
hbxbp hbxbp.hbp
hbxpp hbxpp.hbp
hbziparc hbziparc.hbp
rddads rddads.hbp
rddbmcdx rddbmcdx.hbp
rddsql rddsql.hbp
sddfb sddfb.hbp
sddmy sddmy.hbp
sddoci sddoci.hbp
sddodbc sddodbc.hbp
sddpg sddpg.hbp
sddsqlt3 sddsqlt3.hbp # uses: sqlite3 (external)
xhb xhb.hbp
gtalleg/gtalleg.hbp
gtwvg/gtwvg.hbp
hbblat/hbblat.hbp
hbblink/hbblink.hbp
hbbz2/hbbz2.hbp # uses: bz2 (external)
hbcairo/hbcairo.hbp
hbclipsm/hbclipsm.hbp
hbcomm/hbcomm.hbp
hbct/hbct.hbp
hbcups/hbcups.hbp
hbcurl/hbcurl.hbp
hbfbird/hbfbird.hbp
hbfimage/hbfimage.hbp
hbfoxpro/hbfoxpro.hbp
hbfship/hbfship.hbp
hbgd/hbgd.hbp
hbgt/hbgt.hbp
hbhpdf/hbhpdf.hbp
hbide/hbide.hbp
hbmemio/hbmemio.hbp
hbmisc/hbmisc.hbp
hbmysql/hbmysql.hbp
hbmzip/hbmzip.hbp # uses: minizip (external)
hbnetio/hbnetio.hbp
hbnetio/utils/hbnetio.hbp
hbnf/hbnf.hbp
hbodbc/hbodbc.hbp
hbpgsql/hbpgsql.hbp
hbqt/hbqt.hbp
hbsms/hbsms.hbp
hbsqlit3/hbsqlit3.hbp # uses: sqlite3 (external)
hbssl/hbssl.hbp
hbtip/hbtip.hbp
hbtpathy/hbtpathy.hbp
hbwin/hbwin.hbp
hbxbp/hbxbp.hbp
hbxpp/hbxpp.hbp
hbziparc/hbziparc.hbp
rddads/rddads.hbp
rddbmcdx/rddbmcdx.hbp
rddsql/rddsql.hbp
sddfb/sddfb.hbp
sddmy/sddmy.hbp
sddoci/sddoci.hbp
sddodbc/sddodbc.hbp
sddpg/sddpg.hbp
sddsqlt3/sddsqlt3.hbp # uses: sqlite3 (external)
xhb/xhb.hbp

View File

@@ -223,6 +223,8 @@ REQUEST hbmk_KEYW
#define _HBMK_IMPLIB_EXE_POST "_exe"
#define _HBMK_IMPLIB_DLL_POST "_dll"
#define _HBMK_TARGENAME_ADHOC ".adhoc."
#define _HBMK_NEST_MAX 10
#define _HBMK_HEAD_NEST_MAX 10
@@ -403,7 +405,12 @@ REQUEST hbmk_KEYW
#define _HBMK_nCOMPVer 118
#define _HBMK_lDEPIMPLIB 119 /* Generate import libs configured in dependecy specification */
#define _HBMK_MAX_ 119
#define _HBMK_aArgs 120
#define _HBMK_nArgTarget 121
#define _HBMK_lPause 122
#define _HBMK_nLevel 123
#define _HBMK_MAX_ 123
#define _HBMK_DEP_CTRL_MARKER ".control." /* must be an invalid path */
@@ -436,10 +443,8 @@ REQUEST HB_REGEX
STATIC s_cSecToken := NIL
PROCEDURE Main( ... )
LOCAL aArgsIn := hb_AParams()
LOCAL aArgsProc := {}
LOCAL aArgsProc
LOCAL nResult
LOCAL cName
LOCAL tmp, tmp1
LOCAL lPause := hb_gtInfo( HB_GTI_ISGRAPHIC )
@@ -447,6 +452,7 @@ PROCEDURE Main( ... )
LOCAL aArgsTarget
LOCAL nTarget
LOCAL nTargetTODO
LOCAL nTargetPos
LOCAL lHadTarget
LOCAL lOldExact := Set( _SET_EXACT, .F. )
@@ -454,48 +460,12 @@ PROCEDURE Main( ... )
hb_FSetDevMode( hb_gtInfo( HB_GTI_OUTPUTFD ), FD_TEXT )
hb_FSetDevMode( hb_gtInfo( HB_GTI_ERRORFD ), FD_TEXT )
/* Emulate -hbcmp, -hbcc, -hblnk switches when certain
self names are detected.
For compatibility with hbmk script aliases. */
IF ! Empty( aArgsIn )
hb_FNameSplit( hb_argv( 0 ),, @cName )
tmp := Lower( cName )
IF Left( tmp, 1 ) == "x"
tmp := SubStr( tmp, 2 )
AAdd( aArgsProc, "-xhb" )
ELSEIF Right( tmp, 2 ) == "10"
AAdd( aArgsProc, "-hb10" )
ENDIF
DO CASE
CASE Right( tmp, 5 ) == "hbcmp" .OR. ;
Left( tmp, 5 ) == "hbcmp" .OR. ;
tmp == "clipper" ; AAdd( aArgsProc, "-hbcmp" )
CASE Right( tmp, 4 ) == "hbcc" .OR. ;
Left( tmp, 4 ) == "hbcc" ; AAdd( aArgsProc, "-hbcc" )
CASE Right( tmp, 5 ) == "hblnk" .OR. ;
Left( tmp, 5 ) == "hblnk" ; AAdd( aArgsProc, "-hblnk" )
CASE tmp == "rtlink" .OR. ;
tmp == "exospace" .OR. ;
tmp == "blinker" ; AAdd( aArgsProc, "-rtlink" )
CASE Right( tmp, 5 ) == "hbexe" .OR. ;
Left( tmp, 5 ) == "hbexe" ; AAdd( aArgsProc, "-hbexe" )
CASE Right( tmp, 5 ) == "hblib" .OR. ;
Left( tmp, 5 ) == "hblib" ; AAdd( aArgsProc, "-hblib" )
CASE Right( tmp, 5 ) == "hbdyn" .OR. ;
Left( tmp, 5 ) == "hbdyn" ; AAdd( aArgsProc, "-hbdyn" )
ENDCASE
ENDIF
/* Expand wildcard project specs */
FOR EACH tmp IN aArgsIn
aArgsProc := {}
FOR EACH tmp IN hb_AParams()
DO CASE
CASE !( Left( tmp, 1 ) == "-" ) .AND. ( Lower( FNameExtGet( tmp ) ) == ".hbp" .OR. Lower( FNameExtGet( tmp ) ) == ".hbi" )
CASE !( Left( tmp, 1 ) $ "-@" ) .AND. Lower( FNameExtGet( tmp ) ) == ".hbp"
FOR EACH tmp1 IN FN_Expand( tmp, .T. )
AAdd( aArgsProc, tmp1 )
NEXT
@@ -508,6 +478,43 @@ PROCEDURE Main( ... )
ENDCASE
NEXT
/* Emulate -hbcmp, -hbcc, -hblnk switches when certain
self names are detected.
For compatibility with hbmk script aliases. */
IF ! Empty( aArgsProc )
hb_FNameSplit( hb_argv( 0 ),, @tmp )
tmp := Lower( tmp )
IF Left( tmp, 1 ) == "x"
tmp := SubStr( tmp, 2 )
hb_AIns( aArgsProc, 1, "-xhb", .T. )
ELSEIF Right( tmp, 2 ) == "10"
hb_AIns( aArgsProc, 1, "-hb10", .T. )
ENDIF
DO CASE
CASE Right( tmp, 5 ) == "hbcmp" .OR. ;
Left( tmp, 5 ) == "hbcmp" .OR. ;
tmp == "clipper" ; hb_AIns( aArgsProc, 1, "-hbcmp", .T. )
CASE Right( tmp, 4 ) == "hbcc" .OR. ;
Left( tmp, 4 ) == "hbcc" ; hb_AIns( aArgsProc, 1, "-hbcc", .T. )
CASE Right( tmp, 5 ) == "hblnk" .OR. ;
Left( tmp, 5 ) == "hblnk" ; hb_AIns( aArgsProc, 1, "-hblnk", .T. )
CASE tmp == "rtlink" .OR. ;
tmp == "exospace" .OR. ;
tmp == "blinker" ; hb_AIns( aArgsProc, 1, "-rtlink", .T. )
CASE Right( tmp, 5 ) == "hbexe" .OR. ;
Left( tmp, 5 ) == "hbexe" ; AAdd( aArgsProc, "-hbexe" )
CASE Right( tmp, 5 ) == "hblib" .OR. ;
Left( tmp, 5 ) == "hblib" ; AAdd( aArgsProc, "-hblib" )
CASE Right( tmp, 5 ) == "hbdyn" .OR. ;
Left( tmp, 5 ) == "hbdyn" ; AAdd( aArgsProc, "-hbdyn" )
ENDCASE
ENDIF
/* Handle multitarget command lines */
nTargetTODO := 1
@@ -515,25 +522,25 @@ PROCEDURE Main( ... )
aArgsTarget := {}
nTarget := 0
nTargetPos := 0
lHadTarget := .F.
FOR EACH tmp IN aArgsProc
DO CASE
CASE !( Left( tmp, 1 ) == "-" ) .AND. ( Lower( FNameExtGet( tmp ) ) == ".hbp" .OR. Lower( FNameExtGet( tmp ) ) == ".hbi" ) .AND. ! lHadTarget
CASE !( Left( tmp, 1 ) $ "-@" ) .AND. ;
Lower( FNameExtGet( tmp ) ) == ".hbp" .AND. ;
! lHadTarget
++nTarget
IF nTarget == nTargetTODO
AAdd( aArgsTarget, tmp )
nTargetPos := Len( aArgsTarget )
ENDIF
CASE Lower( Left( tmp, Len( "-target=" ) ) ) == "-target="
++nTarget
IF nTarget == nTargetTODO
AAdd( aArgsTarget, SubStr( tmp, Len( "-target=" ) + 1 ) )
nTargetPos := Len( aArgsTarget )
ENDIF
CASE Lower( tmp ) == "-target"
++nTarget
lHadTarget := .T.
CASE Lower( tmp ) == "-alltarget"
lHadTarget := .F.
OTHERWISE
IF ! lHadTarget .OR. nTarget == nTargetTODO
AAdd( aArgsTarget, tmp )
@@ -547,7 +554,7 @@ PROCEDURE Main( ... )
ENDIF
/* Build one target */
nResult := hbmk2( aArgsTarget, @lPause )
nResult := hbmk2( aArgsTarget, nTargetPos, @lPause, 1 )
/* Exit on first failure */
IF nResult != 0
@@ -634,7 +641,7 @@ STATIC PROCEDURE hbmk_COMP_Setup( cARCH, cCOMP, cBasePath )
RETURN
FUNCTION hbmk2( aArgs, /* @ */ lPause )
FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel )
LOCAL hbmk[ _HBMK_MAX_ ]
@@ -893,6 +900,11 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
hbmk[ _HBMK_hDEPTSDIR ] := { => }
hbmk[ _HBMK_aArgs ] := aArgs
hbmk[ _HBMK_nArgTarget ] := nArgTarget
hbmk[ _HBMK_lPause ] := lPause
hbmk[ _HBMK_nLevel ] := nLevel
GetUILangCDP( @hbmk[ _HBMK_cUILNG ], @hbmk[ _HBMK_cUICDP ] )
SetUILang( hbmk )
@@ -1023,6 +1035,17 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
ENDCASE
NEXT
IF nLevel > _HBMK_NEST_MAX
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Cannot nest projects deeper than %1$s levels" ), hb_ntos( _HBMK_NEST_MAX ) ) )
RETURN 30
ENDIF
IF nLevel > 1
IF ! hbmk[ _HBMK_lQuiet ]
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Building sub-project: %1$s (level %2$s)" ), hbmk[ _HBMK_aArgs ][ hbmk[ _HBMK_nArgTarget ] ], hb_ntos( nLevel ) ) )
ENDIF
ENDIF
IF ! Empty( cEnv )
IF ! hbmk[ _HBMK_lQuiet ]
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Processing environment options: %1$s" ), cEnv ) )
@@ -1748,34 +1771,42 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
IF ! hbmk[ _HBMK_lQuiet ]
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Processing local make script: %1$s" ), _HBMK_AUTOHBM_NAME ) )
ENDIF
HBM_Load( hbmk, aParams, _HBMK_AUTOHBM_NAME, 1 )
HBM_Load( hbmk, aParams, _HBMK_AUTOHBM_NAME, 1, .F. ) /* Do not allow subprojects in automatic make file */
ENDIF
/* Collect all command line parameters */
FOR EACH cParam IN aArgs
DO CASE
CASE !( Left( cParam, 1 ) == "-" ) .AND. Len( cParam ) >= 1 .AND. Left( cParam, 1 ) == "@" .AND. ;
!( Lower( FNameExtGet( cParam ) ) == ".clp" )
cParam := SubStr( cParam, 2 )
IF Empty( FNameExtGet( cParam ) )
cParam := FNameExtSet( cParam, ".hbm" )
ENDIF
IF !( Lower( FNameExtGet( cParam ) ) == ".hbm" ) .AND. lAcceptLDClipper
rtlnk_process( hbmk, MemoRead( PathSepToSelf( cParam ) ), @hbmk[ _HBMK_cPROGNAME ], @hbmk[ _HBMK_aOBJUSER ], @hbmk[ _HBMK_aLIBUSER ] )
IF ! Empty( hbmk[ _HBMK_aOBJUSER ] )
DEFAULT hbmk[ _HBMK_cFIRST ] TO hbmk[ _HBMK_aOBJUSER ][ 1 ]
cParam := ArchCompFilter( hbmk, cParam )
IF ! Empty( cParam )
DO CASE
CASE !( Left( cParam, 1 ) == "-" ) .AND. Len( cParam ) >= 1 .AND. Left( cParam, 1 ) == "@" .AND. ;
!( Lower( FNameExtGet( cParam ) ) == ".clp" )
cParam := SubStr( cParam, 2 )
IF Empty( FNameExtGet( cParam ) )
cParam := FNameExtSet( cParam, ".hbm" )
ENDIF
ELSE
HBM_Load( hbmk, aParams, PathSepToSelf( cParam ), 1 ) /* Load parameters from script file */
ENDIF
CASE !( Left( cParam, 1 ) == "-" ) .AND. ;
( Lower( FNameExtGet( cParam ) ) == ".hbm" .OR. ;
Lower( FNameExtGet( cParam ) ) == ".hbp" .OR. ;
Lower( FNameExtGet( cParam ) ) == ".hbi" )
HBM_Load( hbmk, aParams, PathSepToSelf( cParam ), 1 ) /* Load parameters from script file */
OTHERWISE
AAdd( aParams, { cParam, "", 0 } )
ENDCASE
IF !( Lower( FNameExtGet( cParam ) ) == ".hbm" ) .AND. lAcceptLDClipper
rtlnk_process( hbmk, MemoRead( PathSepToSelf( cParam ) ), @hbmk[ _HBMK_cPROGNAME ], @hbmk[ _HBMK_aOBJUSER ], @hbmk[ _HBMK_aLIBUSER ] )
IF ! Empty( hbmk[ _HBMK_aOBJUSER ] )
DEFAULT hbmk[ _HBMK_cFIRST ] TO hbmk[ _HBMK_aOBJUSER ][ 1 ]
ENDIF
ELSE
tmp := HBM_Load( hbmk, aParams, PathSepToSelf( cParam ), 1, .T. ) /* Load parameters from script file */
IF tmp != 0
RETURN tmp
ENDIF
ENDIF
CASE !( Left( cParam, 1 ) == "-" ) .AND. ;
( Lower( FNameExtGet( cParam ) ) == ".hbm" .OR. ;
Lower( FNameExtGet( cParam ) ) == ".hbp" )
tmp := HBM_Load( hbmk, aParams, PathSepToSelf( cParam ), 1, .T. ) /* Load parameters from script file */
IF tmp != 0
RETURN tmp
ENDIF
OTHERWISE
AAdd( aParams, { cParam, "", 0 } )
ENDCASE
ENDIF
NEXT
/* Process automatic control files. */
@@ -1784,7 +1815,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
/* Process command line (2nd pass) */
FOR EACH aParam IN aParams
cParam := ArchCompFilter( hbmk, aParam[ _PAR_cParam ] )
cParam := aParam[ _PAR_cParam ]
cParamL := Lower( cParam )
DO CASE
@@ -1946,7 +1977,12 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
CASE cParamL == "-cpp-" .OR. ;
cParamL == "-nocpp" ; hbmk[ _HBMK_lCPP ] := .F.
CASE cParamL == "-run" ; hbmk[ _HBMK_lRUN ] := .T.
CASE cParamL == "-run"
IF hbmk[ _HBMK_nLevel ] == 1
hbmk[ _HBMK_lRUN ] := .T.
ENDIF
CASE cParamL == "-run-" .OR. ;
cParamL == "-norun" ; hbmk[ _HBMK_lRUN ] := .F.
CASE cParamL == "-trace" ; hbmk[ _HBMK_lTRACE ] := .T.
@@ -4441,7 +4477,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
IF lDumpInfo
OutStd( "targettype{{" + hbmk_TARGET( hbmk ) + "}}" + hb_eol() )
OutStd( "{{{" + hb_eol() )
OutStd( "targetname{{" + hbmk_TARGETNAME( hbmk ) + "}}" + hb_eol() )
OutStd( "targettype{{" + hbmk_TARGETTYPE( hbmk ) + "}}" + hb_eol() )
OutStd( "inc{{" + iif( hbmk[ _HBMK_lINC ], "yes", "no" ) + "}}" + hb_eol() )
OutStd( "hbctree{{" + hb_eol() )
@@ -4449,6 +4487,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
OutStd( Replicate( Chr( 9 ), tmp[ 2 ] ) + PathSepToForward( PathNormalize( tmp[ 1 ] ) ) + hb_eol() )
NEXT
OutStd( "}}" + hb_eol() )
OutStd( "}}}" + hb_eol() )
RETURN 0
ENDIF
@@ -5734,15 +5773,8 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
/* Setup compressor for host platform */
#if defined( __PLATFORM__UNIX )
cBin_Cprs := "upx"
cOpt_Cprs := "{OB}"
cOpt_CprsMin := "-1"
cOpt_CprsMax := "-9"
#elif defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS )
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS )
cBin_Cprs := "upx.exe"
cOpt_Cprs := "{OB}"
@@ -5755,6 +5787,13 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
cOpt_Cprs += " --force-execve"
ENDIF
#elif defined( __PLATFORM__UNIX )
cBin_Cprs := "upx"
cOpt_Cprs := "{OB}"
cOpt_CprsMin := "-1"
cOpt_CprsMax := "-9"
#else
cBin_Cprs := NIL
@@ -7264,8 +7303,8 @@ STATIC FUNCTION PlugIn_make_ctx( hbmk, cState )
"cCOMP" => hbmk[ _HBMK_cCOMP ] ,;
"cCPU" => hbmk[ _HBMK_cCPU ] ,;
"cBUILD" => hbmk[ _HBMK_cBUILD ] ,;
"cTARGETTYPE" => hbmk_TARGET( hbmk ) ,;
"cTARGETNAME" => hbmk[ _HBMK_cPROGNAME ] ,;
"cTARGETTYPE" => hbmk_TARGETTYPE( hbmk ) ,;
"lREBUILD" => hbmk[ _HBMK_lREBUILD ] ,;
"lCLEAN" => hbmk[ _HBMK_lCLEAN ] ,;
"lDEBUG" => hbmk[ _HBMK_lDEBUG ] ,;
@@ -7853,13 +7892,8 @@ STATIC FUNCTION PathSepToForward( cFileName )
RETURN StrTran( cFileName, "\", "/" )
STATIC FUNCTION PathSepToSelf( cFileName, nStart )
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS ) .OR. ;
defined( __PLATFORM__OS2 )
RETURN iif( nStart == NIL, StrTran( cFileName, "/", "\" ), Left( cFileName, nStart - 1 ) + StrTran( SubStr( cFileName, nStart ), "/", "\" ) )
#else
RETURN iif( nStart == NIL, StrTran( cFileName, "\", "/" ), Left( cFileName, nStart - 1 ) + StrTran( SubStr( cFileName, nStart ), "\", "/" ) )
#endif
RETURN iif( nStart == NIL, StrTran( cFileName, iif( hb_ps() == "\", "/", "\" ), hb_ps() ),;
Left( cFileName, nStart - 1 ) + StrTran( SubStr( cFileName, nStart ), iif( hb_ps() == "\", "/", "\" ), hb_ps() ) )
STATIC FUNCTION PathSepToTarget( hbmk, cFileName, nStart )
@@ -8709,10 +8743,13 @@ STATIC FUNCTION ValueIsF( cString )
RETURN cString == "no" .OR. ;
cString == "0" /* Compatibility */
STATIC PROCEDURE HBM_Load( hbmk, aParams, cFileName, nNestingLevel )
STATIC FUNCTION HBM_Load( hbmk, aParams, cFileName, nNestingLevel, lProcHBP )
LOCAL cFile
LOCAL cLine
LOCAL cParam
LOCAL aArgs
LOCAL nResult
LOCAL cHBP
IF hb_FileExists( cFileName )
@@ -8728,11 +8765,11 @@ STATIC PROCEDURE HBM_Load( hbmk, aParams, cFileName, nNestingLevel )
FOR EACH cLine IN hb_ATokens( cFile, _CHR_EOL )
IF !( Left( cLine, 1 ) == "#" )
FOR EACH cParam IN hb_ATokens( cLine,, .T. )
cParam := StrStripQuote( cParam )
cParam := ArchCompFilter( hbmk, StrStripQuote( cParam ) )
IF ! Empty( cParam )
DO CASE
CASE Lower( cParam ) == "-skip"
RETURN
RETURN 0
CASE !( Left( cParam, 1 ) == "-" ) .AND. Len( cParam ) >= 1 .AND. Left( cParam, 1 ) == "@" .AND. ;
!( Lower( FNameExtGet( cParam ) ) == ".clp" )
IF nNestingLevel < _HBMK_NEST_MAX
@@ -8740,19 +8777,45 @@ STATIC PROCEDURE HBM_Load( hbmk, aParams, cFileName, nNestingLevel )
IF Empty( FNameExtGet( cParam ) )
cParam := FNameExtSet( cParam, ".hbm" )
ENDIF
HBM_Load( hbmk, aParams, PathMakeAbsolute( PathSepToSelf( cParam ), cFileName ), nNestingLevel + 1 ) /* Load parameters from script file */
/* TODO: Modify '@script.ext' (@ prefixes) inclusion to not inherit path from parent */
nResult := HBM_Load( hbmk, aParams, PathMakeAbsolute( PathSepToSelf( cParam ), cFileName ), nNestingLevel + 1, .T. ) /* Load parameters from script file */
IF nResult != 0
RETURN nResult
ENDIF
ELSE
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Cannot nest deeper in %1$s" ), cFileName ) )
ENDIF
CASE !( Left( cParam, 1 ) == "-" ) .AND. ;
( Lower( FNameExtGet( cParam ) ) == ".hbm" .OR. ;
Lower( FNameExtGet( cParam ) ) == ".hbp" .OR. ;
Lower( FNameExtGet( cParam ) ) == ".hbi" )
Lower( FNameExtGet( cParam ) ) == ".hbm"
IF nNestingLevel < _HBMK_NEST_MAX
HBM_Load( hbmk, aParams, PathMakeAbsolute( PathSepToSelf( cParam ), cFileName ), nNestingLevel + 1 ) /* Load parameters from script file */
nResult := HBM_Load( hbmk, aParams, PathMakeAbsolute( PathSepToSelf( cParam ), cFileName ), nNestingLevel + 1, .T. ) /* Load parameters from script file */
IF nResult != 0
RETURN nResult
ENDIF
ELSE
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Cannot nest deeper in %1$s" ), cFileName ) )
ENDIF
CASE !( Left( cParam, 1 ) == "-" ) .AND. ;
Lower( FNameExtGet( cParam ) ) == ".hbp"
cHBP := PathMakeAbsolute( PathSepToSelf( cParam ), cFileName )
IF lProcHBP
IF hbmk[ _HBMK_nArgTarget ] > 0
IF hb_FileExists( cHBP )
aArgs := AClone( hbmk[ _HBMK_aArgs ] )
aArgs[ hbmk[ _HBMK_nArgTarget ] ] := cHBP
nResult := hbmk2( aArgs, hbmk[ _HBMK_nArgTarget ], @hbmk[ _HBMK_lPause ], hbmk[ _HBMK_nLevel ] + 1 )
IF nResult != 0
RETURN nResult
ENDIF
ELSE
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Project reference (%1$s) ignored. File not found." ), cHBP ) )
ENDIF
ELSE
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Project reference (%1$s) ignored. Project references require hbmk2 to be invoced with a main project." ), cHBP ) )
ENDIF
ELSE
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Project reference (%1$s) ignored in automatic make file: %2$s" ), cHBP, cFileName ) )
ENDIF
OTHERWISE
AAdd( aParams, { cParam, cFileName, cLine:__enumIndex() } )
ENDCASE
@@ -8764,7 +8827,7 @@ STATIC PROCEDURE HBM_Load( hbmk, aParams, cFileName, nNestingLevel )
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: File cannot be found: %1$s" ), cFileName ) )
ENDIF
RETURN
RETURN 0
/* Filter microformat:
{[!][<plat|comp>]['&'|'|'][...]}
@@ -8925,6 +8988,10 @@ STATIC FUNCTION MacroGet( hbmk, cMacro, cFileName )
cMacro := hb_pwd() ; EXIT
CASE "HB_TEMPDIR"
cMacro := hb_DirTemp() ; EXIT
CASE "HB_TARGETNAME"
cMacro := FNameNameGet( PathSepToSelf( hbmk_TARGETNAME( hbmk ) ) ) ; EXIT
CASE "HB_TARGETTYPE"
cMacro := hbmk_TARGETTYPE( hbmk ) ; EXIT
CASE "HB_PLAT"
CASE "HB_PLATFORM"
CASE "HB_ARCH" /* Compatibility */
@@ -10109,7 +10176,10 @@ STATIC FUNCTION VCSID( cDir, cVCSHEAD, /* @ */ cType )
RETURN cResult
STATIC FUNCTION hbmk_TARGET( hbmk )
STATIC FUNCTION hbmk_TARGETNAME( hbmk )
RETURN iif( hbmk[ _HBMK_nArgTarget ] == 0, _HBMK_TARGENAME_ADHOC, PathSepToForward( hbmk[ _HBMK_aArgs ][ hbmk[ _HBMK_nArgTarget ] ] ) )
STATIC FUNCTION hbmk_TARGETTYPE( hbmk )
IF hbmk[ _HBMK_lCreateLib ] ; RETURN "hblib"
ELSEIF hbmk[ _HBMK_lCreateDyn ] .AND. ! hbmk[ _HBMK_lDynVM ] ; RETURN "hbdyn"
@@ -10187,7 +10257,7 @@ FUNCTION hbmk_KEYW( hbmk, cKeyword, cValue, cOperator )
RETURN .T.
ENDIF
IF cKeyword == hbmk_TARGET( hbmk )
IF cKeyword == hbmk_TARGETTYPE( hbmk )
RETURN .T.
ENDIF
@@ -10861,9 +10931,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong )
NIL,;
{ "Options below are available on command line only:" },;
NIL,;
{ "-target=<script>" , I_( "specify a new build target. <script> can be .prg (or no extension) or .hbm/.hbp/.hbi file" ) },;
{ "-target" , I_( "marks beginning of options belonging to a new build target" ) },;
{ "-alltarget" , I_( "marks beginning of common options belonging to all targets" ) },;
{ "-target=<script>" , I_( "specify a new build target. <script> can be .prg (or no extension) or .hbp file. Please note that .hbp files are automatically considered as separate targets." ) },;
NIL,;
{ "-env:<e>[<o>[<v>]]" , I_( "alter local environment. <e> is the name of the environment variable to alter. <o> can be '=' to set/override, '-' to delete, '+' to append to the end of existing value, '#' to insert to the beginning of existing value. <v> is the value to set/append/insert. If multiple options are passed, they are processed from left to right." ) },;
NIL,;
@@ -10902,7 +10970,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong )
I_( "Notes:" ) }
LOCAL aNotes := {;
I_( "<script> can be:\n <@script> or <script.hbm>: command line options in file\n <script.hbp>: command line options in file, it also marks a new target if specified on the command line\n <script.hbi>: command line options in file (used to create import libraries), it also marks a new target if specified on the command line\n <script.hbc>: package configuration file" ),;
I_( "<script> can be:\n <@script> or <script.hbm>: command line options in file\n <script.hbp>: command line options in file, it also marks a new target if specified on the command line\n <script.hbc>: package configuration file" ),;
I_( "Multiple -l, -L and <script> parameters are accepted." ),;
I_( "Regular Harbour compiler options are also accepted.\n(see them with -harbourhelp option)" ),;
hb_StrFormat( I_( "%1$s option file in hbmk2 directory is always processed if it exists. On *nix platforms ~/.harbour, /etc/harbour, <base>/etc/harbour, <base>/etc are checked (in that order) before the hbmk2 directory." ), _HBMK_AUTOHBC_NAME ),;

View File

@@ -79,6 +79,7 @@ STATIC s_nCol := 0
STATIC s_aIncDir := {}
STATIC s_aHistory := {}
STATIC s_lPreserveHistory := .T.
STATIC s_lWasLoad := .F.
/* ********************************************************************** */
@@ -403,6 +404,8 @@ STATIC PROCEDURE hbrun_HistoryLoad()
LOCAL cHistory
LOCAL cLine
s_lWasLoad := .T.
IF s_lPreserveHistory
cHistory := StrTran( MemoRead( hbrun_HistoryFileName() ), Chr( 13 ) )
IF Left( cHistory, Len( _HISTORY_DISABLE_LINE + Chr( 10 ) ) ) == _HISTORY_DISABLE_LINE + Chr( 10 )
@@ -422,7 +425,7 @@ STATIC PROCEDURE hbrun_HistorySave()
LOCAL cHistory
LOCAL cLine
IF s_lPreserveHistory
IF s_lWasLoad .AND. s_lPreserveHistory
cHistory := ""
FOR EACH cLine IN s_aHistory
IF !( Lower( AllTrim( cLine ) ) == "quit" )