A super barebones C project to kickstart basic creations
Simply download the repository and keep hold of the files. My recommended steps are the following.
- Clone the repository
- Edit/remove/add files such as README to fit your needs
- Keep the template somewhere safe so you can copy it and paste it for a new project instantly.
By default, this project template is designed to compile C programs into an executable for the current system using Makefiles.
At the top of the makefile, you will see various variables to edit. Here is some description on them.
Variable | Default Value | What it is/does |
---|---|---|
CC | gcc | The name of the compiler executable you wish to use, eg gcc or clang |
CFLAGS | -Wall -g | The flags you wish to pass into the above compiler |
EXEC | myapp | Name of final executable |
OUTPUT | bin | Name of output directory |
Use the following commands to easily interact with the build process. Also note that you can append DEBUG=on
after the command to build with debug arguments automatically (Recommended during development and testing)
Builds the entire project
make
Builds the entire project then runs the executable
make run
Cleans up the object and binary files
make clean
I am not an expert in C, in fact I am a mere beginner. You should only use this if you want to trust the pure guesswork of a beginner.