Skip to content

Instantly share code, notes, and snippets.

@stephenLee
Created October 23, 2012 16:27
Show Gist options
  • Save stephenLee/3939889 to your computer and use it in GitHub Desktop.
Save stephenLee/3939889 to your computer and use it in GitHub Desktop.
Tiny Makefile template for c/c++
# define variable, use using $()
# -g add debug information to the executable file
# -Wall turns on most, but not all, compiler warnings
CC = g++
CFLAGS = -g -Wall
file: file.o
$(CC) $(CFLAGS) -o file file.o
file.o: file.cpp
$(CC) $(CFLAGS) -c file.cpp
clean:
rm -f file *.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment