A generic makefile to be used in your C projects. It is reasonably small, but has some sweet features:
- Automatically detects changes in dependencies (eg header files)
- Detects system compiler / linker (via environment variable
CC
andLD
) - Ability to amend
CFLAGS
,CPPFLAGS
,LDFLAGS
, orLDLIBS
via cli install
andclean
targets, the former also respectsPREFIX
- Genereting gdb debug files
- Sane compiler defaults
Change the EXE
variable to your desired name and you're good to go.
You can also do the optional changes below if you desire:
- Change default
CFLAGS
, andLDFLAGS
- Change default compiler / linker (via
CC
andLD
variables)
Dual-Licensed under Public Domain & MIT
Copyright (c) 2017, Arvid Gerstmann All rights reserved.