Using the SHELL compiler

Introduction

The shell compiler is located in the subdirectory 'Compilers\' from the PureBasic drawer. The easier way to access this is to add this directory in the windows PATH variable, which will give access to all the commands of this directory at all times.

Command switchs

/? : display a quick help about the compiler.

/COMMENTED : create a commented '.asm' output file when creating an executable. This file can be re-assembled later when the needed modifications have been made. This option is for advanced programmers only.

/DEBUGGER : enable the debugger support.

/EXE "Filename" : create a standalone Executable or DLL specified by the filename at the desired path location.

/ICON "IconName" : add the specified icon to the executable.

/INLINEASM : enable the inline asm feature (asm routines can be written directly in the BASIC source code).

/RESIDENT "Filename" : create a resident file specified by the filename.

/CONSOLE: output file in Console format. Default format is Win32.

/DLL: output file is a DLL.

/NT4: Enable the NT4 compliance for multimedia functions (Sprite, Keyboard, Mouse).

/XP: Add the Windows XP theme support to the executable.

/REASM: Reassemble the PureBasic.asm file into an executable. This allow to use the /COMMENTED function, modify the asm output and creates the executable again.

/LINENUMBERING: Add lines and files information to the executable, which can slow it considerably. This is designed especially for third debug programs like the OnError library.

/QUIET: Disable all unnecessary text output, very useful when using another editor.

/STANDBY: Loads the compiler in memory and wait for external commands (editor, scripts...).

/MMX, /3DNOW, /SSE or /SSE2: Creates a processor specific executable. This means than if a processor specific routine is available it will be used for this executable. Therefore, the executable will run correctly only on computer with this kind of CPU.

/DYNAMICCPU: Creates a executable containing all the available processor specific routines. When the program is started, it looks for the processor type and then select the more appropriates routines to use. This makes a bigger executable, but result in the fastest possible program.

/RESOURCE "Filename": Add a Windows resource file (.rc) to the created executable or DLL. This should be not a compiled resource file, but an ascii file with the directives in it. It's possible to specify only one resource, but this file can include other resource script if needed.

/LINKER "ResponseFile": Specify a file which contains commands to be passed directly to the linker. On Windows, PureBasic use the PellesC linker (polink), more informations about the possible options can be found in the related documentation.

/IGNORERESIDENT "Filename": Doesn't load the specified resident file when the compiler starts. It's mostly useful when updating a resident which already exists, so it won't load it.

/CONSTANT Name=Value: Creates the specified constant with the given expression. Example: 'pbcompiler test.pb /CONSTANT MyConstant=10'. The constant #MyConstant will be created on the fly with a value of 10 before the program gets compiled.

Example:

  shell> pbcompiler sourcecode.pb
The compiler will compile the source code and execute it.

  shell> pbcompiler sourcecode.pb /DEBUGGER /INLINEASM
The compiler will compile the source code and execute it with debugger and inline asm support.