Created
December 12, 2016 06:44
-
-
Save felipecustodio/b5b6c8d8c5c310104721c47bcdd4c4aa to your computer and use it in GitHub Desktop.
Makefile template for C college assignments
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
# using gcc compiler | |
CC = gcc | |
# output path and filename | |
BINARY = ./build/output | |
# sources directory | |
SRC = src/main.c | |
# includes directory | |
INCLUDES = ./includes | |
# libraries and flags | |
LIBS = -lm | |
FLAGS = -Wall -O0 -g -Wextra | |
all: compile run | |
compile: | |
$(CC) -o $(BINARY) -I$(INCLUDES) $(SRC) $(LIBS) | |
test: | |
run clean debug | |
run: | |
clear && $(BINARY) | |
debug: | |
valgrind --leak-check=full --show-reachable=yes --track-origins=yes $(BINARY) | |
clean: | |
rm *.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment