-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
30 lines (21 loc) · 829 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
SRC=./src
OBJ=./obj
all: $(OBJ) winsys
# Creating folder
$(OBJ):
mkdir -p $(OBJ)
# Dynamik linking
winsys: $(OBJ)/main.o $(OBJ)/screen.o $(OBJ)/winsys.o $(OBJ)/snake.o
g++ -g -Wall -pedantic -std=c++11 $^ -o $@ -lncurses
# With debugging symbols
$(OBJ)/main.o: $(SRC)/main.cpp $(SRC)/winsys.h $(SRC)/screen.h $(SRC)/cpoint.h $(SRC)/snake.h
g++ -g -c -Wall -pedantic -std=c++11 $< -o $@
$(OBJ)/screen.o: $(SRC)/screen.cpp $(SRC)/screen.h $(SRC)/cpoint.h
g++ -g -c -Wall -pedantic -std=c++11 $< -o $@
$(OBJ)/winsys.o: $(SRC)/winsys.cpp $(SRC)/winsys.h $(SRC)/screen.h $(SRC)/cpoint.h
g++ -g -c -Wall -pedantic -std=c++11 $< -o $@
$(OBJ)/snake.o: $(SRC)/snake.cpp $(SRC)/winsys.h $(SRC)/screen.h $(SRC)/cpoint.h $(SRC)/snake.h
g++ -g -c -Wall -pedantic -std=c++11 $< -o $@
.PHONY: clean
clean:
-rm winsys $(OBJ)/*.o