2010-07-05 19:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ -clean will now delete the target for -hbdyn, -hblib and default
-hbexe modes. .bak is also deleted for -hblib mode.
Probably more autogenerated extensions will have to be deleted
here to become in sync with globsh.mk.
+ Extended -instfile and -instpath support to also accept
a file group prefix. This way multiple set of files can be
copied to a set of target directories.
; TODO: Change all -instfile options to point to 'inc' group.
+ dos/djgpp will now use -gstabs+ for debug mode instead of -g.
Following change made in GNU Make system by Tamas.
* contrib/makefile.hbs
+ Reworked the way GNU Make operations are mapped to hbmk2
actions. F.e. 'clean install' needs special attention as
plain clean cannot be done because
+ Added hbblat to limited set of test contribs.
+ Better isolation and preparation of hbmk2 configuration.
+ Cleanups to dynamic lib creation from contribs.
+ Added experimental support to install headers similarly
as GNU Make does.
* Makefile
! Fixed to reverse order and dependency of contrib and utils
trees in clean without install mode. In pure clean mode,
the contribs need to be traversed first, because hbrun and
hbmk2 are required for this task.
* Makefile
* contrib/Makefile
+ Will now inform about missing hbrun and .hbs scripts not
run because of it.
* examples/hbapollo/hbapollo.hbp
* -instfile updated with header file group.
* src/rtl/hbproces.c
! Fixed some unused variable warnings experienced with poccarm.
; Patches from Tamas Tevesz:
* config/dos/djgpp.mk
+ debug switch changed to -gstabs+ from -g. Following this:
http://www.delorie.com/djgpp//mail-archives/thread.cgi?msg=djgpp-workers/2002/05/29/06:33:31&mode=frames
* bin/hbxpatch.hbs
* Updated after latest changes. Thanks!
* src/common/hbver.c
! Fix for pcc detection.
* src/rtl/gtdos/gtdos.c
* src/rtl/hbproces.c
! MS-DOS fixes for TRACE() messages.
This commit is contained in:
@@ -16,6 +16,62 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2010-07-05 19:12 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ -clean will now delete the target for -hbdyn, -hblib and default
|
||||
-hbexe modes. .bak is also deleted for -hblib mode.
|
||||
Probably more autogenerated extensions will have to be deleted
|
||||
here to become in sync with globsh.mk.
|
||||
+ Extended -instfile and -instpath support to also accept
|
||||
a file group prefix. This way multiple set of files can be
|
||||
copied to a set of target directories.
|
||||
; TODO: Change all -instfile options to point to 'inc' group.
|
||||
+ dos/djgpp will now use -gstabs+ for debug mode instead of -g.
|
||||
Following change made in GNU Make system by Tamas.
|
||||
|
||||
* contrib/makefile.hbs
|
||||
+ Reworked the way GNU Make operations are mapped to hbmk2
|
||||
actions. F.e. 'clean install' needs special attention as
|
||||
plain clean cannot be done because
|
||||
+ Added hbblat to limited set of test contribs.
|
||||
+ Better isolation and preparation of hbmk2 configuration.
|
||||
+ Cleanups to dynamic lib creation from contribs.
|
||||
+ Added experimental support to install headers similarly
|
||||
as GNU Make does.
|
||||
|
||||
* Makefile
|
||||
! Fixed to reverse order and dependency of contrib and utils
|
||||
trees in clean without install mode. In pure clean mode,
|
||||
the contribs need to be traversed first, because hbrun and
|
||||
hbmk2 are required for this task.
|
||||
|
||||
* Makefile
|
||||
* contrib/Makefile
|
||||
+ Will now inform about missing hbrun and .hbs scripts not
|
||||
run because of it.
|
||||
|
||||
* examples/hbapollo/hbapollo.hbp
|
||||
* -instfile updated with header file group.
|
||||
|
||||
* src/rtl/hbproces.c
|
||||
! Fixed some unused variable warnings experienced with poccarm.
|
||||
|
||||
; Patches from Tamas Tevesz:
|
||||
|
||||
* config/dos/djgpp.mk
|
||||
+ debug switch changed to -gstabs+ from -g. Following this:
|
||||
http://www.delorie.com/djgpp//mail-archives/thread.cgi?msg=djgpp-workers/2002/05/29/06:33:31&mode=frames
|
||||
|
||||
* bin/hbxpatch.hbs
|
||||
* Updated after latest changes. Thanks!
|
||||
|
||||
* src/common/hbver.c
|
||||
! Fix for pcc detection.
|
||||
|
||||
* src/rtl/gtdos/gtdos.c
|
||||
* src/rtl/hbproces.c
|
||||
! MS-DOS fixes for TRACE() messages.
|
||||
|
||||
2010-07-05 08:24 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/qth/QList.qth
|
||||
+ Uncommented few methods.
|
||||
@@ -31,7 +87,7 @@
|
||||
2010-07-05 00:20 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbqt/generator/hbqtgen.prg
|
||||
+ Implemented: QList support for Q* data types as return value.
|
||||
Still I could not find a dynamic way to pass it as an
|
||||
Still I could not find a dynamic way to pass it as an
|
||||
argument to a function. This feature enables to harness
|
||||
Qt's power to greater extent.
|
||||
|
||||
@@ -128,15 +184,6 @@
|
||||
; Now the contrib and examples .hbp files are completely on the same
|
||||
feature level.
|
||||
|
||||
2010-07-05 00:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* utils/hbmk2/hbmk2.pt_BR.po
|
||||
* utils/hbmk2/hbmk2.hu_HU.po
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ Added -instfile= option, instfiles= .hbc option and plugin API.
|
||||
They server to add files to the list of files which are copied
|
||||
to -instpath. This only works if -instpath= points to a dir
|
||||
(not a file).
|
||||
|
||||
2010-07-05 00:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ -width=0 now means unlimited width.
|
||||
|
||||
@@ -14,14 +14,34 @@ ifeq ($(HB_BUILD_PARTS),compiler)
|
||||
|
||||
else
|
||||
|
||||
# When doing a plain clean, we must not clean hbrun and hbmk2
|
||||
# before calling it to clean the contrib area.
|
||||
_CONTRIB_FIRST :=
|
||||
ifneq ($(filter clean,$(HB_MAKECMDGOALS)),)
|
||||
ifeq ($(filter install,$(HB_MAKECMDGOALS)),)
|
||||
_CONTRIB_FIRST := yes
|
||||
endif
|
||||
endif
|
||||
|
||||
DIRS := \
|
||||
doc \
|
||||
include \
|
||||
external \
|
||||
src{external} \
|
||||
utils{src} \
|
||||
contrib{src} \
|
||||
src{external}
|
||||
|
||||
ifeq ($(_CONTRIB_FIRST),yes)
|
||||
|
||||
DIRS += \
|
||||
contrib{src} \
|
||||
utils{contrib} \
|
||||
|
||||
else
|
||||
|
||||
DIRS += \
|
||||
utils{src} \
|
||||
contrib{utils} \
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(ROOT)config/dir.mk
|
||||
@@ -37,5 +57,5 @@ else
|
||||
endif
|
||||
|
||||
install::
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)config/postinst.hbs,)
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)config/postinst.hbs,@$(ECHO) $(ECHOQUOTE)! Warning: hbrun not found, config/postinst.hbs not run.$(ECHOQUOTE))
|
||||
$(if $(wildcard $(HB_POSTINST)),+$(HB_POSTINST),)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* patchup - a tool to help update external components while keeping local fixes
|
||||
* hbxpatch - a tool to help update external components while keeping local fixes
|
||||
*
|
||||
* Copyright 2010 Tamas Tevesz
|
||||
* See COPYING for licensing terms.
|
||||
@@ -15,14 +15,15 @@
|
||||
* For proper operation, the following external tools are required to be present
|
||||
* somewhere in your $PATH:
|
||||
*
|
||||
* - The GNU version of `patch', `diff' and `tar' (patchup will figure it out
|
||||
* - The GNU version of `patch', `diff' and `tar' (hbxpatch will figure it out
|
||||
* if you have them by the names of `gpatch', `gdiff' or `gtar')
|
||||
*
|
||||
* - curl, gzip, bzip2 and unzip (only the Info-ZIP version of unzip has been
|
||||
* tested)
|
||||
*
|
||||
* patchup requires several meta data (in the form of specially formatted lines)
|
||||
* in the component's Makefile or .hbp file. Formatting rules are as follows:
|
||||
* hbxpatch requires several meta data (in the form of specially formatted lines)
|
||||
* in the component's Makefile (preferred) or .hbp file (if no Makefile is
|
||||
* present). Formatting rules are as follows:
|
||||
*
|
||||
* - The first character on the line is a hash mark (`#'), followed by any number
|
||||
* of white spaces.
|
||||
@@ -48,13 +49,13 @@
|
||||
*
|
||||
* URL
|
||||
* Takes one argument, the URL to the archive to the currently installed
|
||||
* version of the component. Used by patchup.
|
||||
* version of the component. Used by hbxpatch.
|
||||
* Example: for PCRE, at the time of this writing, it is
|
||||
* `ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.02.zip'.
|
||||
* patchup can currently unpack only `tar.gz', `tar.bz2', `tgz', `tbz',
|
||||
* hbxpatch can currently unpack only `tar.gz', `tar.bz2', `tgz', `tbz',
|
||||
* `tbz2' or `zip' archives -- one of these must be chosen.
|
||||
*
|
||||
* patchup will also use the URL parameter to figure out what type of
|
||||
* hbxpatch will also use the URL parameter to figure out what type of
|
||||
* file it is working with, so a URL containing this sort if information must
|
||||
* be picked. As an example, SourceForge-style distributed download URLs like
|
||||
* `http://sourceforge.net/projects/libpng/files/01-libpng-master/1.4.2/lpng142.zip/download'
|
||||
@@ -76,14 +77,14 @@
|
||||
* trees, it is sufficient to specify it only once, but every file that needs
|
||||
* to be brought over to the Harbour tree must be specified.
|
||||
* The very first `MAP' occurrence is treated specially: it's argument is used
|
||||
* by patchup to locate the root of the extracted upstream source tree.
|
||||
* by hbxpatch to locate the root of the extracted upstream source tree.
|
||||
* Examples:
|
||||
*
|
||||
* # MAP LICENCE
|
||||
*
|
||||
* The file named `LICENCE' needs to be brought over from the upstream tree
|
||||
* to the Harbour tree unchanged. In case of PCRE, `MAP LICENCE' being the
|
||||
* first `MAP' line also means that patchup will use the directory
|
||||
* first `MAP' line also means that hbxpatch will use the directory
|
||||
* containing this file as a base for all other files occurring later.
|
||||
* Accordingly, the first `MAP' entry must be flat even on the source side.
|
||||
*
|
||||
@@ -112,19 +113,19 @@
|
||||
* 2. MODES OF OPERATION
|
||||
* ---------------------
|
||||
*
|
||||
* By default, patchup operates in `component version updating' mode - that is,
|
||||
* By default, hbxpatch operates in `component version updating' mode - that is,
|
||||
* refreshing the component version to a newer upstream version.
|
||||
*
|
||||
* If patchup is called with the `-rediff' command line argument, it switches
|
||||
* If hbxpatch is called with the `-rediff' command line argument, it switches
|
||||
* to a `local diff refresh' mode. This mode is used to refresh the local diff
|
||||
* after Harbour-specific modifications have been made to the component's
|
||||
* source. In order to help with the initial diff creation, patchup will proceed
|
||||
* source. In order to help with the initial diff creation, hbxpatch will proceed
|
||||
* even if no `DIFF' is specified amongst the meta data, and defaults to
|
||||
* creating a diff named `$(component).dif').
|
||||
*
|
||||
* If no differences between the original and the Harbour trees were found,
|
||||
* a possibly pre-existing diff file is removed. Following this change up
|
||||
* in the component's Makefile (or .hbp file) is left for the operator -- patchup
|
||||
* in the component's Makefile (or .hbp file) is left for the operator -- hbxpatch
|
||||
* will communicate if there is a likely need to perform this action.
|
||||
*
|
||||
* It is strongly advised not to try to mix the two modes. If there are any
|
||||
@@ -136,15 +137,15 @@
|
||||
*
|
||||
* Once it has been determined that a particular component needs an update, the URL
|
||||
* argument has to be modified to point to the new source tree archive. VER should
|
||||
* also be updated. While residing in the component's directory, patchup needs
|
||||
* to be run. The rest is mostly automatic - patchup retrieves, unpacks and
|
||||
* also be updated. While residing in the component's directory, hbxpatch needs
|
||||
* to be run. The rest is mostly automatic - hbxpatch retrieves, unpacks and
|
||||
* otherwise prepares the updated source tree, applies any local modifications,
|
||||
* and copies any changes back to the Harbour tree (the current working directory).
|
||||
* After some inspection and a test, it is ready to be committed.
|
||||
*
|
||||
* In rediff mode, care must be taken for the URL keyword to contain a reference
|
||||
* to the version that is in the current Harbour tree (that basically means `do not
|
||||
* touch anything', assuming correct information in the first place). After patchup
|
||||
* touch anything', assuming correct information in the first place). After hbxpatch
|
||||
* is finished rediffing, the new `local changes' file (see `DIFF') may be inspected,
|
||||
* and is ready to be committed.
|
||||
*
|
||||
@@ -154,11 +155,11 @@
|
||||
* 4. TROUBLESHOOTING
|
||||
* ------------------
|
||||
*
|
||||
* Several things can go wrong, and patchup tries hard handle them as gracefully as
|
||||
* Several things can go wrong, and hbxpatch tries hard handle them as gracefully as
|
||||
* possible. First and foremost, in case of even the slightest sign of something
|
||||
* not happening as intended, patchup will not modify the Harbour tree at all.
|
||||
* not happening as intended, hbxpatch will not modify the Harbour tree at all.
|
||||
* Everything is happening inside a temporary directory, which is not erased when
|
||||
* patchup exits (not even when it exits normally), and where certain log files are
|
||||
* hbxpatch exits (not even when it exits normally), and where certain log files are
|
||||
* created. These log files may contain information to help debugging in case of
|
||||
* an (unhandled) error.
|
||||
*
|
||||
@@ -191,7 +192,7 @@
|
||||
*
|
||||
* some archive file The new source tree archive.
|
||||
*
|
||||
* In all error cases patchup will produce a meaningful error message. Armed with
|
||||
* In all error cases hbxpatch will provide a meaningful error message. Armed with
|
||||
* that and the information here, troubleshooting should not be much of a problem.
|
||||
*
|
||||
* 4. BUGS
|
||||
@@ -858,5 +859,5 @@ STATIC FUNCTION FN_Escape( cFileName )
|
||||
#endif
|
||||
|
||||
/*
|
||||
* vim: ts=3 expandtab
|
||||
* vim: ts=3 expandtab ft=clipper
|
||||
*/
|
||||
|
||||
@@ -30,7 +30,7 @@ ifneq ($(HB_BUILD_OPTIM),no)
|
||||
endif
|
||||
|
||||
ifeq ($(HB_BUILD_DEBUG),yes)
|
||||
CFLAGS += -g
|
||||
CFLAGS += -gstabs+
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(HB_BUILD_STRIP),all lib),)
|
||||
|
||||
@@ -80,10 +80,10 @@ else
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)contrib/makefile.hbs clean migr,)
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)contrib/makefile.hbs clean migr,@$(ECHO) $(ECHOQUOTE)! Warning: hbrun not found, contrib/makefile.hbs not run.$(ECHOQUOTE))
|
||||
|
||||
install::
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)contrib/makefile.hbs install migr,)
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)contrib/makefile.hbs install migr,@$(ECHO) $(ECHOQUOTE)! Warning: hbrun not found, contrib/makefile.hbs not run.$(ECHOQUOTE))
|
||||
|
||||
all:
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)contrib/makefile.hbs all migr,)
|
||||
$(if $(wildcard $(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT)),+$(HB_HOST_BIN_DIR)/hbrun$(HB_HOST_BIN_EXT) --hb:gtcgi $(TOP)$(ROOT)contrib/makefile.hbs all migr,@$(ECHO) $(ECHOQUOTE)! Warning: hbrun not found, contrib/makefile.hbs not run.$(ECHOQUOTE))
|
||||
|
||||
@@ -16,17 +16,23 @@
|
||||
3. avoid long cmdlines to make ms-dos hosts happy
|
||||
4. solve the automatic in-dir make clean/install/rebuild
|
||||
workflow
|
||||
*/
|
||||
*/
|
||||
|
||||
/* #pragma warninglevel=3 */
|
||||
|
||||
/* TOFIX: Ugly hack to avoid #include "directry.ch" */
|
||||
#define F_NAME 1 /* File name */
|
||||
#define F_ATTR 5 /* File attribute */
|
||||
#define F_NAME 1 /* File name */
|
||||
#define F_ATTR 5 /* File attribute */
|
||||
|
||||
#define _PS_ hb_osPathSeparator()
|
||||
#define _PS_ hb_osPathSeparator()
|
||||
|
||||
#define _ACT_CLEAN 1
|
||||
#define _ACT_INC 2
|
||||
#define _ACT_INC_INST 3
|
||||
#define _ACT_INC_REBUILD_INST 4
|
||||
|
||||
STATIC s_lTest
|
||||
STATIC s_lMigr
|
||||
|
||||
PROCEDURE Main( ... )
|
||||
|
||||
@@ -129,27 +135,28 @@ PROCEDURE Main( ... )
|
||||
LOCAL cInstallDirVar
|
||||
LOCAL cTargetDir
|
||||
|
||||
LOCAL cBaseOptions := ""
|
||||
LOCAL cBaseOptions
|
||||
LOCAL cOptionsPre
|
||||
LOCAL cOptionsPost
|
||||
LOCAL lBuildName
|
||||
|
||||
LOCAL cFilter := GetEnv( "HB_CONTRIBLIBS" )
|
||||
LOCAL cFilter
|
||||
LOCAL aFilter
|
||||
LOCAL lFilterNegative
|
||||
|
||||
LOCAL aParams := hb_AParams()
|
||||
LOCAL aParams
|
||||
LOCAL tmp
|
||||
LOCAL nAction
|
||||
|
||||
s_lTest := AScan( aParams, "test" ) > 0
|
||||
|
||||
IF AScan( aParams, "migr" ) > 0
|
||||
OutStd( "! New contrib make orchestrator test run." + iif( AScan( aParams, "clean" ) > 0, " CLEAN", "" ) + iif( AScan( aParams, "install" ) > 0, " INSTALL", "" ) + " " + hb_dirBase() + " " + CurDir() + hb_osNewLine() )
|
||||
IF "migr" $ hb_cmdLine()
|
||||
OutStd( "! New contrib make orchestrator test run. |" + hb_cmdLine() + "|" + GetEnv( "HB_MAKECMDGOALS" ) + "|" + hb_dirBase() + "|" + CurDir() + "|", hb_osNewLine() )
|
||||
|
||||
/* testing with a limited set of contribs */
|
||||
aLibsPass1 := {;
|
||||
"hbblat/hbblat.hbp" ,;
|
||||
"hbblink/hbblink.hbp" ,;
|
||||
"hbclipsm/hbclipsm.hbp" ,;
|
||||
"hbnetio/hbnetio.hbp" ,;
|
||||
"rddbmcdx/hbbmcdx.hbp" }
|
||||
aLibsPass2 := {}
|
||||
aLibsPass3 := {}
|
||||
@@ -157,6 +164,38 @@ PROCEDURE Main( ... )
|
||||
"hbnetio/utils/hbnetio.hbp" }
|
||||
ENDIF
|
||||
|
||||
/*
|
||||
Workflow translation from GNU Make to hbmk2:
|
||||
|
||||
GNU Make parameter HB_MAKECMDGOALS nAction hbmk2 options
|
||||
-- -------------- ---------- ---------------- -------------- -------------------------
|
||||
#1 clean clean clean _ACT_CLEAN -clean
|
||||
#2 install install install _ACT_INC_INST -inc -instpath=
|
||||
#3 clean install clean clean install _ACT_CLEAN -clean
|
||||
install clean install _ACT_INC_INST -inc -instpath=
|
||||
#4 install clean install install clean _ACT_INC_INST -inc -instpath=
|
||||
clean install clean _ACT_CLEAN -clean
|
||||
#5 all _ACT_INC -inc
|
||||
|
||||
*/
|
||||
|
||||
/* Determine the mode of operation */
|
||||
|
||||
s_lTest := "test" $ hb_cmdLine()
|
||||
|
||||
aParams := hb_AParams()
|
||||
|
||||
DO CASE
|
||||
CASE AScan( aParams, "clean" ) > 0
|
||||
nAction := _ACT_CLEAN
|
||||
CASE AScan( aParams, "install" ) > 0
|
||||
nAction := _ACT_INC_INST
|
||||
OTHERWISE
|
||||
nAction := _ACT_INC
|
||||
ENDCASE
|
||||
|
||||
/* Check if the requirements are met and if we have anything to do */
|
||||
|
||||
IF Empty( GetEnv( "HB_PLATFORM" ) ) .OR. ;
|
||||
Empty( GetEnv( "HB_COMPILER" ) ) .OR. ;
|
||||
Empty( GetEnv( "HB_HOST_BIN_DIR" ) )
|
||||
@@ -164,6 +203,8 @@ PROCEDURE Main( ... )
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
cFilter := GetEnv( "HB_CONTRIBLIBS" )
|
||||
|
||||
IF cFilter == "no"
|
||||
ErrorLevel( 0 )
|
||||
RETURN
|
||||
@@ -173,6 +214,8 @@ PROCEDURE Main( ... )
|
||||
|
||||
/* Converting build options to hbmk2 options */
|
||||
|
||||
cBaseOptions := " -info -trace"
|
||||
|
||||
IF GetEnv( "HB_BUILD_MODE" ) == "cpp"
|
||||
cBaseOptions += " -cpp=yes"
|
||||
ELSEIF GetEnv( "HB_BUILD_MODE" ) == "c"
|
||||
@@ -188,9 +231,28 @@ PROCEDURE Main( ... )
|
||||
lBuildName := .F.
|
||||
ENDIF
|
||||
|
||||
FOR EACH tmp IN aParams
|
||||
tmp := Lower( tmp )
|
||||
NEXT
|
||||
/* Clearing envvars that may interact with hbmk2 */
|
||||
|
||||
hb_setenv( "_HB_BIN_INSTALL", GetEnv( "HB_BIN_INSTALL" ) )
|
||||
hb_setenv( "_HB_LIB_INSTALL", GetEnv( "HB_LIB_INSTALL" ) )
|
||||
hb_setenv( "_HB_DYN_INSTALL", GetEnv( "HB_DYN_INSTALL" ) )
|
||||
hb_setenv( "_HB_INC_INSTALL", GetEnv( "HB_INC_INSTALL" ) )
|
||||
|
||||
hb_setenv( "HB_INSTALL_PREFIX", cRoot )
|
||||
hb_setenv( "HB_BIN_INSTALL", cRoot + "bin/${hb_plat}/${hb_comp}" + iif( lBuildName, "/${hb_build}", "" ) )
|
||||
hb_setenv( "HB_LIB_INSTALL", cRoot + "lib/${hb_plat}/${hb_comp}" + iif( lBuildName, "/${hb_build}", "" ) )
|
||||
hb_setenv( "HB_DYN_INSTALL" )
|
||||
hb_setenv( "HB_INC_INSTALL", cRoot + "include" )
|
||||
|
||||
hb_setenv( "HBMK_OPTIONS" )
|
||||
|
||||
/* compatibility ones. */
|
||||
hb_setenv( "HB_MT" )
|
||||
hb_setenv( "HB_GUI" )
|
||||
hb_setenv( "HB_SHARED" )
|
||||
hb_setenv( "HB_DEBUG" )
|
||||
hb_setenv( "HB_NULRDD" )
|
||||
hb_setenv( "HB_GT" )
|
||||
|
||||
/* Parse filter */
|
||||
|
||||
@@ -238,50 +300,68 @@ PROCEDURE Main( ... )
|
||||
SWITCH hItem[ "type" ]
|
||||
CASE "lib"
|
||||
CASE "implib"
|
||||
cTargetDir := cRoot + "lib/${hb_plat}/${hb_comp}" + iif( lBuildName, "/${hb_build}", "" )
|
||||
cInstallDirVar := "HB_LIB_INSTALL"
|
||||
cTargetDir := "${HB_LIB_INSTALL}"
|
||||
cInstallDirVar := "_HB_LIB_INSTALL"
|
||||
EXIT
|
||||
CASE "bin"
|
||||
cTargetDir := cRoot + "bin/${hb_plat}/${hb_comp}" + iif( lBuildName, "/${hb_build}", "" )
|
||||
cInstallDirVar := "HB_BIN_INSTALL"
|
||||
cTargetDir := "${HB_BIN_INSTALL}"
|
||||
cInstallDirVar := "_HB_BIN_INSTALL"
|
||||
IF GetEnv( "HB_BUILD_SHARED" ) == "yes"
|
||||
cOptionsPre += " -shared"
|
||||
ENDIF
|
||||
EXIT
|
||||
ENDSWITCH
|
||||
|
||||
IF AScan( aParams, "clean" ) > 0
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre + " -clean", cOptionsPost )
|
||||
ELSEIF AScan( aParams, "install" ) > 0
|
||||
IF ! Empty( GetEnv( cInstallDirVar ) ) .AND. ;
|
||||
( ! ( hItem[ "type" ] == "implib" ) .OR. GetEnv( "HB_BUILD_IMPLIB" ) == "yes" )
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre + " -inc -instpath=${" + cInstallDirVar + "}/", cOptionsPost )
|
||||
ENDIF
|
||||
IF nAction == _ACT_CLEAN
|
||||
cOptionsPre += " -clean"
|
||||
ELSE
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre + " -inc", cOptionsPost )
|
||||
cOptionsPre += " -inc"
|
||||
IF nAction == _ACT_INC_REBUILD_INST
|
||||
cOptionsPre += " -rebuild"
|
||||
ENDIF
|
||||
IF nAction == _ACT_INC_INST .OR. ;
|
||||
nAction == _ACT_INC_REBUILD_INST
|
||||
IF ! Empty( GetEnv( cInstallDirVar ) ) .AND. ;
|
||||
( ! ( hItem[ "type" ] == "implib" ) .OR. GetEnv( "HB_BUILD_IMPLIB" ) == "yes" )
|
||||
cOptionsPre += " -instpath=${" + cInstallDirVar + "}/"
|
||||
IF hItem[ "type" ] == "lib"
|
||||
cOptionsPre += " -instpath=inc:${_HB_INC_INSTALL}/"
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre, cOptionsPost )
|
||||
|
||||
/* Highly experimental */
|
||||
IF hItem[ "type" ] == "lib" .AND. GetEnv( "HB_BUILD_CONTRIB_DLL" ) == "yes" .AND. ;
|
||||
hb_FileExists( FN_ExtSet( cBase + cProject, ".hbc" ) )
|
||||
|
||||
cInstallDirVar := "HB_BIN_INSTALL"
|
||||
cInstallDirVar := "_HB_DYN_INSTALL"
|
||||
|
||||
cOptionsPre := cBaseOptions
|
||||
/* TOFIX: Add -implib option. It collides with static lib so needs to be resolved. */
|
||||
cOptionsPost := " -hbdyn -nohblib- -shared " + FN_ExtSet( cProject, ".hbc" )
|
||||
|
||||
IF AScan( aParams, "clean" ) > 0
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre + " -clean", cOptionsPost )
|
||||
ELSEIF AScan( aParams, "install" ) > 0
|
||||
IF ! Empty( GetEnv( cInstallDirVar ) ) .AND. ;
|
||||
( ! ( hItem[ "type" ] == "implib" ) .OR. GetEnv( "HB_BUILD_IMPLIB" ) == "yes" )
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre + " -inc -instpath=${" + cInstallDirVar + "}/", cOptionsPost )
|
||||
ENDIF
|
||||
IF nAction == _ACT_CLEAN
|
||||
cOptionsPre += " -clean"
|
||||
ELSE
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre + " -inc", cOptionsPost )
|
||||
cOptionsPre += " -inc"
|
||||
IF nAction == _ACT_INC_REBUILD_INST
|
||||
cOptionsPre += " -rebuild"
|
||||
ENDIF
|
||||
IF nAction == _ACT_INC_INST .OR. ;
|
||||
nAction == _ACT_INC_REBUILD_INST
|
||||
IF ! Empty( GetEnv( cInstallDirVar ) )
|
||||
cOptionsPre += " -instpath=${" + cInstallDirVar + "}/"
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
call_hbmk2( cBase + cProject, cTargetDir, cOptionsPre, cOptionsPost )
|
||||
ENDIF
|
||||
ELSE
|
||||
/* OutStd( hb_StrFormat( "'%s' project skipped" + hb_osNewLine(), cProject ) ) */
|
||||
/* OutStd( hb_StrFormat( "'%s' project skipped", cProject ), hb_osNewLine() ) */
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
@@ -305,7 +385,7 @@ STATIC FUNCTION call_hbmk2( cProject, cTargetDir, cOptionsPre, cOptionsPost )
|
||||
" -workdir=" + cTargetDir + "/${hb_work}/" + cName + "${hb_workdynsub}" +;
|
||||
" -o" + cTargetDir + "/" )
|
||||
IF nErrorLevel != 0
|
||||
OutStd( hb_StrFormat( "'%s' returned status: %s" + hb_osNewLine(), cProject, hb_ntos( nErrorLevel ) ) )
|
||||
OutStd( hb_StrFormat( "'%s' returned status: %s", cProject, hb_ntos( nErrorLevel ) ), hb_osNewLine() )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
@@ -313,7 +393,7 @@ STATIC FUNCTION call_hbmk2( cProject, cTargetDir, cOptionsPre, cOptionsPost )
|
||||
|
||||
STATIC FUNCTION mk_hb_processRun( cCommand )
|
||||
|
||||
OutStd( cCommand + hb_osNewLine() )
|
||||
OutStd( cCommand, hb_osNewLine() )
|
||||
|
||||
RETURN iif( s_lTest, 0, hb_processRun( cCommand ) )
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
{HB_WITH_APOLLO_VER61}-cflags=-DHB_WITH_APOLLO_VER61
|
||||
|
||||
-instfile=apollo.ch
|
||||
-instfile=inc:apollo.ch
|
||||
|
||||
apollo.c
|
||||
apollo1.prg
|
||||
|
||||
@@ -748,9 +748,9 @@ char * hb_verCompiler( void )
|
||||
iVerMinor = __PCC_MINOR__;
|
||||
iVerPatch = __PCC_MINORMINOR__;
|
||||
|
||||
#if defined( __GCC__ )
|
||||
hb_strncpy( szSub, "(with GCC %d.%d.%d emulation)",
|
||||
__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__ )
|
||||
#if defined( __GNUC__ )
|
||||
hb_snprintf( szSub, sizeof( szSub ), " (GCC %d.%d.%d emul.)",
|
||||
__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__ );
|
||||
#endif
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
@@ -775,7 +775,7 @@ static void hb_gt_dos_mouse_GetBounds( PHB_GT pGT, int * piTop, int * piLeft, in
|
||||
|
||||
static void hb_gt_dos_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
|
||||
{
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Init(%p,%p,%p,%p)", pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr));
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Init(%p,%d,%d,%d)", pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr));
|
||||
|
||||
s_bBreak = HB_FALSE;
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ static int hb_fsProcessExec( const char * pszFilename,
|
||||
{
|
||||
int iResult = FS_ERROR;
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_fsProcessExec(%s, %p, %p, %p, %d, %p)", pszFilename, ( void * ) ( HB_PTRDIFF ) hStdin, ( void * ) ( HB_PTRDIFF ) hStdout, ( void * ) ( HB_PTRDIFF ) hStderr));
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_fsProcessExec(%s, %p, %p, %p)", pszFilename, ( void * ) ( HB_PTRDIFF ) hStdin, ( void * ) ( HB_PTRDIFF ) hStdout, ( void * ) ( HB_PTRDIFF ) hStderr));
|
||||
|
||||
#if defined( HB_OS_WIN_CE )
|
||||
{
|
||||
@@ -969,6 +969,10 @@ int hb_fsProcessRun( const char * pszFilename,
|
||||
char sTmpOut[ HB_PATH_MAX ];
|
||||
char sTmpErr[ HB_PATH_MAX ];
|
||||
|
||||
HB_SYMBOL_UNUSED( phStdin );
|
||||
HB_SYMBOL_UNUSED( ulOutSize );
|
||||
HB_SYMBOL_UNUSED( ulErrSize );
|
||||
|
||||
sTmpIn[ 0 ] = sTmpOut[ 0 ] = sTmpErr[ 0 ] = '\0';
|
||||
if( pStdInBuf )
|
||||
{
|
||||
|
||||
@@ -1964,17 +1964,19 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
|
||||
|
||||
CASE Left( cParamL, Len( "-instfile=" ) ) == "-instfile="
|
||||
|
||||
cParam := PathSepToSelf( MacroProc( hbmk, SubStr( cParam, Len( "-instfile=" ) + 1 ), aParam[ _PAR_cFileName ] ) )
|
||||
cParam := MacroProc( hbmk, SubStr( cParam, Len( "-instfile=" ) + 1 ), aParam[ _PAR_cFileName ] )
|
||||
inst_split_arg( cParam, @tmp, @cParam )
|
||||
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
|
||||
AAdd( hbmk[ _HBMK_aINSTFILE ], cParam )
|
||||
AAddNewINST( hbmk[ _HBMK_aINSTFILE ], { tmp, cParam } )
|
||||
NEXT
|
||||
|
||||
CASE Left( cParamL, Len( "-instpath=" ) ) == "-instpath=" .AND. ;
|
||||
Len( cParamL ) > Len( "-instpath=" )
|
||||
|
||||
cParam := MacroProc( hbmk, SubStr( cParam, Len( "-instpath=" ) + 1 ), aParam[ _PAR_cFileName ] )
|
||||
inst_split_arg( cParam, @tmp, @cParam )
|
||||
IF ! Empty( cParam )
|
||||
AAddNew( hbmk[ _HBMK_aINSTPATH ], PathNormalize( PathProc( PathSepToSelf( cParam ), aParam[ _PAR_cFileName ] ) ) )
|
||||
AAddNewINST( hbmk[ _HBMK_aINSTPATH ], { tmp, PathNormalize( PathProc( PathSepToSelf( cParam ), aParam[ _PAR_cFileName ] ) ) } )
|
||||
ENDIF
|
||||
|
||||
CASE Left( cParamL, Len( "-incpath=" ) ) == "-incpath=" .AND. ;
|
||||
@@ -3113,7 +3115,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
|
||||
CASE hbmk[ _HBMK_cPLAT ] == "dos" .AND. hbmk[ _HBMK_cCOMP ] == "djgpp"
|
||||
|
||||
IF hbmk[ _HBMK_lDEBUG ]
|
||||
AAdd( hbmk[ _HBMK_aOPTC ], "-g" )
|
||||
AAdd( hbmk[ _HBMK_aOPTC ], "-gstabs+" )
|
||||
ENDIF
|
||||
cLibLibPrefix := "lib"
|
||||
cLibPrefix := "-l"
|
||||
@@ -5291,6 +5293,13 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
|
||||
|
||||
PlugIn_Execute_All( hbmk, "pre_cleanup" )
|
||||
|
||||
IF hbmk[ _HBMK_lCLEAN ]
|
||||
FErase( hbmk[ _HBMK_cPROGNAME ] )
|
||||
IF lStopAfterCComp .AND. hbmk[ _HBMK_lCreateLib ]
|
||||
/* bcc is known to create it for static libs */
|
||||
FErase( FN_ExtSet( hbmk[ _HBMK_cPROGNAME ], ".bak" ) )
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF ! Empty( l_cCSTUB )
|
||||
FErase( l_cCSTUB )
|
||||
FErase( FN_DirExtSet( l_cCSTUB, hbmk[ _HBMK_cWorkDir ], cObjExt ) )
|
||||
@@ -5417,37 +5426,9 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF ! Empty( hbmk[ _HBMK_aINSTPATH ] )
|
||||
hb_AIns( hbmk[ _HBMK_aINSTFILE ], 1, { "", FN_NameExtGet( hbmk[ _HBMK_cPROGNAME ] ) }, .T. )
|
||||
|
||||
hb_AIns( hbmk[ _HBMK_aINSTFILE ], 1, FN_NameExtGet( hbmk[ _HBMK_cPROGNAME ] ), .T. )
|
||||
|
||||
FOR EACH tmp IN hbmk[ _HBMK_aINSTPATH ]
|
||||
FOR EACH tmp2 IN hbmk[ _HBMK_aINSTFILE ]
|
||||
IF Empty( FN_NameExtGet( tmp ) )
|
||||
tmp1 := DirAddPathSep( tmp ) + tmp2
|
||||
ELSE
|
||||
/* If destination is a full name, don't copy the extra files, only the target */
|
||||
IF tmp2:__enumIndex() > 1
|
||||
IF hbmk[ _HBMK_lInfo ]
|
||||
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Warning: Install path not a directory (%1$s). Extra install files not copied." ), tmp ) )
|
||||
ENDIF
|
||||
EXIT
|
||||
ELSE
|
||||
tmp1 := tmp
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF DirBuild( FN_DirGet( tmp1 ) )
|
||||
IF hb_FCopy( tmp2, tmp1 ) == F_ERROR
|
||||
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Copying %1$s to %2$s failed with %3$s." ), tmp2, tmp1, hb_ntos( FError() ) ) )
|
||||
ELSEIF hbmk[ _HBMK_lInfo ]
|
||||
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Copied %1$s to %2$s" ), tmp2, tmp1 ) )
|
||||
ENDIF
|
||||
ELSE
|
||||
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Cannot create install directory for install target %1$s." ), tmp1 ) )
|
||||
ENDIF
|
||||
NEXT
|
||||
NEXT
|
||||
ENDIF
|
||||
DoInstCopy( hbmk )
|
||||
ENDIF
|
||||
|
||||
PlugIn_Execute_All( hbmk, "post_build" )
|
||||
@@ -5505,6 +5486,61 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
|
||||
|
||||
RETURN hbmk[ _HBMK_nErrorLevel ]
|
||||
|
||||
#define _INST_cGroup 1
|
||||
#define _INST_cData 2
|
||||
#pragma linenumber=on
|
||||
STATIC PROCEDURE DoInstCopy( hbmk )
|
||||
LOCAL aInstPath
|
||||
LOCAL aInstFile
|
||||
LOCAL cInstPath
|
||||
LOCAL cInstFile
|
||||
|
||||
LOCAL cDestFileName
|
||||
LOCAL nCopied
|
||||
|
||||
IF ! Empty( hbmk[ _HBMK_aINSTPATH ] )
|
||||
|
||||
FOR EACH aInstPath IN hbmk[ _HBMK_aINSTPATH ]
|
||||
|
||||
cInstPath := aInstPath[ _INST_cData ]
|
||||
|
||||
nCopied := 0 /* file copied */
|
||||
FOR EACH aInstFile IN hbmk[ _HBMK_aINSTFILE ]
|
||||
|
||||
cInstFile := aInstFile[ _INST_cData ]
|
||||
|
||||
IF aInstPath[ _INST_cGroup ] == aInstFile[ _INST_cGroup ]
|
||||
IF Empty( FN_NameExtGet( cInstPath ) )
|
||||
cDestFileName := DirAddPathSep( cInstPath ) + cInstFile
|
||||
ELSE
|
||||
/* If destination is a full name, don't copy the extra files, only the first one.
|
||||
(for the empty group name, this will be the build target) */
|
||||
IF nCopied > 0
|
||||
IF hbmk[ _HBMK_lInfo ]
|
||||
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Warning: Install path not a directory (%1$s). Extra install files not copied." ), cInstPath ) )
|
||||
ENDIF
|
||||
EXIT
|
||||
ELSE
|
||||
cDestFileName := cInstPath
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF DirBuild( FN_DirGet( cDestFileName ) )
|
||||
++nCopied
|
||||
IF hb_FCopy( cInstFile, cDestFileName ) == F_ERROR
|
||||
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Copying %1$s to %2$s failed with %3$s." ), cInstFile, cDestFileName, hb_ntos( FError() ) ) )
|
||||
ELSEIF hbmk[ _HBMK_lInfo ]
|
||||
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Copied %1$s to %2$s" ), cInstFile, cDestFileName ) )
|
||||
ENDIF
|
||||
ELSE
|
||||
hbmk_OutErr( hbmk, hb_StrFormat( I_( "Warning: Cannot create install directory for install target %1$s." ), cDestFileName ) )
|
||||
ENDIF
|
||||
ENDIF
|
||||
NEXT
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC PROCEDURE DoBeep( lSuccess )
|
||||
LOCAL nRepeat := iif( lSuccess, 1, 2 )
|
||||
LOCAL tmp
|
||||
@@ -5998,6 +6034,24 @@ STATIC FUNCTION deplst_add( hDeps, cList )
|
||||
|
||||
RETURN .T.
|
||||
|
||||
STATIC PROCEDURE inst_split_arg( cParam, /* @ */ cName, /* @ */ cData )
|
||||
LOCAL nPos
|
||||
|
||||
/* separate install group from install file or path.
|
||||
install group must be at least 2 chars, otherwise it's considered as drive letter */
|
||||
|
||||
IF ( nPos := At( ":", cParam ) ) > 2
|
||||
cName := Left( cParam, nPos - 1 )
|
||||
cData := SubStr( cParam, nPos + 1 )
|
||||
ELSE
|
||||
cName := ""
|
||||
cData := cParam
|
||||
ENDIF
|
||||
|
||||
cData := PathSepToSelf( cData )
|
||||
|
||||
RETURN
|
||||
|
||||
STATIC FUNCTION dep_split_arg( hbmk, cParam, /* @ */ cName, /* @ */ cData )
|
||||
LOCAL nPos
|
||||
LOCAL dep
|
||||
@@ -6586,10 +6640,13 @@ FUNCTION hbmk2_AddInput_RC( ctx, cFileName )
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
FUNCTION hbmk2_AddInput_INSTFILE( ctx, cFileName )
|
||||
FUNCTION hbmk2_AddInput_INSTFILE( ctx, cFileName, cGroup )
|
||||
LOCAL hbmk := ctx_to_hbmk( ctx )
|
||||
IF hbmk != NIL .AND. ISCHARACTER( cFileName )
|
||||
AAdd( hbmk[ _HBMK_aINSTFILE ], PathSepToSelf( cFileName ) )
|
||||
IF ! ISCHARACTER( cGroup )
|
||||
cGroup := ""
|
||||
ENDIF
|
||||
AAddNewINST( hbmk[ _HBMK_aINSTFILE ], { cGroup, PathSepToSelf( cFileName ) } )
|
||||
ENDIF
|
||||
RETURN NIL
|
||||
|
||||
@@ -6851,6 +6908,14 @@ STATIC FUNCTION AAddNew( array, xItem )
|
||||
|
||||
RETURN array
|
||||
|
||||
STATIC FUNCTION AAddNewINST( array, xItem )
|
||||
|
||||
IF AScan( array, {| tmp | tmp[ 2 ] == xItem[ 2 ] } ) == 0
|
||||
AAdd( array, xItem )
|
||||
ENDIF
|
||||
|
||||
RETURN array
|
||||
|
||||
STATIC FUNCTION AAddNotEmpty( array, xItem )
|
||||
|
||||
IF ! Empty( xItem )
|
||||
@@ -7492,6 +7557,7 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel )
|
||||
LOCAL cLine
|
||||
LOCAL cItem
|
||||
LOCAL cItemL
|
||||
LOCAL cName
|
||||
LOCAL tmp
|
||||
|
||||
IF ! hb_FileExists( cFileName )
|
||||
@@ -7664,19 +7730,25 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
CASE Lower( Left( cLine, Len( "instpaths=" ) ) ) == "instpaths=" ; cLine := SubStr( cLine, Len( "instpaths=" ) + 1 )
|
||||
CASE Lower( Left( cLine, Len( "instfiles=" ) ) ) == "instfiles=" ; cLine := SubStr( cLine, Len( "instfiles=" ) + 1 )
|
||||
|
||||
FOR EACH cItem IN hb_ATokens( cLine,, .T. )
|
||||
cItem := MacroProc( hbmk, StrStripQuote( cItem ), cFileName )
|
||||
inst_split_arg( cItem, @cName, @cItem )
|
||||
IF ! Empty( cItem )
|
||||
AAddNew( hbmk[ _HBMK_aINSTPATH ], PathNormalize( PathProc( PathSepToSelf( cItem ), FN_DirGet( cFileName ) ) ) )
|
||||
cItem := PathNormalize( PathProc( cItem, FN_DirGet( cFileName ) ) )
|
||||
FOR EACH tmp IN FN_Expand( cItem, .F. )
|
||||
AAddNewINST( hbmk[ _HBMK_aINSTFILE ], { cName, tmp } )
|
||||
NEXT
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
CASE Lower( Left( cLine, Len( "instfiles=" ) ) ) == "instfiles=" ; cLine := SubStr( cLine, Len( "instfiles=" ) + 1 )
|
||||
CASE Lower( Left( cLine, Len( "instpaths=" ) ) ) == "instpaths=" ; cLine := SubStr( cLine, Len( "instpaths=" ) + 1 )
|
||||
FOR EACH cItem IN hb_ATokens( cLine,, .T. )
|
||||
cItem := MacroProc( hbmk, StrStripQuote( cItem ), cFileName )
|
||||
inst_split_arg( cItem, @cName, @cItem )
|
||||
IF ! Empty( cItem )
|
||||
AAddNew( hbmk[ _HBMK_aINSTFILE ], PathNormalize( PathProc( PathSepToSelf( cItem ), FN_DirGet( cFileName ) ) ) )
|
||||
AAddNewINST( hbmk[ _HBMK_aINSTPATH ], { cName, PathNormalize( PathProc( PathSepToSelf( cItem ), FN_DirGet( cFileName ) ) ) } )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
@@ -7884,49 +7956,49 @@ STATIC FUNCTION HBC_ProcessOne( hbmk, cFileName, nNestingLevel )
|
||||
|
||||
CASE Lower( Left( cLine, Len( "deppkgname=" ) ) ) == "deppkgname=" ; cLine := SubStr( cLine, Len( "deppkgname=" ) + 1 )
|
||||
|
||||
IF dep_split_arg( hbmk, cLine, @cLine, @tmp )
|
||||
tmp := MacroProc( hbmk, tmp, cFileName )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aPKG ], StrStripQuote( AllTrim( tmp ) ) )
|
||||
IF dep_split_arg( hbmk, cLine, @cName, @cLine )
|
||||
cLine := MacroProc( hbmk, cLine, cFileName )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_aPKG ], StrStripQuote( AllTrim( cLine ) ) )
|
||||
ENDIF
|
||||
|
||||
CASE Lower( Left( cLine, Len( "depkeyhead=" ) ) ) == "depkeyhead=" ; cLine := SubStr( cLine, Len( "depkeyhead=" ) + 1 )
|
||||
|
||||
IF dep_split_arg( hbmk, cLine, @cLine, @tmp )
|
||||
FOR EACH cItem IN hb_ATokens( tmp,, .T. )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aKeyHeader ], AllTrim( StrTran( MacroProc( hbmk, cItem, cFileName ), "\", "/" ) ) )
|
||||
IF dep_split_arg( hbmk, cLine, @cName, @cLine )
|
||||
FOR EACH cItem IN hb_ATokens( cLine,, .T. )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_aKeyHeader ], AllTrim( StrTran( MacroProc( hbmk, cItem, cFileName ), "\", "/" ) ) )
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
CASE Lower( Left( cLine, Len( "depoptional=" ) ) ) == "depoptional=" ; cLine := SubStr( cLine, Len( "depoptional=" ) + 1 )
|
||||
|
||||
IF dep_split_arg( hbmk, cLine, @cLine, @tmp )
|
||||
tmp := MacroProc( hbmk, tmp, cFileName )
|
||||
IF dep_split_arg( hbmk, cLine, @cName, @cLine )
|
||||
cLine := MacroProc( hbmk, cLine, cFileName )
|
||||
DO CASE
|
||||
CASE Lower( tmp ) == "yes" ; hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_lOptional ] := .T.
|
||||
CASE Lower( tmp ) == "no" ; hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_lOptional ] := .F.
|
||||
CASE Lower( cLine ) == "yes" ; hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_lOptional ] := .T.
|
||||
CASE Lower( cLine ) == "no" ; hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_lOptional ] := .F.
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
CASE Lower( Left( cLine, Len( "depcontrol=" ) ) ) == "depcontrol=" ; cLine := SubStr( cLine, Len( "depcontrol=" ) + 1 )
|
||||
|
||||
IF dep_split_arg( hbmk, cLine, @cLine, @tmp )
|
||||
hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_cControl ] := AllTrim( MacroProc( hbmk, tmp, cFileName ) )
|
||||
AAddNew( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aINCPATH ], _HBMK_DEP_CTRL_MARKER )
|
||||
IF dep_split_arg( hbmk, cLine, @cName, @cLine )
|
||||
hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_cControl ] := AllTrim( MacroProc( hbmk, cLine, cFileName ) )
|
||||
AAddNew( hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_aINCPATH ], _HBMK_DEP_CTRL_MARKER )
|
||||
ENDIF
|
||||
|
||||
CASE Lower( Left( cLine, Len( "depincpath=" ) ) ) == "depincpath=" ; cLine := SubStr( cLine, Len( "depincpath=" ) + 1 )
|
||||
|
||||
IF dep_split_arg( hbmk, cLine, @cLine, @tmp )
|
||||
FOR EACH cItem IN hb_ATokens( tmp,, .T. )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aINCPATH ], PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ), FN_DirGet( cFileName ) ) ) )
|
||||
IF dep_split_arg( hbmk, cLine, @cName, @cLine )
|
||||
FOR EACH cItem IN hb_ATokens( cLine,, .T. )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_aINCPATH ], PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ), FN_DirGet( cFileName ) ) ) )
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
CASE Lower( Left( cLine, Len( "depincpathlocal=" ) ) ) == "depincpathlocal=" ; cLine := SubStr( cLine, Len( "depincpathlocal=" ) + 1 )
|
||||
|
||||
IF dep_split_arg( hbmk, cLine, @cLine, @tmp )
|
||||
FOR EACH cItem IN hb_ATokens( tmp,, .T. )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cLine ][ _HBMKDEP_aINCPATHLOCAL ], PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ), FN_DirGet( cFileName ) ) ) )
|
||||
IF dep_split_arg( hbmk, cLine, @cName, @cLine )
|
||||
FOR EACH cItem IN hb_ATokens( cLine,, .T. )
|
||||
AAddNewNotEmpty( hbmk[ _HBMK_hDEP ][ cName ][ _HBMKDEP_aINCPATHLOCAL ], PathNormalize( PathProc( PathSepToSelf( MacroProc( hbmk, cItem, cFileName ) ), FN_DirGet( cFileName ) ) ) )
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
@@ -10003,8 +10075,8 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong )
|
||||
{ "-vcshead=<file>" , I_( "generate .ch header file with local repository information. SVN, CVS, Git, Mercurial, Bazaar and Fossil are currently supported. Generated header will define macro _HBMK_VCS_TYPE_ with the name of detected VCS and _HBMK_VCS_ID_ with the unique ID of local repository" ) },;
|
||||
{ "-tshead=<file>" , I_( "generate .ch header file with timestamp information. Generated header will define macros _HBMK_BUILD_DATE_, _HBMK_BUILD_TIME_, _HBMK_BUILD_TIMESTAMP_ with the date/time of build" ) },;
|
||||
{ "-icon=<file>" , I_( "set <file> as application icon. <file> should be a supported format on the target platform" ) },;
|
||||
{ "-instfile=<file>" , I_( "add <file> to the list of files to be copied to path specified by -instpath option" ) },;
|
||||
{ "-instpath=<path>" , I_( "copy target to <path>. if <path> is a directory, it should end with path separatorm, in this case files specified by -instfile option will also be copied. can be specified multiple times" ) },;
|
||||
{ "-instfile=<g:file>" , I_( "add <file> in to the list of files to be copied to path specified by -instpath option. <g> is an optional copy group, it must be at least two characters long." ) },;
|
||||
{ "-instpath=<g:path>" , I_( "copy target to <path>. if <path> is a directory, it should end with path separatorm, in this case files specified by -instfile option will also be copied. can be specified multiple times. <g> is an optional copy group, it must be at least two characters long. Build target will be automatically copied to default (empty) copy group." ) },;
|
||||
{ "-stop" , I_( "stop without doing anything" ) },;
|
||||
{ "-echo=<text>" , I_( "echo text on screen" ) },;
|
||||
{ "-pause" , I_( "force waiting for a key on exit in case of failure (with alternate GTs only)" ) },;
|
||||
|
||||
Reference in New Issue
Block a user