Created
May 20, 2014 20:22
-
-
Save loriopatrick/8dbc9173cbdf0cf8d907 to your computer and use it in GitHub Desktop.
A simple makefile.
This file contains hidden or 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
CC=clang | |
FLAGS=-Wall -g | |
INCLUDE=-I./include | |
EXEC=out/program | |
SRC=$(wildcard src/*.c) | |
OBJ=$(SRC:src/%.c=obj/%.o) | |
run: setup link | |
./$(EXEC) | |
link: $(OBJ) | |
$(CC) $(FLAGS) -o $(EXEC) $? | |
obj/%.o: src/%.c | |
$(CC) $(FLAGS) $(INCLUDE) -c $? -o $@ | |
setup: | |
mkdir -p obj | |
mkdir -p out | |
clean: setup | |
rm -r out | |
rm -r obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment