-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 654 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (23 loc) · 654 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
# cc and flags
CC = g++
CXXFLAGS = -std=c++11 -g -Wall
LDFLAGS = -lgmp -lgmpxx
#CXXFLAGS = -std=c++11 -O3 -Wall
# folders
INCLUDE_FOLDER = ./include/
BIN_FOLDER = ./bin/
OBJ_FOLDER = ./obj/
SRC_FOLDER = ./src/
# all sources, objs, and header files
MAIN = Main
TARGET = a.out
SRC = $(wildcard $(SRC_FOLDER)*.cpp)
OBJ = $(patsubst $(SRC_FOLDER)%.cpp, $(OBJ_FOLDER)%.o, $(SRC))
$(shell mkdir -p $(OBJ_FOLDER))
$(shell mkdir -p $(BIN_FOLDER))
$(OBJ_FOLDER)%.o: $(SRC_FOLDER)%.cpp
$(CC) $(CXXFLAGS) -c $< -o $@ -I$(INCLUDE_FOLDER)
all: $(OBJ)
$(CC) $(CXXFLAGS) -o $(BIN_FOLDER)$(TARGET) $(OBJ) ${LDFLAGS}
clean:
@rm -rf $(OBJ_FOLDER)* $(BIN_FOLDER)*