initial commit

This commit is contained in:
Noah Swerhun 2023-09-17 21:50:16 -05:00
parent 774c6c1c56
commit a1bcfa5a94
4 changed files with 41 additions and 1 deletions

5
.gitignore vendored
View file

@ -14,3 +14,8 @@ Cargo.lock
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
# Added by cargo
/target

8
Cargo.toml Normal file
View file

@ -0,0 +1,8 @@
[package]
name = "mgen"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View file

@ -1,3 +1,15 @@
# mgen
Makefile generator for C projects
Makefile generator for C projects.
`mgen` automatically generates build rules for all source files (extension `.c`)
it finds in a recursive search of the directory in which it is run. It reads the
varibles from your existing Makefile and uses them when generating the new
targets.
The following varibles are supported:
- CC -> C compiler
- CFLAGS -> compilation flags
- LDLIBS -> linker libraries
- LDFLAGS -> linker flags
- TARGET -> name of final executable/library

15
src/main.rs Normal file
View file

@ -0,0 +1,15 @@
use std::fs;
fn main() {
let files = fs::read_dir("./").unwrap();
for file in files {
let file = file.unwrap();
let is_dir = file.metadata().unwrap().is_dir();
if is_dir {
println!("{}", file.path().to_str().unwrap());
}
}
}