An open API service indexing awesome lists of open source software.

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.

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.