Quick setup template for small C projects. Better suited for VS Code users.
- Make.
- A bash shell.
- Recommendation for Windows: Git Bash.
- Change the PROGRAM macro to the name of your program.
- Change the FILE_EXT macro to the file extension you want for the outfile (can be left blank).
- Add the corresponding libraries to the macro LIBS if needed.
- You can change the compiler in the CC macro.
- You can add compiler flags in the CFLAG macro.
In the same directory than the makefile file, use the command make in the console to compile the program, make run to re-compile and run and make clean to get rid of the *.o files and the executable. In case you want to make your own makefile, refer to the documentation.
- Add VSC tasks:
- Launch.
- Build.
- Debug.