{"id":18555338,"url":"https://github.com/c3d/make-it-quick","last_synced_at":"2026-01-21T09:32:09.816Z","repository":{"id":55295248,"uuid":"127927127","full_name":"c3d/make-it-quick","owner":"c3d","description":"A simple auto-configuring make-only build system","archived":false,"fork":false,"pushed_at":"2023-01-07T06:18:23.000Z","size":280,"stargazers_count":25,"open_issues_count":2,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-17T11:25:34.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c3d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-03T15:12:20.000Z","updated_at":"2025-02-12T05:20:04.000Z","dependencies_parsed_at":"2023-02-06T13:46:36.374Z","dependency_job_id":null,"html_url":"https://github.com/c3d/make-it-quick","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/c3d/make-it-quick","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3d%2Fmake-it-quick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3d%2Fmake-it-quick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3d%2Fmake-it-quick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3d%2Fmake-it-quick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c3d","download_url":"https://codeload.github.com/c3d/make-it-quick/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3d%2Fmake-it-quick/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28631142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:26:09.323Z","updated_at":"2026-01-21T09:32:09.793Z","avatar_url":"https://github.com/c3d.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Make-It-Quick (MIQ)\nA simple makefile-based build system for C / C++ programs\n\n## Features\n\nMake-It-Quick is a simple build system destined to make it easy to build C or\nC++ programs without having to write lengthy makefiles or going\nthrough the complexity of tools such as `automake` or `cmake`. It is\nwell suited for relatively small programs, although it has been used\nfor at least one much larger program.\n\n* Very short and readable makefiles offering all the most useful features\n* Compact size (about 500 lines of active makefile code for a typical build)\n* Fast, since short makefiles with few rules are quickly parsed\n* Automatic, incremental project configuration, generating a `config.h` file\n* Automatic logging of detailed build commands in log files\n* Product testing with `make test`\n* Product installation with `make install`\n* Compact, colorized progress report\n* Summary of errors and warnings at end of build\n* Colorization of error and warning messages\n* Rules to build various targets (optimized, debug, release, profile)\n* Rule modifiers for common build options, e.g. `v-debug` for verbose debug\n* Personal preferences easily defined with environment variables\n* Built-in help (`make help`)\n* Pure `make`, allowing you to use all standard `Makefile` syntax and features\n* Automatic, single-pass generation of header-file dependencies\n* Supports parallel builds\n* Supports separate libraries, to accelerate builds (libraries are\n  only built the first time, unless you request a \"deep\" build)\n* Portable (tested on Linux, macOS and Windows platforms)\n\nYou can find examples of how 'Make-It-Quick' is used in other projects:\n\n* [SPICE - Simple Protocol for Independent Computing Environments](https://github.com/c3d/spice)\n* [Flight recorder](https://github.com/c3d/recorder/blob/master/Makefile)\n* [XL programming language](https://github.com/c3d/XL-programming-language/blob/master/xlr/Makefile)\n* [ELFE programming language](https://github.com/c3d/elfe/blob/master/src/Makefile)\n* [XL reboot](https://github.com/c3d/xl/blob/master/Makefile)\n\n## Using Make-It-Quick\n\nTo use `make-it-quick`, you create a `Makefile`. A minimal makefile only needs\nto specify the name of the `SOURCES`, the name of the build `PRODUCTS`,\nand include the `make-it-quick/rules.mk` file, which contains the makefile rules:\n\n    MIQ=make-it-quick/\n    SOURCES=my-super-tool.cpp helper.c\n    PRODUCTS=my-super-tool.exe\n    include $(MIQ)rules.mk\n\nThat's all you need to get started. There is a small sample `Makefile`\nin this distribution.\n\nIn order to get a summary of the available build targets, use `make help`.\n\n### Using Make-It-Quick as a submodule or integrated in a project\n\nIn case you want to add Make-It-Quick to a project without adding\nanother dependency, you can add Make-It-Quick as a submodule of your\nproject, or copy it directly in your project. In that case, you would\nset the `MIQ` variable to point to a location of the `make-it-quick`\ndirectory relative to the makefiles, for example:\n\n    TOP=../\n    MIQ=$(TOP)make-it-quick/\n    SOURCES=my-super-tool.cpp helper.c\n    PRODUCTS=my-super-tool.exe\n    include $(MIQ)rules.mk\n\n\n## Building libraries and shared libraries\n\nThe kind of output your makefile produces depends on the extension in\n`PRODUCTS`. You can use:\n\n* `.exe` for an executable binary\n* `.lib` for a static library\n* `.dll` for a dynamic library\n\nThe build commands for each case are defined in build environment\nconfigurations, e.g. `config.gnu.mk`, by variables called `LINK.exe`,\n`LINK.lib` and `LINK.dll`. The actual extension being used are also\ndefined in the same file, as `EXT.exe`, `EXT.lib` and `EXT.dll`. For\nexample, on Linux, `EXT.lib` is set to `.a`.\n\n\n## Building the products\n\nIf you simply type `make`, a default build is launched. This is what\nyou should see if you do that in the `make-it-quick` directory itself:\n\n    make-it-quick\u003e make\n\n    ****************************************************************\n    * The BUILDENV environment variable is not set\n    * You will accelerate builds by setting it as appropriate for\n    * your system. The best guess is BUILDENV=macosx-clang\n    * Attempting to build opt with macosx-clang DIR=/make-it-quick\n    ****************************************************************\n\n    [BEGIN]              opt macosx-clang in [top]/make-it-quick\n    [GENERATE]           CONFIG_HAVE_stdio.c\n    [CONFIG]             stdio\n    [GENERATE]           CONFIG_HAVE_unistd.c\n    [CONFIG]             unistd\n    [GENERATE]           CONFIG_HAVE_nonexistent.c\n    [CONFIG]             nonexistent\n    [GENERATE]           CONFIG_HAVE_sys.sl.time.c\n    [CONFIG]             sys.sl.time\n    [GENERATE]           CONFIG_HAVE_sys.sl.improbable.c\n    [CONFIG]             sys.sl.improbable\n    [GENERATE]           CONFIG_HAVE_iostream.cpp\n    [CONFIG]             iostream\n    [COPY]               config/check_clearenv.c =\u003e objects/macosx-clang/opt/make-it-quick/CONFIG_CHECK_clearenv.c\n    [CONFIG]             clearenv\n    [GENERATE]           CONFIG_LIBm.c\n    [CONFIG]             libm\n    [GENERATE]           CONFIG_LIBoony.c\n    [CONFIG]             liboony\n    [COPY]               config/check_sbrk.c =\u003e objects/macosx-clang/opt/make-it-quick/CONFIG_CHECK_sbrk.c\n    [CONFIG]             sbrk\n    [GENERATE]           config.h\n    [COMPILE  1/1]       hello.cpp\n    [BUILD]              hello\n    [END]                opt macosx-clang in [top]/make-it-quick\n\n    real\t0m2.243s\n    user\t0m1.206s\n    sys\t0m0.750s\n\nThe output of the build will be located by default in the top-level\ndirectory for the build, or the directory specified by the `OUTPUT`\nenvironment variable if it's set.\n\nTemoprary files are placed in the `.build` directory, or the\ndirectory set by the `BUILD` environment variable if it's set.\nThere are subdirectories corresponding to the build environment and\nthe build target, so the final product could be for instance under\n`.build/macosx-clang/opt/hello`. This is explained below.\n\nThe log files will be located by default in `.logs`, the latest\none being called `make.log`, or in the directory specified by the\n`LOGS` environment variable.\n\nYou can clean the build products with `make clean` and force a clean\nbuild with `make rebuild`.\n\n### Build tips\n\nThe makefiles are self-documented. You can get information\nabout the available build targets using `make help`, and add your\nown documentation by adding dependencies to the `help` target.\n\nThere are three primary build targets, `debug`, `opt` and\n`release`, which are described in detail below. Build objects for\nthese primary targets are kept in separate locations, so that you can\nquickly alternate between debug and optimized builds.\n\nYou can customize your build using either command-line variables or\ntarget prefixes. Here are some examples:\n\n    make v-debug          # Verbose debug build using v- prefix\n    make V=1 debug        # Verbose build using variable\n    make nocolor-debug    # Do not colorize output (prefix)\n    make COLORIZE= debug  # Do not colorize output (variable)\n    make notime-debug     # Do not collect build time (prefix)\n    make TIME= debug      # Do not collect build time (variable)\n\nYou can build the target you prefer by default by setting the `TARGET`\nenvironment variable, e.g.\n\n    export TARGET=notime-nocolor-debug\n    make                  # Builds a 'notime-nocolor-debug'\n\n\n## Testing the products\n\nUse `make test` or `make check` to test the product. The `check` target ensures\nthat everything is rebuilt before testing.\n\nThe simplest possible test is to simply run the generated program. You\ncan do this by adding a `TESTS` variable to your `Makefile`:\n\n    SOURCES=hello.cpp\n    PRODUCTS=hello.exe\n    TESTS=product\n    include make-it-quick/rules.mk\n\nIf you run `make test` (or `make check`) on the sample makefile found in the\ndistribution directory, you will run the `hello` program, after\nbuilding it if necessary:\n\n     build\u003e make test\n     [BEGIN]              opt macosx-clang in [top]/build\n     [COMPILE  1/1]       hello.cpp\n     [BUILD]              hello\n     [TEST]               product\n     You successfully built using build\n     Output has 35 characters, should be 35\n\nAs you can see in the sample `Makefile`, it is easy to add tests,\nsimply by adding a rule that ends in `.test`. In the sample file,\nit is called `count-characters.test`.\n\n\n## Building for debugging, release or profiling\n\nThe default build is an optimized build similar to what you would\nachieve by running `make opt`. It is well optimized, but still retains\nsome debugging capabilities. The `DEBUG` and `OPTIMIZED` macros are\ndefined.\n\nIf you need more debugging capabilities, you can create a debug build\nby using `make debug`. This disables most optimizations, making it\neasier for the debugger to relate machine code to source code. The\n`DEBUG` macro is defined for these builds.\n\nIf you want to remove all debugging symbols, you can generate a\nrelease build by using `make release`. In that configuration, the\n`NDEBUG`, `OPTIMIZED` and `RELEASE` flags are defined.\n\nFinally, you can build for profiling using `make profile` and\nbenchmark the result using `make benchmark`. This is still only\npartially tested and supported.\n\nThis list is likely to evolve over time, most notably with support for\nValgrind and other debug / analysis tools.\n\n\n## Installing the product\n\nTo install the product, use `make install`. This often requires\nsuper-user privileges.\n\n    build\u003e make install\n    [INSTALL]            opt macosx-clang in [top]/build\n    [INSTALL]            hello in /usr/local/bin\n\nIn your `Makefile`, you can specify what to install with `WARE.xyz` variables,\nwhere `xyz` is an extension found in the `$(INSTALLABLE)` variable. By default,\nthere are installation rules for the most common kinds of files.\n\n## Build modifiers\n\nSeveral built target modifiers can be used to modify the meaning of a\nfollowing target. For example, the `v-` prefix disables output\nfiltering, so that you can see the complete build commands:\n\n     build\u003e make v-debug\n     [...]\n     [BEGIN]              debug macosx-clang in [top]/build\n     g++ -std=gnu++0x                             -DCONFIG_MACOSX -DDEBUG   -g -Wall -fno-inline           -c hello.cpp -o objects/macosx-clang/debug/build/hello.cpp.o\n     g++ -o objects/macosx-clang/debug/hello ./objects/macosx-clang/debug/build/hello.cpp.o   -framework CoreFoundation -framework CoreServices  -g\n     [END]                debug macosx-clang in [top]/build\n\n\nNote that this is not normally necessary, since the build commands are\npreserved automatically in the build log every time you use `make`.\n\nThe build targets can be used also as build modifiers. For example, if\nyou do `make clean`, you only clean `opt` objects since this is the\ndefault target. If you want to clean debug objects, use `make debug-clean`.\nSimilarly, you can do a release install with `make release-install`.\n\nNote that you can make `debug` your default target by setting the\n`TARGET` environment variable, see below.\n\n\n## Environment variables\n\nSeveral environment variables control the behavior of `make-it-quick`. The\nvariables that can be configured are found at the beginning of `config.mk`.\nNote that all directory names should end with a trailing `/`.\nSome of the most useful environment variables include:\n\n* `BUILDENV` specifies the build environment, for example\n  `macosx-clang` when building on MacOSX with Clang. Parameters for\n  this build environment are defined in `config.$(BUILDENV).mk`, for\n  example `config.macosx-clang.mk`. If not set, heuristics defined in\n  `config.auto.mk` are used to try and determine the correct\n  `BUILDENV`.\n\n* `TARGET` specifies the default build target, which can be `opt`,\n  `debug`, `release` or `profile` at the moment. If you often build\n  debug targets, you only need to `export TARGET=debug`, and\n  the default `make` will become equivalent to `make debug`.\n\n* `PREFIX` specifies the installation location. You can also specify\n  the installation location for executables (`PREFIX.bin`), libraries\n  (`PREFIX.lib`) or shared libraries (`PREFIX.dll`).\n  For compatibility with `automake`-generated makefiles, you can also\n  execute a staged install by setting `DESTDIR` when running `make`.\n\n* `TOP` is the top-level directory for the build, which defaults to\n  the directory in which `make` is started.\n\n* `OUTPUT` is the directory where all build products should go. The\n  default is the `$(TOP)`.\n\n* `BUILD` is the directory where all build intermediate files\n  should go. The default is `.build/` in `$(TOP)\n\n* `LOGS` is the directory where all logs should go. The default is\n  `.logs/` in `$(TOP)`.\n\n\n## Hierarchical projects\n\nOften, a project is made of several directories or libraries. In\n`make-it-quick`, this is supported with two makefile variables:\n\n* `SUBDIRS` lists subdirectories of the top-level directory that\n  must be built every time.\n\n* `LIBRARIES` lists libraries, which can be subdirectories or not,\n  which the products depends on. Each library should end in either\n  `.lib` or `.dll` to indicate if it's to be shared statically or\n  dynamically. Note that the `PRODUCTS` in the corresponding\n  subdirectory should match and produce the correct output.\n\n* `TOP` is the top-level directory, which is used for example when\n  you build `make top-debug`.\n\nSubdirectories are re-built everytime a top-level build is started,\nwhereas libraries are re-built only if they are missing. It is\npossible to force a re-build of libraries using the `d-` or `deep-`\nprefix for builds, for example `make deep-debug`.\n\n\n## Project configuration\n\nOften, projects have dependencies on specific features that are only\navailable on some platforms or after installing specific\ndependencies. Tools such as `autoconf` and `automake`  address this\nproblem in a separate build step.\n\nThe `make-it-quick` configuration step is designed to generate a `config.h`\nfile with a content that is close enough to the output of `autoconf`\nto allow a same project to be adapted for `make-it-quick` with minimal changes\nin the source code.\n\nIn `make-it-quick`, you specify the configuration dependencies using the\n`CONFIG` variable, which will define the various conditions you want\nto test for. The result of the tests will be stored in a `config.h`\nheader file.\n\nHere is an example from the sample `Makefile`:\n\n    CONFIG= \u003cstdio.h\u003e                  \\\n            \u003cunistd.h\u003e                 \\\n            \u003cnonexistent.h\u003e            \\\n            \u003csys/time.h\u003e               \\\n            \u003csys/improbable.h\u003e         \\\n            \u003ciostream\u003e                 \\\n            clearenv                   \\\n            libm                       \\\n            liboony                    \\\n            sbrk\n\nHere is what the generated `config.h` might look like:\n\n    #define HAVE_STDIO_H 1\n    #define HAVE_UNISTD_H 1\n    /* #undef HAVE_NONEXISTENT_H */\n    #define HAVE_SYS_TIME_H 1\n    /* #undef HAVE_SYS_IMPROBABLE_H */\n    #define HAVE_IOSTREAM 1\n    /* #undef HAVE_CLEARENV */\n    #define HAVE_LIBM 1\n    /* #undef HAVE_LIBOONY */\n    #define HAVE_SBRK 1\n    #define CONFIG_SBRK_BASE ((void *) 0x104ab3000)\n\nThe following configuration options are recognized:\n\n* C header files, such as `\u003cstdio.h\u003e`\n* C++ header files, such as `\u003ciostream\u003e`\n* Function names, such as `clearenv` or `sbrk`\n* Library names, such as `libm`\n\nFor function names, a source file in the `config/` subdirectory will\nspecify how you test for the given function, and possibly return\nadditional output that will be integrated in the `config.h` file. The\nfile name begins with `check_` followed by the function being tested,\nand can be located either in the `make-it-quick` directory, or in the\nproject directory. The `build/config` directory contains a few\nexamples of such tests for simple functions.\n\nFor example, the `config/check_sbrk.c` file contains the following:\n\n    #include \u003cunistd.h\u003e\n    #include \u003cstdio.h\u003e\n\n    int main()\n    {\n        printf(\"#define CONFIG_SBRK_BASE ((void *) %p)\\n\", sbrk(0));\n        return 0;\n    }\n\nNote that the example adds a `#define CONFIG_SBRK_BASE` in the\n`config.h`. This is only for illustration purpose, since modern\nsystems attempt to randomize address space, making the value\nreturned by `sbrk(0)` different with each run.\n\n\n## Package dependencies\n\nA `make-it-quick` project can depend on other packages and use\n`pkg-config` to easily get the required compilation or link flags. The\n`PKGCONFIGS` variable lists the name of the required packages. if the\nname ends with `?`, the package is optional, and the build with\nsuccceed even if the package is not present.\n\nFor example, `PKGCONFIGS` may look like this, in which case packages\n`pixman-1` and `gstreamer-1.0` are required, whereas package `openssl`\nis optional.\n\n    PKGCONFIGS=     pixman-1                    \\\n                    openssl?                    \\\n                    gstreamer-1.0\n\n\n# Package configuration (for `pkg-config`)\n\nTo generate a `.pc` file suitable for `pkg-config`, set variables\nin your makefile as follows:\n\n    PACKAGE_NAME=my-great-stuff\n    PACKAGE_VERSION=0.0.1\n    PACKAGE_DESCRIPTION=This is insanely great stuff\n    PACKAGE_URL=http://www.my-great-stuff.org\n    PACKAGE_REQUIRES=some-library \u003e= 0.3\n    PACKAGE_BUGS=bugreports@my-great-stuff.org\n\nA file called `my-great-stuff.pc` will be generated and installed\nalong with your product.\n\n# Shared library versioning\n\nShared libraries can be versioned. Version numbers are typically\nin the form major.minor.patch. The version number for a shared library\nis taken from `PRODUCTS_VERSION`, which defaults to `PACKAGE_VERSION`.\n\nFor example, if `foo.dll` has `PRODUCTS_VERSION` is 1.3.2, this is\ninterpreted as major version 1, minor version 3 and patchlevel 2.\nAccordingly, the library name is set to `libfoo.so.1.3.2`, the\nsoname is set to `libfoo.so.1`, and symbolc links `libfoo.so`\nand `libfoo.so.1` will both point to `libfoo.so.1.3.2`.\n\n## Other stuff\n\nThere a few utility targets, in particular:\n\n* `clang-format` reformats all sources specified in `CLANG_FORMAT_SOURCES`\n  (which defaults to `SOURCES` and `HEADERS`)\n\n\n## Redistribution\n\nThe `make-it-quick` project is released under the GNU General Public\nLicense version 3. The project author's reading of said license is\nthat it only \"contaminates\" derivative products, but not products\ncreated *using* the product. In other words:\n\n* Creating derivative software, e.g. a 'nanotoconf' project that uses\n  `make-it-quick` code, requires you to comply with the GPL, and in\n  particular to redistribute your code in source form. The fact that\n  it's really hard to distribute makefiles in binary form should help\n  you comply with this anyway :-)\n\n* Building software using `make-it-quick` does not make that software\n  GPL, any more than building it using GCC or GNU Make. I believe that\n  `make-it-quick` can legally be used for proprietary software or for\n  software using any other open-source license.\n\nAs long as I (Christophe de Dinechin) am the sole author / maintainer\nof this software, this interpretation will prevail. If you believe\nthat I am in error in my understanding of the GPL v3, please send me\ne-mail or raise an issue on GitHub or GitLab, and I will add a\nlicensing exception to that effect.\n\n\n## Comparing build vs. autoconf on a real project\n\n[![Building SPICE: autoconf vs. c3d/build](https://img.youtube.com/vi/uAAynpfCJa0/0.jpg)](https://www.youtube.com/watch?v=uAAynpfCJa0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc3d%2Fmake-it-quick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc3d%2Fmake-it-quick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc3d%2Fmake-it-quick/lists"}