Last active
October 7, 2016 03:10
-
-
Save crsqq/5fca0cb97d2b3248d05d to your computer and use it in GitHub Desktop.
super simple makefile template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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