project-root
|-- src
|-- include # storage for header files
| |-- *.h
|-- <any-sub-dir>
| |-- *.c
|-- main.c
Store the Makefile in the project root dir to use it.
makemake buildmake runThe Makefile declares dependencies between all "c" and "o" files. Once any "c" file changes, make will compile all the "o" files first and then the target executable. The target executable is stored under the dist directory.
All the temporary files will be created in the project root directory and deleted later by the clean goal.
You can customize source dir, dist dir, target name, and compiler flags by editing corresponding variables (SRC_DIR, DIST_DIR, TARGET, CFLAGS).
Have fun in development!