{"id":48591861,"url":"https://github.com/nsmryan/make2ninja","last_synced_at":"2026-04-08T20:02:21.095Z","repository":{"id":39649172,"uuid":"351267222","full_name":"nsmryan/make2ninja","owner":"nsmryan","description":"Makefile to Ninja build converter","archived":false,"fork":false,"pushed_at":"2023-09-25T00:49:02.000Z","size":14,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-09-25T05:03:43.060Z","etag":null,"topics":["build","converter","generator","make","makefile","ninja","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/nsmryan.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}},"created_at":"2021-03-25T00:57:39.000Z","updated_at":"2023-09-23T14:26:13.000Z","dependencies_parsed_at":"2022-08-28T08:01:42.983Z","dependency_job_id":null,"html_url":"https://github.com/nsmryan/make2ninja","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/nsmryan/make2ninja","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsmryan%2Fmake2ninja","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsmryan%2Fmake2ninja/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsmryan%2Fmake2ninja/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsmryan%2Fmake2ninja/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsmryan","download_url":"https://codeload.github.com/nsmryan/make2ninja/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsmryan%2Fmake2ninja/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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":["build","converter","generator","make","makefile","ninja","python"],"created_at":"2026-04-08T20:02:19.807Z","updated_at":"2026-04-08T20:02:21.067Z","avatar_url":"https://github.com/nsmryan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# make2ninja\nThis repository contains a tool for converting [Makefile](https://www.gnu.org/software/make/manual/make.html)\nbuilds into [Ninja](https://ninja-build.org/) builds, with the\nintent of speeding up a build.\n\nI've found that it decreased the build time of the software I was\nworking on by 10% for a full rebuild, and 30% for a single file\nchange. That software has a pretty flat build tree, and a single\nMakefile, so I expect greater speedups are possible for some\nsystems. On the other hand, make2ninja does not express\nthe entire dependency graph, which might result in builds\nthat are slower then necessary?\n\n\nAlready this is a pretty nice improvement- its a tiny little\nscript that didn't take much time to create, and I get a bit\nfaster builds! No complaints here.\n\n\nThe inspiration for this tool was https://github.com/lindenb/makefile2graph,\nwhich parses the result of:\n```bash\nmake -Bnd\n```\nto create a graph of a make build's dependencies. It was simple\nto parse the output, and then generate a Ninja file instead.\n\n\nThe current implementation is very raw- it is the code I got\nworking while thinking through this idea.\n\n## Usage\nSimply try\n```bash\nmake -Bnd | python make2ninja.py \u003e build.ninja\n```\nto generate a build.ninja file.\n\nMultiple ninja files could be created for different make builds-\nninja is more explicit, so certain make builds may result in different\nninja files (like release vs debug).\n\n\n## Special Cases\nI'm sure there are many special cases in Makefiles that I could have\nmissed. The one that make2ninja does handle is where files are given\nwithout paths, and are resolved by VPATH (which I make use of\na great deal in Makefiles).\n\n## Possible Improvements\nThis tool could detect .d files in the rules, and add the 'dep'\nand 'depfile' variables to its output.\n\n\nCurrently make2ninja does not express the entire dependency\ngraph in the ninja file- it takes a topological sort given\nby make and expresses that. I don't think it would be\nhard to change this, and it might result in faster builds for\nmore complex projects. I have not looked into this at all.\n\n\nIt could also just be written in a clearer and more organized fashion-\nits just a proof of concept right now.\n\n\nIn prinicpal something could be done to detect changes in the build to\nregenerate the file, or incorporate this tool into the make file to\nregenerate the ninja file somehow. I haven't thought this one through\nentirely.\n\n\nPlease feel free to fork, PR, or make an issue if this is an interesting\nor useful tool!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsmryan%2Fmake2ninja","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsmryan%2Fmake2ninja","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsmryan%2Fmake2ninja/lists"}