-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
37 lines (28 loc) · 691 Bytes
/
makefile
File metadata and controls
37 lines (28 loc) · 691 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
33
34
35
36
37
CC = g++
FLAG = -Wall -DUNICODE -std=c++11 -I./include
LIB = -lws2_32 -lwsock32
SRC_DIR = ./src
BUILD_DIR = ./build
OBJ_DIR = $(BUILD_DIR)/obj
TARGET_1 = $(BUILD_DIR)/src/Server.exe
TARGET_2 = $(BUILD_DIR)/src/Client.exe
OBJ_1 = $(OBJ_DIR)/Server.obj
OBJ_2 = $(OBJ_DIR)/Client.obj
.PHONY: TARGET
TARGET: $(TARGET_1) $(TARGET_2)
$(TARGET_1): $(OBJ_1)
-@md "$(@D)"
$(CC) $(FLAG) $^ $(LIB) -o $@
$(TARGET_2): $(OBJ_2)
-@md "$(@D)"
$(CC) $(FLAG) $^ $(LIB) -o $@
$(OBJ_1): $(SRC_DIR)/Server.cpp
-@md "$(@D)"
$(CC) $(FLAG) -c $^ $(LIB) -o $@
$(OBJ_2): $(SRC_DIR)/Client.cpp
-@md "$(@D)"
$(CC) $(FLAG) -c $^ $(LIB) -o $@
.PHONY: MKDIR
MKDIR:
-@md "$(BUILD_DIR)"
-@md "$(OBJ_DIR)"