Skip to content

Instantly share code, notes, and snippets.

@crsqq
Last active October 7, 2016 03:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crsqq/5fca0cb97d2b3248d05d to your computer and use it in GitHub Desktop.
Save crsqq/5fca0cb97d2b3248d05d to your computer and use it in GitHub Desktop.
super simple makefile template
## Licensed under the MIT Licence
## (C) 2014 Christoph Martin
## For licence text go to http://opensource.org/licenses/MIT
## Makefile
# change to your prefered compiler
CC=gcc
# replace with name of the executable
OUTPUTNAME=foo
# add all source files here but with '.o' instead of '.c'
OBJS=foo.o
default: all
all: $(OBJS)
$(CC) -o $(OUTPUTNAME) $(OBJS)
debug: $(OBJS)
$(CC) -g -o $(OUTPUTNAME) $(OBJS)
opt: $(OBJS)
$(CC) -O3 -o $(OUTPUTNAME) $(OBJS)
.PHONY: clean
clean:
rm *.o
rm $(OUTPUTNAME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment