Artistic Style Versions
Linux Version
Windows Version
Mac OS X Version
Artistic Style Versions
astyle_x.y_linux.tar.gz is the Linux version of Artistic Style. It contains the source code, documentation, and makefiles for compiling the source code. Refer to the Linux Version compile instructions below. Refer to the documentation for instructions on executing AStyle.exe. The Linux shell will allow the use of wildcards (such as *.cpp) during execution.
astyle_x.y_windows.zip is the Windows version of Artistic Style. It contains the source code, documentation, a Visual C project file, and an executable, AStyle.exe. Refer to the documentation for instructions on executing AStyle.exe. It has been compiled to allow the use of wildcards (such as *.cpp) during execution.
astyle_x.y_macosx.tar.gz is the Mac OS X version of Artistic Style. It contains the source code, documentation, and a makefile for compiling the source code. Refer to the Mac OS X Version compile instructions below. Refer to the documentation for instructions on executing AStyle.exe. The Mac shell will allow the use of wildcards (such as *.cpp) during execution.
The build directory in all versions contains all the makefiles and project files. If you want all platforms you need to download only one distribution package. The difference in distribution packages are the line endings and the executable included with Windows. Most development environments and compilers will accept either type of line ending.
Linux Version
GCC Compiler
To compile using the GCC compiler you must have GCC (3.1 or better) installed. To build the Artistic Style configurations use the makefile located in the astyle/build directory. The executables will be in the astyle/bin directory. To build the command line configuration enter the following:
cd astyle/build makeTo build the other astyle configurations you can enter the file name or a symbolic name. Entering "make astyle" or "make release" will build the command line configuration. Following are the symbolic names and file names (in parens) of the various configurations:
- release builds the Artistic Style command line program (astyle). This is the default option.
- shared builds the Artistic Style program as a shared library (libastyle.so).
- static builds the Artistic Style program as a static library (libastyle.a).
- debug builds the Artistic Style command line program with debugging information (astyled).
- shareddebug builds the Artistic Style program as a shared library with debugging information (libastyled.so).
- staticdebug builds the Artistic Style program as a static library with debugging information (libastyled.a).
- all builds all of the above configurations.
More than one configuration can be built at the same time. For example, to build all of the release configurations enter:
cd astyle/build make release shared staticIntel Compiler
The Intel makefile is named makeintel. To build astyle, use the makeintel file located in the astyle/build directory. The executables will be in the astyle/bin directory. To build the command line configuration enter the following:
cd astyle/build make -f makeintelAnother way to compile with Intel is to rename "makeintel" as "makefile". Then the -f option is not needed. If this is done the Intel makefile will always be used instead of the GCC makefile.
The configuration names for Intel are the same as for the GCC compiler. More than one configuration can be built at the same time. For example, to build all of the debug configurations enter:
cd astyle/build make -f makeintel debug shareddebug staticdebugOther Makefile Options
The following options do not depend on the compiler and can be run using either makefile.
clean
To remove the object files for all configurations:
make cleanThe executables will not be removed.
install
You must have the appropriate permissions to use install. To install the astyle executable to /usr/bin:
make installTo install the executable to a different directory set a value for the macro $(prefix). For example to install the executable to a users home directory (/home/user/bin):
make prefix=$HOME/bin installuninstall
You must have the appropriate permissions to use uninstall. To uninstall the astyle executable from /usr/bin:
make uninstallTo uninstall the executable from a different directory set a value for the macro $(prefix). For example to uninstall the executable from a users home directory (/home/user/bin):
make prefix=$HOME/bin uninstallNOTE: The uninstall option will NOT remove the .astylerc files from the users home directories. The files must be removed individually for each user.
Windows Version
Precompiled Executable
In addition to the source files, the Windows version contains an astyle executable (AStyle.exe). The executable is compiled to allow wildcard use during execution.
Visual C++ Compiler
There is a project file for Visual C++ 2003 (version 7) or higher. Open the file AStyle.sln in the AStyle/build directory. Select the Release configuration to compile the command line version. All output files will be in the AStyle/bin directory. The project has the following configurations.
- Release builds the Artistic Style command line program (AStyle.exe).
- Release Dll builds the Artistic Style program as a Dynamic Link Library (AStyle.dll). This will also produce the exports library and the static library for linking the dll.
- Release Lib builds the Artistic Style program as a Static Library (libAStyle.lib).
- Debug builds the Artistic Style command line program with debugging information (AStyled.exe).
- Debug Dll builds the Artistic Style program as a Dynamic Link Library (DLL) with debugging information (AStyled.dll). This will also produce the exports library and the static library for linking the dll.
- Debug Lib builds the Artistic Style program as a Static Library with debugging information (libAStyled.lib).
Other Compilers
To use other compilers a project file must be built using the compiler's development environment.
- Create a project using the compiler's development environment
- Add to the project all the .cpp and .h files in the src directory.
- In order to use wildcards (such as *.cpp) during execution:
With Visual C++, insert "setargv.obj" to the list of linker additional dependencies.
With the MinGW build of the GCC compiler, the use of wildcards is automatic.
With other compilers I don't know of a way to allow wildcards. I would appreciate the information if anyone knows.- Compile... It is usually best to optimize the program for speed.
To compile as a static or dynamic library define the macro ASTYLE_LIB. Then use the appropriate compiler and linker options to compile the library or DLL.
Mac OS X Version
Mac OS X uses the same makefile as Linux GCC. To build the Artistic Style configurations use the makefile located in the astyle/build directory. The executables will be in the astyle/bin directory. To build the command line configuration enter the following:
cd astyle/build makeThe configurations for Mac are the same as for the Linux GCC compiler. More than one configuration can be built at the same time. For example, to build all of the release configurations enter:
cd astyle/build make release shared static