forked from BytesClub/Tic_Tac_Toe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (36 loc) · 774 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Makefile
#
# GitHub Repository: https://github.com/BytesClub/Tic_Tac_Toe
# Copyright (C) BytesClub 2017, MIT
#
# Define Compiler
CC = gcc
# Flags for Compiler
CFLAGS = -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow
# Flags for Linker
LFLAGS = -pg
# Flags for Directories
DIR = -I$(INC)
# Executable
EXE = play
# Directories
SRC = src
INC = inc
BIN = bin
# Source and Object File(s)
SOURCE = $(wildcard $(SRC)/*.c)
OBJECT = $(patsubst %,$(BIN)/%, $(notdir $(SOURCE:.c=.o)))
# Default Target
$(BIN)/$(EXE): $(OBJECT)
$(CC) $^ -o $@
$(BIN)/%.o: $(SRC)/%.c
@mkdir -p $(BIN)
$(CC) $(CFLAGS) $(DIR) -c $< -o $@
# Help Option
help:
@echo "src: $(SOURCE)"
@echo "obj: $(OBJECT)"
# House-keeping
clean:
rm -rf core $(EXE) bin/* *.o *.exe