9 releases

new 0.2.0 Mar 20, 2025
0.1.7 Dec 21, 2024
0.1.6 Nov 17, 2024
0.1.5 Oct 10, 2024
0.1.2 Nov 27, 2023

#91 in Build Utils

Download history 540/week @ 2024-11-28 585/week @ 2024-12-05 550/week @ 2024-12-12 758/week @ 2024-12-19 402/week @ 2024-12-26 602/week @ 2025-01-02 391/week @ 2025-01-09 385/week @ 2025-01-16 264/week @ 2025-01-23 527/week @ 2025-01-30 2493/week @ 2025-02-06 3480/week @ 2025-02-13 1130/week @ 2025-02-20 3819/week @ 2025-02-27 3312/week @ 2025-03-06 4032/week @ 2025-03-13

12,500 downloads per month
Used in 7 crates (4 directly)

Apache-2.0

70KB
1.5K SLoC

Lossless parser for Makefiles

This crate provides a lossless parser for makefiles, creating a modifiable CST.

Example:


let mf = Makefile::read("Makefile").unwrap();

println!("Rules in the makefile: {:?}", mf.rules().map(|r| r.targets().join(" ")).collect::<Vec<_>>());

lib.rs:

A lossless parser for Makefiles

Example:

use std::io::Read;
let contents = r#"PYTHON = python3

.PHONY: all

all: build

build:
	$(PYTHON) setup.py build
"#;
let makefile: makefile_lossless::Makefile = contents.parse().unwrap();

assert_eq!(makefile.rules().count(), 3);

Dependencies

~1MB
~16K SLoC