# Makefile targets

There are a number of options that you can use to control exactly how Allegro will be compiled. On Unix platforms, you do this by passing arguments to the configure script (run "configure --help" for a list), but on other platforms you can set the following environment variables:

- DEBUGMODE=1
  Selects a debug build, rather than the normal optimised version.
- DEBUGMODE=2
  Selects a build intended to debug Allegro itself, rather than the normal optimised version.
- PROFILEMODE=1
  Selects a profiling build, rather than the normal optimised version.
- WARNMODE=1
  Selects strict compiler warnings. If you are planning to work on Allegro yourself, rather than just using it in your programs, you should be sure to have this mode enabled.
- STATICLINK=1 (MinGW, MSVC, BeOS, MacOS X only)
  Link as a static library, rather than the default dynamic library.
- STATICRUNTIME=1 (MSVC only)
  Link against static runtime libraries, rather than the default dynamic runtime libraries.
- TARGET_ARCH_COMPAT=[cpu] (GCC-based platforms only)
  This option will optimize for the given processor while maintaining compatibility with older processors. Example: set TARGET_ARCH_COMPAT=i586
- TARGET_ARCH_EXCL=[cpu] (GCC-based platforms only)
  This option will optimize for the given processor. Please note that using it will cause the code to *NOT* run on older processors. Example: set TARGET_ARCH_EXCL=i586
- TARGET_OPTS=[opts] (GCC-based platforms only)
  This option allows you to customize general compiler optimisations.
- TARGET_ARCH_EXCL=[opts] (MSVC only)
  This option allows you to optimize exclusively for a given architecture. Pass B to optimize for a PentiumPro or 7 to optimize for Pentium 4. Note that the options you can pass may be different between MSVC 6 and 7. Example: set TARGET_ARCH_EXCL=7
- CROSSCOMPILE=1 (DJGPP, MinGW only)
  Allows you to build the library under Linux by using a cross-compiler.
- ALLEGRO_USE_C=1 (GCC-based platforms only)
  Allows you to build the library using C drawing code instead of the usual asm routines. This is only really useful for testing, since the asm version is faster.
- UNIX_TOOLS=1
  Instructs the build process to use Unix-like tools instead of DOS tools. Note that you usually don't need to set it because the build process will try to autodetect this configuration.
- COMPILER_MSVC7=1 (MSVC only)
  Enables special optimizations for MSVC 7 (the default is MSVC 6). You don't normally need to set this flag since fix.bat msvc7 should do the same thing and is the preferred way of doing this.
- COMPILER_ICL=1 (MSVC only)
  Instructs the build process to use the Intel command line compiler icl rather than Microsoft's command line compiler cl. You don't normally need to pass this flag since fix.bat icl should do the same thing and is the preferred way of doing this. Do not try COMPILER_MSVC7=1 and COMPILER_ICL=1 at the same time.

If you only want to recompile a specific test program or utility, you can specify it as an argument to make, eg. "make demo" or "make grabber". The makefiles also provide some special pseudo-targets:

- 'info' (Unix only)
  Tells you which options this particular build of Allegro will use. Especially useful to verify that the required libraries were detected and you won't get a 'half-featured' Allegro.
- 'default'
  The normal build process. Compiles the current library version (one of optimised, debugging, or profiling, selected by the above environment variables), builds the test and example programs, and converts the documentation files.
- 'all' (non-Unix only)
  Compiles all three library versions (optimised, debugging, and profiling), builds the test and example programs, and converts the documentation files.
- 'lib'
  Compiles the current library version (one of optimised, debugging, or profiling, selected by the above environment variables).
- 'modules' (Unix only)
  This will compile all the modules currently configured. The 'lib' and 'modules' targets together are needed to build a working copy of the library, without documentation or programs.
- 'install'
  Copies the current library version (one of optimised, debugging, or profiling, selected by the above environment variables), into your compiler lib directory, recompiling it as required, and installs the Allegro headers.
- 'install-lib' (Unix only)
  You can use this to install the library and the modules only, without documentation or programs. Use the 'install' target to install everything.
- 'installall' (non-Unix only)
  Copies all three library versions (optimised, debugging, and profiling), into your compiler lib directory, recompiling them as required, and installs the Allegro headers.
- 'uninstall'
  Removes the Allegro library and headers from your compiler directories.
- 'docs'
  Converts the documentation files from the ._tx sources.
- 'chm-docs' (Windows only)
  Creates a compiled HTML file from the previously generated html output. This is not a default target, since you need Microsoft's HTML compiler (http://go.microsoft.com/fwlink/?LinkId=14188), and it has to be installed somewhere in your PATH. Also, this only works if you use '@multiplefiles' (see the top of docs/src/allegro._tx).
- 'docs-dvi' (Unix only)
  Creates the allegro.dvi device independent documentation file. This is not a default target, since you need the texi2dvi tool to create it. The generated file is especially prepared to be printed on paper.
- 'docs-ps' or 'docs-gzipped-ps' or 'docs-bzipped-ps' (Unix only)
  Creates a PostScript file from the previously generated DVI file. This is not a default target, since you need the texi2dvi and dvips tools to create it. The second and third targets compress the generated Postscript file. The generated file is especially prepared to be printed on paper.
- 'docs-pdf' (Unix only)
  Creates a PDF file. This is not a default target, since you need the texi2pdf tool to create it. The generated file is especially prepared to be printed on paper, and it also has hyperlinks.
- 'docs-devhelp' (Unix only)
  Creates normal HTML documentation with an additional xml index file which can be used by tools like Devhelp (http://www.devhelp.net/) to show context sensitive help within any editor using Devhelp, like for example http://anjuta.sourceforge.net/. The Allegro 'book' will be created in ``docs/devhelp/allegro.devhelp'`, you have to install it manually.
- 'install-man' (Unix and Mac OS X only)
  Generates Unix man pages for each Allegro function or variable and installs them.
- 'install-gzipped-man' or 'install-bzipped-man' (Unix only)
  Like install-man, but also compresses the manual pages after installing them (run only one of these).
- 'uninstall-man' (Unix)
  Uninstalls any man pages previously installed with 'install-man', 'install-gzipped-man', or 'install-bzipped-man'.
- 'install-info' or 'install-gzipped-info' or 'install-bzipped-info' (Unix only)
  Converts the documentation to Info format and installs it. The second and third targets compress the info file after installing it (run only one of them).
- 'uninstall-info' (Unix only)
  Uninstalls any man pages previously installed with 'install-info', 'install-gzipped-info', or 'install-bzipped-info'.
- 'clean'
  Removes generated object and library files, either to recover disk space or to force a complete rebuild the next time you run make. This target is designed so that if you run a "make install" followed by "make clean", you will still have a functional version of Allegro.
- 'distclean'
  Like "make clean", but more so. This removes all the executable files and the documentation, leaving you with only the same files that are included when you unzip a new Allegro distribution.
- 'veryclean'
  Use with extreme caution! This target deletes absolutely all generated files, including some that may be non-trivial to recreate. After you run "make veryclean", a simple rebuild will not work: at the very least you will have to run "make depend", and perhaps also fixdll.bat if you are using the Windows library. These targets make use of non-standard tools like SED, so unless you know what you are doing and have all this stuff installed, you should not use them.
- 'compress' (DJGPP, MinGW and MSVC only)
  Uses the DJP or UPX executable compressors (whichever you have installed) to compress the example executables and utility programs, which can recover a significant amount of disk space.
- 'depend'
  Regenerates the dependency files (obj/*/makefile.dep). You need to run this after "make veryclean", or whenever you add new headers to the Allegro sources.

Back to contents