initial commit
This commit is contained in:
parent
774c6c1c56
commit
a1bcfa5a94
4 changed files with 41 additions and 1 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -14,3 +14,8 @@ Cargo.lock
|
||||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||||
*.pdb
|
*.pdb
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Added by cargo
|
||||||
|
|
||||||
|
/target
|
||||||
|
|
8
Cargo.toml
Normal file
8
Cargo.toml
Normal 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]
|
14
README.md
14
README.md
|
@ -1,3 +1,15 @@
|
||||||
# mgen
|
# 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
15
src/main.rs
Normal 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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue