-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (21 loc) · 744 Bytes
/
Makefile
File metadata and controls
28 lines (21 loc) · 744 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
CC = g++
SRC_DIR = src
BUILD_DIR = build
INCLUDE = -I include -I/usr/local/opt/openssl/include
OUTPUT = server.exe
CC_FLAGS = -g -Wall -Wextra -std=c++11
LIBS = -L/usr/local/opt/openssl/lib -lcpprest -lssl -lcrypto -lboost_system -lboost_thread-mt -lboost_chrono-mt
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
OBJECTS = $(patsubst $(SRC_DIR)/%,$(BUILD_DIR)/%,$(SOURCES:.cpp=.o)) $(BUILD_DIR)/Main.o
${OUTPUT}: ${OBJECTS}
${CC} ${LIBS} ${OBJECTS} -o ${OUTPUT}
run: ${OUTPUT}
./${OUTPUT}
$(BUILD_DIR)/Main.o: Main.cpp
mkdir -p $(BUILD_DIR)
$(CC) -c $(CC_FLAGS) $(INCLUDE) $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
mkdir -p $(BUILD_DIR)
$(CC) -c $(CC_FLAGS) $(INCLUDE) $< -o $@
clean:
rm -f ${OUTPUT} ${OBJECTS}