Repository navigation
Compiler Option Print
Home › Compiler Option: -print
Print out information
Syntax
-print option
Description
The -print option can be used to query the compiler for certain information which may be useful especially for build scripts. It does not prevent compilation of input files given besides the -print option, but the compiler also can be invoked with only a -print option and no input files, in which case it will not compile anything but only respond to the -print option.
Currently, the following -print options are recognized:
| option | effect |
|---|---|
| fblibdir | Prints the compiler's lib/ path |
| host | Prints the host system on which the compiler is running |
| target | Prints the target system for which the compiler is compiling (can be affected by the -target option) |
| x | Prints the file name of the output executable or library that the compiler will or would generate (named after the -x option), depending on other command line options |
| sha-1 | Prints the source code revision sha-1 used to build the compiler if defined at the compiler's build time, or an empty string if it was not defined |
| fork-id | Prints the custom defined project fork identifier name if defined at the compiler's build time, or an empty string if it was not defined |
Example
A makefile could use target := $(shell $(FBC) -print target) to find out the compilation target, which would even work when cross-compiling, with FBC set to something like fbc -target foo.
fbc -print x alone will print out the executable file extension for the target system.
fbc -print x -dll on the other hand will print out the dynamic library file name format.
fbc -print x -m foo will print out the executable file name that would be used when compiling a module called foo.bas.
fbc 1.bas 2.bas -lib -print x will compile 1.bas and 2.bas into a library, whose file name will be displayed.
See also
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing