https://github.com/martian56/cstarter
Cstarter makes starting C/C++ projects easy.
https://github.com/martian56/cstarter
c c-project-template project-template
Last synced: 3 months ago
JSON representation
Cstarter makes starting C/C++ projects easy.
- Host: GitHub
- URL: https://github.com/martian56/cstarter
- Owner: martian56
- Created: 2025-04-10T10:37:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-10T10:48:10.000Z (about 1 year ago)
- Last Synced: 2025-12-28T12:40:54.109Z (6 months ago)
- Topics: c, c-project-template, project-template
- Language: C
- Homepage:
- Size: 3.91 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cstarter
`cstarter` is a simple command-line tool to quickly create a C project with a predefined folder structure, Makefile, source files, and more. It's designed to streamline the setup process for new C projects, saving time and reducing repetitive tasks.
## Features
- **Predefined Project Structure**: Automatically creates the following directories:
- `include/` for header files
- `src/` for source files
- `lib/` for external libraries
- `build/` for compiled files
- `bin/` for executables
- `tests/` for test files
- **Makefile**: Provides an easy way to build and clean the project.
- **Option to Include CMakeLists.txt**: If preferred, you can opt to generate a CMake build configuration.
- **README.md Generation**: A customizable `README.md` with either basic or detailed instructions.
- **Test Setup**: Optionally includes a basic test file to get started with unit testing.
- **Customizable Project Name**: Set the project folder name during creation.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/cstarter.git
cd cstarter
```
2. Compile the source code:
```bash
make
```
3. (Optional) Install globally:
```bash
sudo make install
```
## Usage
To use `cstarter`, run it with your desired options and the target project folder name. If no folder name is provided, it defaults to the current directory (`.`).
### Available Options
- `-c`, `--cmake`: Include a `CMakeLists.txt` for CMake users.
- `-t`, `--tests`: Include a `tests/` folder with a basic test file.
- `-r`, `--readme`: Generate a detailed `README.md` file (with build instructions).
- `-h`, `--help`: Show the help message with all available options.
### Examples
1. **Create a basic C project** in the `myproject` directory:
```bash
./cstarter myproject
```
2. **Create a project with CMake support**:
```bash
./cstarter -c myproject
```
3. **Create a project with tests and a detailed README**:
```bash
./cstarter -t -r myproject
```
4. **Create a project in the current directory**:
```bash
./cstarter .
```
## License
This project is open-source under the MIT license. You are free to modify and distribute it as per your needs.
## Contribution
Feel free to fork this repository, submit issues, and send pull requests. Contributions are welcome!
## Acknowledgments
- Thanks to [GNU Make](https://www.gnu.org/software/make/) for building the project.
- Thanks to [CMake](https://cmake.org/) for providing an alternative build system.