Create a gist now

Instantly share code, notes, and snippets.

@crsqq /Makefile
Last active Oct 7, 2016

Embed
What would you like to do?
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