{"id":21320386,"url":"https://github.com/turkeymcmac/build-objects","last_synced_at":"2026-05-10T05:05:22.686Z","repository":{"id":114505884,"uuid":"322034767","full_name":"TurkeyMcMac/build-objects","owner":"TurkeyMcMac","description":"A script to make C/C++ compilation with Make be easier.","archived":false,"fork":false,"pushed_at":"2021-03-25T17:22:14.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T22:32:02.504Z","etag":null,"topics":["build-tool","c","cpp","makefile"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TurkeyMcMac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-12-16T16:09:59.000Z","updated_at":"2021-11-24T16:41:37.000Z","dependencies_parsed_at":"2023-05-17T11:45:23.341Z","dependency_job_id":null,"html_url":"https://github.com/TurkeyMcMac/build-objects","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TurkeyMcMac/build-objects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurkeyMcMac%2Fbuild-objects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurkeyMcMac%2Fbuild-objects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurkeyMcMac%2Fbuild-objects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurkeyMcMac%2Fbuild-objects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TurkeyMcMac","download_url":"https://codeload.github.com/TurkeyMcMac/build-objects/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TurkeyMcMac%2Fbuild-objects/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265121267,"owners_count":23714500,"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","cpp","makefile"],"created_at":"2024-11-21T19:47:31.748Z","updated_at":"2026-05-10T05:05:22.627Z","avatar_url":"https://github.com/TurkeyMcMac.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ./build-objects\n\nThis is a script for simplifying C/C++ compilation. It's meant to be copied into\na project and used from there. It's written in Perl and should work on most\nUnix-based operating systems (not Windows.) It should work with most Make\nimplementations, and supported compilers include GCC, Clang, and TinyCC.\n(Compilers must support the `-MD` and `-MF` options. This may exclude some old\nversions, I don't know.)\n\n## Example\n\nSay you wanted to make the optimized build of a project whose source files were\nin the `source` directory. You could put this in your Makefile:\n\n```\noptimized-executable: source/*\n\t@./build-objects -s source -b build/O3 -j auto $(CC) -O3 $(CPPFLAGS) $(CFLAGS)\n\t$(CC) -o $@ $(LDFLAGS) build/O3/*.o $(LDLIBS)\n```\n\n(The `@` before the script invocation is optional.)\n\n`optimized-executable` will be rebuilt whenever a file in `source` changes. The\nunlinked objects and other intermediate files will be placed in `build/O3`,\nwhich will be created if it does not exist. `-j auto` will tell the script to\nuse all available processors for compilation. If there were a file `f.c` to\ncompile, it would be compiled like so:\n\n    $(CC) -O3 $(CPPFLAGS) $(CFLAGS) -MD -MF build/O3/f.c.d -c -o build/O3/f.c.o source/f.c\n\nThe build directory can be safely removed when cleaning up.\n\nFor more information, run `./build-objects --help` or read the source code.\n\n## Advantages\n\n* While compilation and dependency handling can be done purely in a Makefile,\n  using this script is probably more portable and requires less boilerplate.\n* Supporting multiple optimization levels/configurations is easy with this\n  script; just use separate build directories. Using pure Make to do this would\n  again be more complex, as far as I know.\n\n## Disadvantages\n\n* The script only supports a simple project structure: all the compilation units\n  must be in a single source directory. This setup is common enough for the\n  script to be useful, but larger, more complex projects may not be supported.\n* Using the format of the example above, removing a file will not trigger a\n  rebuild. This is bad, though I doubt it will be a problem very often at all.\n  (When a rebuild does occur, orphaned object files are deleted to prevent old\n  code from being linked into the final executable.)\n* While I think the code is portable, I haven't tested except on the few\n  computers I own.\n\n## History\n\nThis is based on my other project [jdibs](https://github.com/TurkeyMcMac/jdibs),\nexcept that it doesn't do its own slow dependency detection and is generally\nsimpler and easier to use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturkeymcmac%2Fbuild-objects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturkeymcmac%2Fbuild-objects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturkeymcmac%2Fbuild-objects/lists"}