49 KiB
Harbour Make (hbmk2) 3.2.0dev (r2013-04-03 03:33)
Copyright (c) 1999-2013, Viktor Szakats
http://harbour\-project\.org/
Traduzione (it): (inserisci qui il tuo nome)
Sintassi:
hbmk2 [options] [<script[s]>] <src[s][.prg|.c|.obj|.o|.rc|.res|.def|.po|.pot|.hbl|@.clp|.d|.ch]>
Descrizione:
hbmk2 is an integrated and portable build tool, making it possible to create various types of executable binaries (executable, dynamic library, static library, Harbour portable binary) out of multiple types of source files (C, C++, Objective-C, Harbour, gettext translations, Windows resources). 'Integrated' means that a single hbmk2 project file can control all or most aspects of the build process. 'Portable' means that a single hbmk2 project file can control the build on all supported OS platforms and across all supported C compilers. It also aims to cover the majority of build tasks via short and simple project files (options). hbmk2 supports pure -non-Harbour- C/C++/Objective-C projects as well. In order to achieve above goals, hbmk2 will autodetect Harbour, C compiler and other required tools, then configure and call them appropriately. hbmk2 allows to extend the types of supported source files via plugins.
Besides building executables, hbmk2 is able to run Harbour scripts (both source and precompiled) directly, and it also features an interactive shell prompt.
Opzioni:
-
-o<outname> nome del file di output
-
-l<libname> Il link con la libreria <libname>. <libname> dovrebbe essere senza percorso, estensione e prefisso 'lib' (a meno che non faccia parte del nome). Non aggiungere librerie Harbour di base, esse vengono aggiunte automaticamente, se necessario. Se <libname> inizia con il carattere '-', la libreria verrà rimossa dalla lista delle librerie durante la fase del link.
-
-L<libpath> additional path to search for libraries
-
-i<p>|-incpath=<p> additional path to search for headers
-
-static|-shared linkare con una libreria statica/condivisa
-
-gt<name> link with GT<name> GT driver, can be repeated to link with more GTs. First one will be the default at run-time
-
-inc[-] abilita/disabilita la compilazione incrementale (default: disabilitata)
-
-hbexe creazione dell'eseguibile (predefinita)
-
-hblib creare la libreria statica
-
-hbdyn create dynamic library (without linked Harbour VM)
-
-hbdynvm create dynamic library (with linked Harbour VM)
-
-mt|-st link with multi/single-thread Harbour VM
-
-gui|-std creare l'eseguibile GUI/console
-
-main=<mainfunc> override the name of starting function/procedure
-
-request=<func> forza la funzione/procedura da essere linkata
-
-fullstatic linkare con una libreria statica
-
-pic[-] create position independent object code (always enabled in -hbdyn/-hbdynvm modes)
-
-[full|fix]shared create shared Harbour binaries without/with absolute dir reference to Harbour library (default: 'fullshared' when Harbour is installed on system location, 'fixshared' otherwise) (fix/full option in *nix only)
-
-nulrdd[-] link with nulrdd
-
-debug[-] add/exclude C compiler debug info. For Harbour level debug, use Harbour option -b as usual
-
-optim[-] toggle C compiler optimizations (default: on)
-
-cpp[-] forza il modo C++/C
-
-cpp=<value> select C++ mode. Allowed values are: def, yes, no
-
-map[-] creare (o no) un file mappa
-
-implib[-] crea (o non) una libreria d'importazione (in modalità -hbdyn/-hbexe). Al nome verrà aggiunto un suffisso.
-
-implib=<output> crea la libreria di importazione (in modalità -hbdyn/-hbexe) di nome <output> (default: identica all'output)
-
-ln=<link> create symbolic link pointing to <output> (<link> is considered relative to <output>)
-
-strip[-] strip (no strip) binaries
-
-trace[-] mostra comandi eseguiti
-
-beep[-] attiva (o disattiva) un beep singolo in caso di successo in uscita, doppio beep in caso di errore
-
-ignore[-] ignore errors when running compiler tools (default: off)
-
-hbcppmm[-] override standard C++ memory management functions with Harbour ones
-
-winuni[-] Scegliere tra modo compilazione UNICODE (WIDE) e ANSI (predefinito: ANSI) (Solo Windows. Per WinCE esso è sempre fissato a UNICODE)
-
-nohblib[-] non usare librerie statiche principali di Harbour durante il linking
-
-nodefgt[-] do not link default GTs (effective in -static mode)
-
-nolibgrouping[-] disable library grouping on gcc based compilers
-
-nomiscsyslib[-] non aggiungere un'ulteriore elenco di librerie di sistema alla lista della libreria di default
-
-traceonly mostrare i comandi da essere eseguiti, ma non vengono eseguiti
-
-warn=<level> set C compiler warning level
<level> can be: max, yes, low, no, def (default: yes) -
-safe[-] enable safety options in C compiler/linker (default: enabled on Windows, disabled on other systems)
-
-compr=<level> compress executable/dynamic lib (needs UPX tool)
<level> can be: yes, no, min, max -
-run[-] eseguire/non eseguire l'eseguibile prodotto
-
-vcshead=<file> generate .ch header file with local repository information. Git, SVN, Mercurial, Bazaar, Fossil, CVS and Monotone are currently supported. Generated header will define preprocessor constant _HBMK_VCS_TYPE_ with the name of detected VCS and _HBMK_VCS_ID_ with the unique ID of local repository. If no VCS system is detected, a sequential number will be rolled automatically on each build.
-
-tshead=<file> generate .ch header file with timestamp information. Generated header will define preprocessor constants _HBMK_BUILD_DATE_, _HBMK_BUILD_TIME_, _HBMK_BUILD_TIMESTAMP_ with the date/time of build
-
-icon=<file> set <file> as application icon. <file> should be a supported format on the target platform (not supported by some platforms/compilers). On Windows, it is implemented by generating and linking a resource file.
-
-manifest=<file> embed manifest <file> in executable/dynamic lib (Windows only)
-
-sign=<key> sign executable with <key> (Windows and Darwin only). On Windows signtool.exe is used (part of MS Windows SDK) or posign.exe (part of Pelles C 7), in that order, both autodetected.
-
-signpw=<pw> Usare <pw> come password quando si accede all'eseguibile (Solo Windows e Darwin)
-
-instfile=<g:file> add <file> in to the list of files to be copied to path specified by -instpath option. <g> is an optional copy group (case sensitive), it must be at least two characters long. In case you do not specify <file>, the list of files in that group will be emptied.
-
-instpath=<g:path> copy target file(s) to <path>. if <path> is a directory, it should end with path separator, 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. There exist following built-in <g> groups: 'depimplib' for import libraries and 'depimplibsrc' for import library source (.dll) files, both belonging to dependencies.
-
-instforce[-] copy target file(s) to install path even if already up to date
-
-depimplib[-] abilita (o disabilita) la generazione della libreria d'importazione per i sorgenti della libreria d'importazione specificata nelle opzioni -deimpslib= (default: si)
-
-stop[=<text>] stop senza alcuna azione e visualizzazione di <text> se specificato
-
-echo=<text> visualizzazione del testo sullo schermo
-
-pause force waiting for a key on exit in case of failure (with alternate GTs only)
-
-exitstr mostra gli errori all'uscita come testo leggibile
-
-info abilitare i messaggi di informazione
-
-quiet[-] elimina tutti i messaggi sullo schermo
-
-bldf[-] inherit all/no (default) flags from Harbour build
-
-bldf=[p][c][l] inherit .prg/.c/linker flags (or none) from Harbour build
-
-F<framework> Collega al <framework> framework (Solamente Darwin)
-
-prgflag=<f> pass single flag to Harbour compiler
-
-cflag=<f> pass single flag to C compiler
-
-resflag=<f> pass single flag to resource compiler (Windows only)
-
-ldflag=<f> pass single flag to linker (executable)
-
-dflag=<f> pass single flag to linker (dynamic library)
-
-aflag=<f> pass single flag to linker (static library)
-
-iflag=<f> pass single flag to import library creation command
-
-signflag=<f> pass single flag to code sign command
-
-runflag=<f> pass single flag to output executable when -run option is used
-
-cflag+=<f> pass single flag to C compiler overriding C compiler flags added by hbmk2 itself. Use with caution.
-
-ldflag+=<f> pass single raw option to linker (executable) after the library list. Use with caution.
-
-dflag+=<f> passa una singola opzione direttamente al linker (libreria dinamica) dopo la lista di libreria. Usare con cautela.
-
-3rd=<f> options/flags reserved for 3rd party tools, always ignored by hbmk2 itself
-
-env:<e>[<o>[<v>]] 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.
-
-jobs=<n> start n compilation threads (multiprocess platforms only)
-
-head=<m> control source header parsing (in incremental build mode)
<m> can be: native (uses compiler to extract dependencies), full (default, uses simple text parser on the whole file), dep, off -
-rebuild ricompilazione (in modo incrementale)
-
-rebuildall Ricompila con i sotto-progetti (in compilazione incrementale)
-
-clean clean (in compilazione incrementale)
-
-workdir=<dir> cartella di lavoro (predefinita: .hbmk/<platform>/<compiler> [*] in modo incrementale, altrimenti la cartella temporanea OS)
-
-hbcontainer virtual build target, it does not create anything. Useful for creating an .hbp with the sole purpose of referencing sub-projects
-
-hbimplib creare la libreria d'importazione (solamente WIndows)
-
-hbl[=<output>] output .hbl filename. %{hb_lng} macro is accepted in filename
-
-lng=<languages> list of languages to be replaced in %{hb_lng} macros in .pot/.po filenames and output .hbl/.po filenames. Comma separated list:
-lng=en,hu-HU,de -
-po=<output> create/update .po file from source. Merge it with previous .po file of the same name
-
-minipo[-] do (not) add Harbour version number and source file reference to .po (default: add them)
-
-rebuildpo recreate .po file, thus removing all obsolete entries in it
-
-hbx=[<.ch>] Creare l'intestazione Harbour (in formato. HBX), con tutti i simboli esterni. Il parametro vuoto lo disattiva.
-
-autohbc=<.ch:.hbc> <.ch> is a header file name. <.hbc> is a .hbc filename to be automatically included in case the header is found in any of the compiled sources. (EXPERIMENTAL)
-
-deppkgname=<d:n> <d> è il nome della dipendenza. <n> nome del pacchetto della dipendenza. Può essere specificato più volte.
-
-depkeyhead=<d:h> <d> is the name of the dependency. <h> is the key header (.h) of the package dependency. Multiple alternative headers can be specified.
-
-depoptional=<d:f> <d> è il nome della dipendenza. <f> può essere 'yes' o 'no', specifica se la dipendenza è opzionale. Default: no
-
-depcontrol=<d:v> <d> is the name of the dependency. <v> is a value that controls how detection is done. Accepted values: no, yes, force, nolocal, local. Default: content of environment variable HBMK_WITH_<d>
-
-depincroot=<d:r> <d> p il nome della dipendenza. Fissare <r> a cartella principale per i percorsi specificati nelle opzioni -depincpath.
-
-depincpath=<d:i> <d> is the name of the dependency. Add <i> to the header detection path list.
-
-depincpathlocal=<d:i> <d> is the name of the dependency. Add <i> to the header detection path list, where <i> is pointing to a directory local to the project and containing an embedded (aka. 'locally hosted') dependency.
-
-depimplibs=<d:dll> <d> is the name of the dependency. Add <dll> to the import library source list.
-
-depimplibd=<d:lib> <d> is the name of the dependency. Set generated import library name to <lib>
-
-depfinish=<d> <d> is the name of the dependency. Closes the dependency definition and does the actual dependency detection, setting all predefined filter macro variables and build options accordingly. Optional, if omitted, detection will take place after processing all options.
-
-plugin=<filename> aggiungere il plugin. <filename> può essere: .hb, .prg, .hrb
-
-pi=<filename> specificare il file di input ai plugin
-
-pflag=<f> pass single flag to plugins
Opzioni riportate di seguito sono disponibili da riga di comando:
-
-target=<script> specify a new build target. <script> can be .prg (or no extension) or .hbp file. Note that .hbp files are automatically considered as separate build targets.
-
-hbrun run build target
-
-hbraw esecuzione fermata dopo l'esecuzione del compilatore Harbour
-
-hbcmp|-clipper stop after creating the object files
create link/copy hbmk2 to hbcmp/clipper for the same effect -
-hbcc accept raw C flags
create link/copy hbmk2 to hbcc for the same effect -
-hblnk accept raw linker flags
-
-autohbm[-] enable (or disable) processing of hbmk.hbm in current directory (default: yes)
-
-hb10 abilita la compatibilità Harbour 1.0.x
-
-hb20 abilita la compatibilità Harbour 2.0.x
-
-hb30 abilita la compatibilità Harbour 3.0.x
-
-xhb abilita modo xhb
-
-hbc abilita modo C puro
-
-rtlink
-
-blinker
-
-exospace emulate Clipper compatible linker behavior
create link/copy hbmk2 to rtlink/blinker/exospace for the same effect -
-hbreg[=global] register Harbour Script (.hb) with hbmk2 (Windows only)
-
-hbunreg[=global] elimina la registrazione dello Script Harbour (.hb) da hbmk2 (solo Windows)
-
-find <text> elenca tutte le funzioni conosciute di Harbour che contengono <text> nel loro nome, insieme con il loro pacchetto (ignora maiuscole e minuscole, accetta più valori, può contenere caratteri jolly)
-
-hbmake=<file> Converte il progetto hbmake <file> in file .hbp
-
-xbp=<file> convert .xbp (xbuild) project <file> to .hbp file
-
-xhp=<file> convert .xhp (xMate) project <file> to .hbp file
-
--hbdirbin output Harbour binary directory to stdout
-
--hbdirdyn output Harbour dynamic library directory to stdout
-
--hbdirlib output Harbour static library directory to stdout
-
--hbdirinc output Harbour header directory to stdout
-
--hbinfo[=nested] output Harbour build information to stdout. Output is in JSON format. The included paths always contain forward slashes. Each JSON block is followed by an 0x0A byte.
-
-plat=<platform> override default target platform (default: automatic)
-
-cpu=<cpu> ignora la CPU predefinita di destinazione (predefinito: automatico) (SPERIMENTALE)
-
-comp=<compiler> sovrascrive la C compiler autodetection
Special value:
- bld: use original build settings (default on *nix) -
-build=<name> specificare un nome di compilazione
-
-lang=<lang> ignora la lingua predefinita. <lang> è un codice ISO di lingua.
-
-width=<n> imposta la larghezza dell'output a <n> caratteri (0=illimitato)
-
-shl show sub-project level in output lines
-
-viewhelp Help esteso nel visualizzatore di testo
-
-longhelp aiuto esteso
-
-longhelpmd Help esteso in formato Markdown
-
-harbourhelp Harbour compiler help (all Harbour compiler options are accepted as is by hbmk2)
-
-credits Riconoscimenti del compilatore Harbour
-
-build Informazioni del compilatore Harbour
-
-version visualizza solamente la versione dell'intestazione
Options below are internal/developer ones (compatibility not guaranteed):
- -debugtime measure time spent on the build
- -debuginc display internals of incremental build
- -debugstub display content of all internally generated source files
- -debugi18n display internals on translation file generation
- -debugdepd display internals of dependency detection
- -debugpars display all input parameters in processing order
- -debugrte generate a run-time error
You can sym-link/copy/rename hbmk2 to the following names to alter default mode of operation:
- hbrun*|*hbrun mode script runner / interactive shell
- hbrund|hbrun*d mode script runner / interactive shell in debug mode
- harbour modo -hbraw (emulazione del compilatore Harbour - raw -)
- clipper modalità -hbcmp (emulazione compilatore Clipper)
- rtlink modalità -rtlink (emulazione linker di Clipper)
- exospace modalità -rtlink (emulazione linker di Clipper)
- blinker modalità -rtlink (emulazione linker di Clipper)
- *10 opzione -hb10
- *20 opzione -hb20
- *30 opzione -hb30
- x* opzione -xhb
- hbcmp*|*hbcmp modalità -hbcmp (emula il compilatore Harbour producendo un oggetto binario)
- hbcc*|*hbcc modo -hbcc (emulazione compilatore Clipper)
- hblnk*|*hblnk modo -hblnk (emulazione linker di Clipper)
- hbexe*|*hbexe modo -hbexe
- hblib*|*hblib modo -hblib
- hbdyn*|*hbdyn modo -hbdyn
Files:
-
*.hbp project file. Can contain any number of command-line options, which are expected to create an output. Lines beginning with '#' character are ignored, otherwise newline is optional and options are space separated, just like on the command-line. You must enclose option containing space in double quotes. Each .hbp file reference will be executed as a sub-project.
-
*.hbm insieme di opzioni. Può essere utilizzata per raccoglierle in un file ed includerle nei files di progetto. Esso usa lo stesso formato .hbp.
-
*.hbc collection of options that accompany components (aka 'libs', aka packages). Use different syntax than command-line and .hbp/.hbm files. Lines beginning with '#' character are ignored, each directive must be placed in separate line.
-
*.ch se passato direttamente come file sorgente, esso sarà utilizzato come intestazione standard addizionale
-
hbmk.hbc standard .hbc file that gets automatically processed, if present. Possible location(s) (in order of precedence) [*]: %APPDATA%\.harbour, <cartella hbmk2>
-
hbmk.hbm optional .hbm file residing in current working directory, which gets automatically processed before other options
-
$hb_pkg_dynlib.hbm special .hbm file embedded inside hbmk2. It manages the details of creating a dynamic library (in the style of Harbour contribs).
-
$hb_pkg_install.hbm special .hbm file embedded inside hbmk2. It manages the details of installing build targets and related package files to standard locations (in the style of Harbour contribs).
-
*.hb Script di Harbour
-
*.hrb Harbour binario portabile (conosciuto anche come script Harbour precompilato)
-
hbstart.hb startup Harbour script for interactive Harbour shell. It gets executed automatically on shell startup, if present. Possible locations (in order of precedence) [*]: .\, %APPDATA%\.harbour, <cartella hbmk2>
-
shell plugins plugins .hb e .hrb per la shell interattiva di Harbour. Possono essere situati in [*]: %APPDATA%\.harbour\
-
.hb_history memorizza la cronologia dei comandi per la shell interattiva di Harbour. E' possibile disattivare la cronologia creando la prima linea 'no' (senza virgolette e ritorno a capo). E' contenuta in [*]: %APPDATA%\.harbour\
-
hb_extension list of extensions to load in interactive Harbour shell. One extension per line, part of line beyond a '#' character is ignored. Alternate filename on MS-DOS: hb_ext.ini. Resides in [*]: %APPDATA%\.harbour\
Variabili macro:
- ${hb_root} cartella di hbmk2
- ${hb_dir} la cartella del file è usata
- ${hb_dirname} cartella principale del nome del file è utilizzata
- ${hb_name} nome del file in uso (senza cartella ed estensione)
- ${hb_self} nome completo del file utilizzato
- ${hb_curdir} attuale cartella di lavoro
- ${hb_tempdir} Directory di sistema per i files temporanei
- ${hb_targetname} nome del progetto (senza nome cartella ed estensione). Ritorna .adhoc. se non c'è il file di progetto.
- ${hb_targettype} tipologia del progetto (hbexe, hblib, hbdyn, hbdynvm, hbimplib, hbppo, hbhrb, hbcontainer)
- ${hb_plat} piattaforma selezionata
- ${hb_comp} Compilatore C selezionato
- ${hb_comp_ver} Versione del compilatore C
- ${hb_build} nome di compilazione
- ${hb_cpu} CPU selezionata
- ${hb_work} nome di default della cartella di lavoro
- ${hb_workdynsub} sottocartella di lavoro di default per la libreria dinamica di destinazione
- ${hb_dynprefix} prefisso della libreria dinamica
- ${hb_dynsuffix} suffisso della libreria dinamica
- ${hb_dynext} estensione della libreria dinamica
- ${hb_ver} Harbour version in hexadecimal triple byte format. F.e.: 030200
- ${hb_verstr} Versione di Harbour in un formato leggibile dall'uomo <maggiore>.<minore>.<rilascio>.<stato>. Per esempio: 3.2.0dev
- ${hb_major} numero primario di versione Harbour
- ${hb_minor} numero secondario di versione Harbour
- ${hb_release} numero di versione di rilascio di Harbour
- ${hb_status} Stato della versione di Harbour
- ${hb_revision} Revisione di Harbour
- ${hb_host_plat} Motore Harbour
- ${hb_host_plat_unix} ritorna '1' se la piattaforma host Harbour è *nix compatibile
- ${hb_bin} cartella dei file binari Harbour
- ${hb_lib} Cartella della libreria statica di Harbour
- ${hb_lib3rd} Cartella di Harbour della libreria statica di terze parti
- ${hb_dyn} Cartella della libreria dinamica di Harbour
- ${hb_inc} cartella degli header Harbour
- ${hb_addons} cartella base degli add-ons Harbour
- ${hb_first} name of source file that holds the entry function (without directory and extension)
- ${hb_outputdir} directory dell'output
- ${hb_outputname} nome dell'output (senza estensione)
- ${hb_level} livello di recursione del sub-progetto
- ${<depname>} restituisce la directory di intestazione della dipendenza <depname>, o '1 ', se essa non viene rilevata
- ${<envvar>} ritorna il valore della variabile d'ambiente <envvar>
Filtri (è possibile combinarli e/o negarli):
- {<platform>} piattaforma di sestinazione. Dove <platform> può essere qualsiasi valore accettato dall'opzione -plat=
- {<compiler>} compilatore C di destinazione. Dove <compiler> può essere qualunque valore accettato dall'opzione -comp=.
- {<cpu>} CPU di destinazione. Dove <cpu> può essere una tra i seguenti: x86, x86_64, ia64, arm, mips, sh
- {<targettype>} build target type. Where <targettype> is any of the values returned by macro variable ${hb_targettype}.
- {mt} build target is multi-threaded (see -mt option)
- {st} build target is single-threaded (see -st option)
- {gui} destinazione GUI (vedi l'opzone -gui)
- {std} console target (see -console option)
- {debug} è abilitato il debug a livello C (vedi l'opzione -debug)
- {nodebug} C level debugging is disabled (see -debug- option)
- {shared} shared build (see -shared and related options)
- {static} static build (see -static and related options)
- {lngcpp} modalità C++ forzata (vedere l'opzione -cpp)
- {lngc} modalità C forzata (vedere l'opzione -cpp-)
- {winuni} Modalità Windows UNICODE (WIDE) (vedere l'opzione -winuni)
- {winansi} Modalità ANSI Windows (vedere l'opzione -winuni-)
- {unix} La piattaforma di destinazione è compatibile *nix (bsd, hpux, sunos, beos, qnx, android, vxworks, symbian, linux, darwin, cygwin, minix, aix)
- {allwin} la piattaforma di destinazione è compatibile con Windows (win, wce)
- {allgcc} target C compiler belongs to gcc family (gcc, mingw, mingw64, mingwarm, djgpp, gccomf, clang, open64, pcc)
- {allmingw} target C compiler is mingw* (mingw, mingw64, mingwarm)
- {allmsvc} il compilatore C di destinazione è msvc* (msvc, msvc64, msvcia64, msvcarm)
- {allbcc} il compilatore C di destinazione è bcc* (bcc, bcc64)
- {allpocc} il compilatore dell'eseguibile C è pocc* (pocc, pocc64, poccarm)
- {allicc} il compilatore dell'eseguibile C è icc* (icc, iccia64)
- {hb10} modalità di comaptibilità Harbour 1.0.x (vedi l'opzione -hb10)
- {hb20} modalità di comaptibilità Harbour 2.0.x (vedi l'opzione -hb20)
- {hb30} modalità di comaptibilità Harbour 3.0.x (vedi l'opzione -hb30)
- {xhb} modalità xhb (vedi l'opzione -xhb)
- {hb_ispath='<file|dir>'} il filtro sarà soddisfatto se il esiste il nome <file> o <dir> sul disco.
- {MACRO} verrà soddisfatto il filtro se ${MACRO} è valorizzato e diverso da '0' or 'no' (ignora maiuscole e minuscole)
- {MACRO='<value>'} filter will pass if ${MACRO} value equals to <value> (case insensitive).
- {MACRO>'<value>'} il filtro passerà se il valore ${MACRO} è più grande di <value> (ignora maiuscole e minuscole).
- {MACRO<'<value>'} il filtro passerà se il valore ${MACRO} è più piccolo di <value> (ignora maiuscole e minuscole).
Costanti predefinite nei sorgenti:
-
__HBSCRIPT__HBMK_PLUGIN quando uno scripr .hb viene compilato come plugin hbmk2
-
__HBEXTREQ__ dove un file sorgente .hbx è presente in un progetto (disponibile nei sorgenti Harbour)
-
HBMK_HAS_<hbcname> when <hbcname>.hbc package is linked to the build target. The value is the version= value from the .hbc file, converted to a decimal number, which is '1', if not specified. (available in Harbour sources)
-
HBMK_HAS_<depname> dove la dipendenza <depname> è stata rilevata (disponibile nei sorgenti C)
-
__HBSCRIPT__HBSHELL quando un file sorgente Harbour è eseguito come uno script di shell
-
<standard Harbour> __PLATFORM__*, __ARCH*BIT__, __*_ENDIAN__, ecc...
Predefined constants in build files (they are available after '-depfinish=<depname>' / 'depfinish=<depname>'):
- HBMK_HAS_<depname> quando la dipendenza <depname> è stata rilevata
- HBMK_DIR_<depname> ritorna la cartella di intestazione dove <depname> è stato rilevato, o un valore vuoto se non è stato rilevato.
- HBMK_HAS_<depname>_LOCAL quando la dipendenza <depname> è stata rilevata nella locazione configurata da -depincpathlocal= opzione
Variabili d'ambiente:
-
HBMK_OPTIONS accepts any options as if they were passed in the beginning of the command-line
-
HB_PLATFORM accetta gli stessi valori come l'opzione -plat=
-
HB_COMPILER accetta gli stessi valori come l'opzione -comp=
-
HB_CPU accetta gli stessi valori come l'opzione -cpu=
-
HB_BUILD_NAME accetta gli stessi valori come l'opzione -build=
-
HB_LANG accetta gli stessi valori come l'opzione -lang=
-
HB_USER_LIBS accetta gli stessi valori (separati da uno spazio) come l'opzione -l
-
HB_USER_LIBPATHS accetta gli stessi valori (separati da uno spazio) come l'opzione -L
-
HB_USER_PRGFLAGS opzioni da passare al compilatore Harbour (prima delle opzioni nella riga di comando)
-
HB_USER_CFLAGS opzioni da passare al compilatore C (prima delle opzioni nella riga di comando)
-
HB_USER_RESFLAGS opzioni da passare al compilatore di risorse (prima delle opzioni nella riga di comando) (solo Windows)
-
HB_USER_LDFLAGS opzioni da passare al linker (eseguibile) (prima delle opzioni da linea di comando)
-
HB_USER_DFLAGS opzioni da passare al linker (libreria dinamica) (prima delle opzioni da linea di comando)
-
HB_USER_AFLAGS opzioni da passare al linker (libreria statica) (prima delle opzioni da linea di comando)
-
HB_COMPILER_VER override C compiler version autodetection (gcc and msvc compiler families only). Format: <15><00>[.<00>] = <major><minor>[.<revision>]
-
HB_CCPATH ignora la cartella del compilatore C (solamente per la famiglia dei compilatori gcc)
-
HB_CCPREFIX ignora il prefisso del compilatore C (solamente per la famiglia dei compilatori gcc)
-
HB_CCSUFFIX ignora il suffisso del compilatore C (solamente per la famiglia dei compilatori gcc)
-
HB_INSTALL_PREFIX ignora la cartella base di installazione di Harbour
-
HB_INSTALL_ADDONS override Harbour base add-ons directory
-
HB_EXTENSION lista di estensioni separate da spazio da caricare nella shell interattiva di Harbour
direttive .hbc (dovrebbero essere scritte in righe separate):
- echo=<msg> visualizzare <msg>
- skip=[<msg>] salta l'elaborazione del resto del file. hbc. Visualizza <msg>, se specificato.
- stop=[<msg>] ferma la compilazione. Visualizza <msg>, se specificato.
- sources= aggiunge come file di input una lista di file separati da spazio
- headers= aggiungere un elenco di intestazioni .ch separate da spazio come intestazione standard
- libs= Aggiungi un elenco di librerie, separate da uno spazio (vedi l'opzione -l per maggiori informazioni)
- frameworks= aggiunge una lista di strutture separate da spazio (solo Darwin)
- requests= add space separated list of symbols to force link to the build target
- syslibs= aggiungere un elenco di librerie separate da uno spazio, come sistema di librerie (prime delle normali librerie)
- hbcs= embed space separated list of .hbc files. Names without the extension is accepted. These references are processed in place.
- autohbcs= lista di valori separati da spazio come nell'opzione -autohbc=
- libpaths= lista di ulteriori percorsi di libreria separati da spazio
- incpaths= aggiungere un elenco di percorsi di intestazione addizionali, separati da uno spazio (sia per Harbour e C)
- instfiles= lista di valori separati da spazio come nell'opzione -instfile=
- instpaths= lista di valori separati da spazio come nell'opzione -instpath=
- prgflags= lista di valori separati da spazio come nell'opzione -prgflag=
- cflags= lista di valori separati da spazio come nell'opzione -cflag=
- resflags= lista di valori separati da spazio come nell'opzione -resflag=
- ldflags= lista di valori separati da spazio come nell'opzione -ldflag=
- ldflags+= lista di valori separati da spazio come nell'opzione -ldflag+=
- dflags= lista di valori separati da spazio come nell'opzione -dflag=
- dflags+= lista di valori separati da spazio come nell'opzione -dflag+=
- pflags= lista di valori separati da spazio come nell'opzione -pflag=
- psources= lista di valori separati da spazio come nell'opzione -pi=
- gui=<bool> opzione 'yes' = -gui, 'no' = -std
- mt=<bool> opzione 'yes' = -mt, 'no' = -st
- pic=<bool> opzione 'yes' = -pic, 'no' = -pic-
- shared=<bool> opzione 'yes' = -shared, 'no' = -static
- shareddef=<bool> simile a shared=, ma funziona solo se la modalità shared/static non è stata impostata prima
- fullstatic=<bool> opzione 'yes' = -fullstatic, 'no' = -static
- debug=<bool> opzione 'yes' = -debug, 'no' = -debug-
- optim= opzione 'yes' = -optim, 'no' = -optim-
- nulrdd=<bool> opzione 'yes' = -nulrdd, 'no' = -nulrdd-
- nodefgt=<bool> opzione 'yes' = -nodefgt, 'no' = -nodefgt-
- map=<bool> opzione 'yes' = -map, 'no' = -map-
- hbcppmm=<bool> opzione 'yes' = -hbcpmm, 'no' = -hbcpmm-
- implib=<bool> opzione 'yes' = -implib, 'no' = -implib-
- winuni=<bool> opzione 'yes' = -winuni, 'no' = -winuni-
- strip=<bool> opzione 'yes' = -strip, 'no' = -strip-
- run=<bool> opzione 'yes' = -run, 'no' = -run-
- inc=<bool> opzione 'yes' = -inc, 'no' = -inc-
- safe=<bool> opzione 'yes' = -safe, 'no' = -safe-
- cpp= come l'opzione -cpp=
- warn= come l'opzione -warn=
- compr= come l'opzione -compr=
- head= come l'opzione -head=
- plugins= lista separata da spazi di plugin hbmk2 da caricare
- gt=<name> come l'opzione -gt<name>
- gtdef=<name> setta il GT di default da utilizzare
- env= come l'opzione -env:
- deppkgname= come l'opzione -deppkgname=
- depkeyhead= come l'opzione -depkeyhead=
- depoptional= come l'opzione -depoptional=
- depcontrol= come l'opzione -depcontrol=
- depincroot= come l'opzione -depincroot=
- depincpath= come l'opzione -depincpath=
- depincpathlocal= come l'opzione -depincpathlocal=
- depimplibs= come l'opzione -depimplibs=
- depimplibd= come l'opzione -depimplibd=
- depfinish= come l'opzione -depfinish=
- name= Nome del pacchetto
- description= descrizione del pacchetto
- version=<x.y.z> numero di versione del pacchetto, dove x, y, z >=0 <=255. Il valore predefinito è 0.0.1, se non specificato.
- keywords= lista di parole chiave separate da spazio
- licences= Elenco di licenze separate da uno spazio
- repository= lista di riferimenti, separati da spazio, ai repository sorgenti
Plugin API:
('hbmk' is the context variable received by the plugin entry function)
- hbmk_Register_Input_File_Extension( hbmk, <cExt> ) -> NIL
Register input file extension to be passed to plugin (by default all unknown file extensions are passed to Harbour compiler). - hbmk_AddInput_PRG( hbmk, <cFileName> ) -> NIL
Aggiunge al progetto un file Harbour di input - hbmk_AddInput_C( hbmk, <cFileName> ) -> NIL
Aggiungere in input un file .C al progetto. - hbmk_AddInput_CPP( hbmk, <cFileName> ) -> NIL
Aggiungere al progetto un file C++ in input. - hbmk_AddInput_RC( hbmk, <cFileName> ) -> NIL
Aggiunge al progetto un file di risorsa di input - hbmk_AddInput_OBJ( hbmk, <cFileName> ) -> NIL
Aggiunge al progetto un file binario oggetto. - hbmk_AddInput_INSTFILE( hbmk, <cFileName>, [<cGroup>] ) -> NIL
Add a file to be installed, with an optional -instpath= group name. - hbmk_OutStd( hbmk, <cText> ) -> NIL
Invio del testo su stdout. - hbmk_OutErr( hbmk, <cText> ) -> NIL
Invio del testo su stderr - hbmk_OutStdRaw( hbmk, ... ) -> NIL
Invia testo a stdout senza alcuna formattazione. - hbmk_OutErrRaw( hbmk, ... ) -> NIL
Invia testo a stderr senza alcuna formattazione. - hbmk_Macro( hbmk, <cMacro> ) -> <cResult>
Esegue la macro espressione hbmk2. - hbmk_FNameEscape( hbmk, <cFileName> ) -> <cFileName>
Escape/quote filename for using it as external command parameter. - hbmk_PathSepToTarget( hbmk, <cFileName> ) -> <cFileName>
Convert filename to the format required for the target platform/C compiler. - hbmk_PathSepToForward( <cPath> ) -> <cPath>
Convertire il nome del file con lo "slash" come separatore di cartella - hbmk_PathFromWorkdirToCWD( hbmk ) -> <cRelativePath>
Ritorna il percorso relativo di -workdir= valore dalla cartella di lavoro corrente. - hbmk_FindInPath( <cFileName>, [<xPath>], [<aExtDef>] ) -> <cFNFound> | NIL
Find file in <xPath> (array or pathsep delimited string are accepted) with list of <aExtDef> alternate extensions (defaults to executable binaries). Returns filename if found and NIL if not. - hbmk_FNameDirExtSet( <cFileName>, [<cDirNew>], [<cExtNew>] ) -> <cFileName>
Cambia cartella e/o estensione nel nome file - hbmk_FuncNameEncode( <cFuncName> ) -> <cFuncNameEncoded>
Encode function name according to Harbour compiler rules for forming HB_FUNC() function names in C code. - hbmk_StrStripQuote( <cString> ) -> <cString>
Elimina da una stringa la coppia di delimitatori - hbmk_ArrayToList( <aList>, [<cSeparator>] ) -> <cList>
Converte un array di stringa in una stringa. Il separatore predefinito è un singolo spazio.
Plugin variables:
('hbmk' context hash items, case-sensitive, read-only unless marked otherwise)
- "apiver" varsione API come intero
- "cSTATE" callback state. Can be: 'init', 'pre_all', 'pre_prg', 'pre_res', 'pre_c', 'pre_link', 'pre_lib', 'pre_cleanup', 'post_build', 'post_all'
- "params" array of parameters passed to plugins via -pflag=/pi= options or having an extension registered via hbmk_Register_Input_File_Extension()
- "vars" hash of plugin custom variables. Writable, local to each plugin
- "cPLAT" valore -plat
- "cCOMP" valore -comp
- "nCOMPVer" vedere variabile d'ambiente HB_COMPILER_VER
- "cCPU" valore -cpu
- "cBUILD" valore -build=
- "cOUTPUTNAME" valore -o
- "cTARGETNAME" vedere la macro ${hb_targetname}
- "cTARGETTYPE" vedere la macro ${hb_targettype}
- "lREBUILD" -rebuild stato dell'opzione
- "lCLEAN" -clean stato dell'opzione
- "lDEBUG" -debug stato dell'opzione
- "lMAP" -map stato dell'opzione
- "lSTRIP" -strip stato dell'opzione
- "lDONTEXEC" -traceonly stato dell'opzione
- "lIGNOREERROR" -ignore stato dell'opzione
- "lTRACE" -trace stato dell'opzione
- "lQUIET" -q stato dell'opzione
- "lINFO" -info stato dell'opzione
- "lBEEP" -beep stato dell'opzione
- "lRUN" -run stato dell'opzione
- "lINC" -inc stato dell'opzione
- "cCCPATH" vedere variabile d'ambiente HB_CCPATH
- "cCCPREFIX" vedere variabile d'ambiente HB_CCPREFIX
- "cCCSUFFIX" vedere variabile d'ambiente HB_CCSUFFIX
- "cCCEXT" vedere variabile d'ambiente HB_CCEXT
- "cWorkDir" valore -workdir=
- "nExitCode" Codice di uscita attuale
Shell API disponibile negli Harbour scripts:
- hbshell_gtSelect( [<cGT>] ) -> NIL
Cambia GT. Default [*]: 'gtwin' - hbshell_Clipper() -> NIL
Abilita la modialità di compatibilità Clipper (non-Unicode) - hbshell_include( <cHeader> ) -> <lSuccess>
Carica l'intestazione Harbour. - hbshell_uninclude( <cHeader> ) -> <lSuccess>
Scarica l'intestazione Harbour. - hbshell_include_list() -> NIL
Visualizza l'elenco di intestazione di Harbour caricato. - hbshell_ext_load( <cPackageName> ) -> <lSuccess>
Carica un pacchetto. Simile alla direttiva PP #request. - hbshell_ext_unload( <cPackageName> ) -> <lSuccess>
Scaricare pacchetto. - hbshell_ext_get_list() -> <aPackages>
Lista dei pacchetti caricati - hbshell_DirBase() -> <cBaseDir>
hb_DirBase() not mapped to script. - hbshell_ProgName() -> <cPath>
hb_ProgName() not mapped to script.
Esempi per partire con hbmk2:
- Per eseguire la shell interattiva (prompt 'punto')
$ hbmk2 . - Per eseguire uno script di Harbour
$ hbmk2 myscript.hb [<parametro[i]>]
Esempi per compilare e lanciare un eseguibile portabile Harbour (ossia uno script Harbour precompilato):
- Per compilare
$ hbmk2 -gh myscript.hb - Per eseguire risultato di cui sopra
$ hbmk2 myscript.hrb [<parametro[i]>]
Esempi per la compilazione di un'applicazione Harbour
- Per compilare un singolo .prg
$ hbmk2 hello.prg - Per compilare in modalità incrementale più di un sorgente .prg in una singola applicazione
$ hbmk2 mymain.prg myfuncs.prg -inc - Per compilare un'applicazione che utilizza un file di progetto
$ hbmk2 myapp.hbp - Per compilare un'applicazione che utilizza il modo incrementale
$ hbmk2 myapp.hbp -inc - To build an application which uses a contrib package or 3rd party (add-on) package that ships with an .hbc file
$ hbmk2 myapp.prg hbct.hbc - Per compilare un'applicazione che utilizza direttamente una libreria
$ hbmk2 myapp.prg -lmylib -L<path_to_mylib> - Per compilare un'applicazione che usa una risorsa Windows
$ hbmk2 mymain.prg myres.rc - Per compilare un'applicazione che si linka a librerie dinamiche Harbour
$ hbmk2 -shared myapp.prg - Per compilare un'applicazione esterna a tutti i sorgenti .prg e .c residenti nella sottocartella 'source'
$ hbmk2 -omyapp src/*.prg src/*.c
Esempi per la compilazione di una libreria statica Harbour:
- Per compilare la libreria 'mylib' dai sorgenti
$ hbmk2 -hblib mylibsrc.prg -omylib - Per compilare la libreria 'mylib' dai sorgenti usando il modo incrementale
$ hbmk2 -hblib mylibsrc.prg -omylib -inc
Codice di uscita ("errorlevels"):
- 0 Nessun errore
- 1 piattaforma sconosciuta
- 2 compilatore sconosciuto
- 3 Individuazione fallita di Harbour
- 5 failed stub creation
- 6 fallimento nella compilazione (Harbour, compilatore C, compilatore delle Risorse)
- 7 failed in final assembly (linker or library manager)
- 8 non sopportato
- 9 Impossibile creare la cartella di lavoro
- 19 aiuto
- 10 Dipendenza omessa o disabilitata
- 20 Inizializzazione del plugin
- 30 nidificazione troppo profonda
- 50 richiesta di stop
- <altro> quando è utilizzata l'opzione -run, il codice di uscita sarà quello riportato dall'eseguibile
Note:
-
<script> can be:
<@script> or <script.hbm>: command-line options in file
<script.hbp>: command-line options in file, it also marks a new build target if specified on the command-line
<script.hbc>: package configuration file -
Il nome del file sorgente senza estensione caricherà il file. hbp, se tale file. hbp esiste nella cartella corrente. Altrimenti, verrà utilizzata l'estensione .prg.
-
Multiple -l, -L, -i and <script> parameters are accepted.
-
Regular Harbour compiler options are also accepted as is.
(see them with -harbourhelp option) -
hbmk.hbc 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.
-
se esistente, lo script make hbmk.hbm nella cartella corrente è sempre processato
-
E' consigliato l''utilizzo delle normali barre nei valori opzionali, come separatore per le cartelle, ma le barre rovesciate sono egualmente accettate.
-
Filters are accepted in each .hbc line and most options.
Filters can be combined using '&' (and), '|' (or) operators, negated by '!' operator and grouped by parentheses. Ex.: {win}, {gcc}, {linux|darwin}, {win&!pocc}, {(win|linux)&!watcom}, {unix&mt&gui}, -cflag={win}-DMYDEF, -stop{dos}, -stop{!allwin} -
Most .hbc lines (libs=, hbcs=, prgflags=, cflags=, ldflags=, libpaths=, instfiles=, instpaths=, echo=) and corresponding command-line parameters will accept macro variables. libpaths= also accepts %{hb_name} which translates to the name of the .hbc file under search.
-
Options accepting macro variables also support command substitution. Enclose command inside ``, and, if the command contains space, also enclose in double quotes. Standard output of the command will be used as the value. F.e. "-cflag=`wx-config --cflags`", or ldflags={unix&gcc}"`wx-config --libs`".
-
When multiple build target type selection options (-hblib, -hbdyn, etc.) are specified, the first one will be significant, the rest will be silently ignored.
-
Libraries and object files built with/for CA-Cl*pper will not work with any supported platform/compiler.
-
Comportamenti predefiniti e caratteristiche potrebbero essere differenti in altre piattaforme/compilatori.
-
Per eseguire hbmk2 non sono richiesti né GNU Make, o qualsiasi altro strumento make specifico per il compilatore C, né MSYS (in Windows).
-
. (il punto) passato come primo parametro entrerà nella shell interattiva di Harbour.
-
.hb, .hrb or .dbf file passed as first parameter will be run as Harbour script. If the filename contains no path components, it will be searched in current working directory and in PATH. If not extension is given, .hb and .hrb extensions are searched, in that order. .dbf file will be opened automatically in shared mode and interactive Harbour shell launched. Non-standard extensions will be autodetected for source and precompiled script types. Note, for Harbour scripts, the codepage is set to UTF-8 by default. The default core header 'hb.ch' is automatically #included. The default date format is the ISO standard: yyyy-mm-dd. The default GT is 'gtcgi', unless full-screen CUI calls are detected, when 'gtwin' [*] is automatically selected (except for INIT PROCEDUREs).
-
Puoi usare i tasti <Alt+V> nella shell interativa di Harbour per incollare il testo dalla clipboard.
-
Values marked with [*] may be host platform and/or configuration dependent. This help was generated on 'win' host platform.
Supported <compiler> values for each supported <platform> value:
- linux gcc, clang, icc, watcom, sunpro, open64
- darwin gcc, clang, icc
- win mingw, msvc, clang, bcc, bcc64, watcom, icc, pocc, xcc, mingw64, msvc64, msvcia64, iccia64, pocc64
- wce mingwarm, mingw, msvcarm, poccarm
- os2 gcc, gccomf, watcom
- dos djgpp, watcom
- bsd gcc, clang, pcc
- hpux gcc
- beos gcc
- qnx gcc
- android gcc, gccarm
- vxworks gcc, diab
- symbian gcc
- cygwin gcc
- minix clang, gcc
- aix gcc
- sunos gcc, sunpro
Licenza:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
their web site at http://www.gnu.org/).
License extensions:
- This source code must be kept and distributed as part
of the Harbour package and/or the placement of the tool sources
and files must reflect that it is part of Harbour Project.
- Copyright information must always be presented by
projects including this tool or help text.
- Modified versions of the tool must clearly state this
fact on the copyright screen.
- Source code modifications shall always be made available
along with binaries.
- Help text and documentation is licensed under
Creative Commons Attribution-ShareAlike 3.0:
http://creativecommons.org/licenses/by-sa/3.0/
Autore:
- Viktor Szakats (vszakats.net/harbour)