https://github.com/vpoulailleau/basicmakefile
A basic makefile for C project
https://github.com/vpoulailleau/basicmakefile
c gcc gcc-compiler make makefile makefile-snippets makefile-template
Last synced: 2 months ago
JSON representation
A basic makefile for C project
- Host: GitHub
- URL: https://github.com/vpoulailleau/basicmakefile
- Owner: vpoulailleau
- License: bsd-3-clause
- Created: 2019-01-16T18:23:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-17T06:04:28.000Z (over 5 years ago)
- Last Synced: 2025-03-22T20:30:27.789Z (7 months ago)
- Topics: c, gcc, gcc-compiler, make, makefile, makefile-snippets, makefile-template
- Language: Makefile
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# basicmakefile
A very basic Makefile for C project:
* debug and release mode
* dependency detection
* strict ANSI-C## Usage
* copy the Makefile in the source directory
* if using Visual Studio Code, you can also copy `.vscode` folder
* add a task to build the program
* add a task to clean the directory
* add a debug launch
* make sure that gcc and gdb is in your PATH environment variable
* have a look at https://code.visualstudio.com/docs/languages/cpp
* configure the Makefile if needed
* build the program## Configure the Makefile
`DEBUG` can be set to `yes` to enable debug symbol generation, allowing the usage of a debugger.
`EXEC` contains the name of the executable file (`program.exe` by default).
`SRC` contains the list of source files (`*.c` by default).
`CFLAGS` and `LDFLAGS` respectively contains c compilation flags and link flags.
## Build the program
```shell
cd directory_containing_makefile
make
```## Clean the directory
```shell
cd directory_containing_makefile
make clean
```