-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 943 Bytes
/
Makefile
File metadata and controls
32 lines (26 loc) · 943 Bytes
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
# Mental reminder... '<target> : <prereqs>' Prerequirements can be listed as '<prereq> : <prereqs>'.
# Builds the chess.exe program. It probably doesn't use .exe encoding but it is executable is it not?
chess : main.o game.o input.o pieces.h
gcc main.o game.o input.o pieces.h -o chess
# Builds main.o, with main.c as a prereq. -c means compile do not link.
main.o : main.c pieces.h
gcc -c main.c
game.o : game.c pieces.h
gcc -c game.c
input.o : game.c
gcc -c input.c
# Cleans the current directory of any partial or full builds of the executable.
clean:
@rm -f *.o
@rm -f chess
@rm -f pieces.h.gch
@rm -f debug
# Builds a debugging version of the executable and runs it using gdb.
debug:
gcc -g -c game.c
gcc -g -c main.c
gcc -g -c input.c
gcc main.o game.o input.o pieces.h -g -o debug
@gdb ./debug
# Clean builds the program by removing artifacts from the previous build and starting a new one.
cleanbuild : clean chess