-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 836 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
# Set the name of the output
EXEC := game
# paths
EXTRA := ./libs/libraylib.a
INCLUDE := ./include
SRC := ./src
BUILD := ./build
#Default compiler
CC := g++
#Exta libs
LIBS := -lraylib
################################### DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ###################################
#compiler options
FLAGS = -I$(INCLUDE) -lm -O3 -Wall
SRCS := $(shell find $(SRC) -name '*.cpp')
OBJS := $(SRCS:$(SRC)/%.cpp=$(SRC)/%.opp)
OBJPATH := $(addprefix $(BUILD)/,$(notdir $(OBJS)))
LDFLAGS := -lGL -lpthread -ldl -lrt -lX11
$(SRC)/%.opp: $(SRC)/%.cpp
$(CC) $(FLAGS) -c $< -o $@ && mv $@ $(BUILD)
$(EXEC):$(OBJS)
$(CC) $(OBJPATH) $(EXTRA) -o $(EXEC) $(LDFLAGS)
PHONY clean:
rm -f $(BUILD)/*.o $(BUILD)/*.opp $(EXEC)
PHONY clear:
rm -f $(BUILD)/*.o $(BUILD)/*.opp $(EXEC)
run: $(EXEC)
./$(EXEC)