-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (42 loc) · 1.07 KB
/
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
48
49
50
51
52
53
54
# The compiler to use
CC=g++
# Compiler flags
CFLAGS=-c -Wall -std=c++17
# -c: Compile or assemble the source files, but do not link.
# The linking stage simply is not done.
# The ultimate output is in the form of an object file for each source file.
#
# -Wall: This enables all the warnings about constructions that
# some users consider questionable, and that are easy to avoid
# (or modify to prevent the warning), even in conjunction with macros.
# Linker flags
# LDFLAGS=
# Libraries
# LIBS=
# Name of executable output
TARGET=tetris
SRCDIR=src
LIBDIR=$(SRCDIR)/lib
BUILDDIR=bin
OBJS := $(SRCDIR)/main.o \
$(LIBDIR)/User.o \
$(LIBDIR)/Game.o \
$(LIBDIR)/Timer.o \
$(LIBDIR)/Console.o \
$(LIBDIR)/Graphics.o \
$(LIBDIR)/UserInput.o \
$(LIBDIR)/TetrisBlock.o
all: makebuildir $(TARGET)
run: all
./$(BUILDDIR)/$(TARGET)
$(TARGET) : $(OBJS)
$(CC) $(LDFLAGS) -o $(BUILDDIR)/$@ $(OBJS) $(LIBS)
%.o : %.cpp
$(CC) $(CFLAGS) $< -o $@
clean :
rm -rf $(BUILDDIR)
rm -f $(OBJS)
makebuildir:
mkdir -p $(BUILDDIR)
docs :
doxygen