{"id":15635972,"url":"https://github.com/cyrus-and/dry-makefile","last_synced_at":"2025-04-13T10:53:06.535Z","repository":{"id":66185127,"uuid":"217728601","full_name":"cyrus-and/dry-makefile","owner":"cyrus-and","description":"Opinionated Makefile for simple C/C++ projects","archived":false,"fork":false,"pushed_at":"2023-12-22T19:45:34.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-23T06:48:28.095Z","etag":null,"topics":["build-tool","c","cplusplus","makefile"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyrus-and.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-26T15:25:44.000Z","updated_at":"2023-12-09T06:31:25.000Z","dependencies_parsed_at":"2024-10-03T11:01:35.935Z","dependency_job_id":null,"html_url":"https://github.com/cyrus-and/dry-makefile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fdry-makefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fdry-makefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fdry-makefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrus-and%2Fdry-makefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrus-and","download_url":"https://codeload.github.com/cyrus-and/dry-makefile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229034202,"owners_count":18009504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["build-tool","c","cplusplus","makefile"],"created_at":"2024-10-03T11:01:29.158Z","updated_at":"2024-12-10T09:06:11.577Z","avatar_url":"https://github.com/cyrus-and.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DRY Makefile\n\nOpinionated Makefile for simple C/C++ projects.\n\n## Complete annotated example\n\nFetch the DRY Makefile:\n\n```\nwget -q https://raw.githubusercontent.com/cyrus-and/dry-makefile/master/Makefile\n```\n\nCreate the following `config.Makefile` (change it according to your needs):\n\n```makefile\n# all the source files\nSOURCES := $(wildcard src/*.c)\n\n# executable source files\nEXECUTABLES := src/main.c\n\n# compiler and linker flags\nCOMPILER_FLAGS := -Wall -pedantic\nLINKER_FLAGS   := -pthread\n\n# additional shared libraries\nLIBRARIES := -lm\n\n# directory where `make install` copies the targets\nINSTALL_PATH := /opt/bin\n\n# declare the build profiles starting from the default rule, when omitted only\n# the `default` profile is present which uses the variables defined so far\nBUILD_PROFILES := release debug\n\n# configure the variables for each declared profile\nrelease: COMPILER_FLAGS += -O3 -Os\ndebug:   COMPILER_FLAGS += -ggdb3 -Werror -DDEBUG\n\n# list of rules to be set as prerequisites of each object\nSETUP_HOOK := some-external-file\nsome-external-file:\n    wget -q https://example.com/$@\n\n# list of rules to be set as prerequisites of the `clean` rule\nCLEANUP_HOOK := -some-private-rule\n-some-private-rule:\n    $(RM) external-file\n\n# place additional custom rules here...\n```\n\nAlternatively, the above can be placed in a Makefile file on its own and the DRY Makefile can be included with (place this below the configuration):\n\n```makefile\ninclude /path/to/dry-makefile/Makefile\n```\n\nThen use it like this:\n\n- `make` builds the default profile;\n- `make \u003cname\u003e` builds the `\u003cname\u003e` profile;\n- `make compile_commands.json` generates the [JSON Compilation Database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) file;\n- `make clean` removes all the building files but not the targets;\n- `make cleanall` removes all the building files including the targets;\n- `make install` copies the targets to the install location;\n- `make uninstall`  removes the targets from the install location.\n\nDRY Makefile uses `.d` dependency files, those files can be safely ignored by the version-control system.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrus-and%2Fdry-makefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrus-and%2Fdry-makefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrus-and%2Fdry-makefile/lists"}