-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (52 loc) · 1.78 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
CMAKE := $(shell command -v cmake 2> /dev/null)
GCC := $(shell command -v gcc 2> /dev/null)
BUILD_ESSENTIAL := $(shell dpkg -s build-essential 2> /dev/null | grep Status)
CRYPTOPP_DEV := $(shell dpkg -s libcrypto++-dev 2> /dev/null | grep Status)
ifeq ($(CMAKE),)
$(info CMake not found. Installing CMake using apt...)
$(shell sudo apt update)
$(shell sudo apt install -y cmake)
endif
ifeq ($(GCC),)
$(info GCC not found. Installing GCC using apt...)
$(shell sudo apt update)
$(shell sudo apt install -y gcc)
endif
ifeq ($(BUILD_ESSENTIAL),)
$(info Build-essential package not found. Installing build-essential using apt...)
$(shell sudo apt update)
$(shell sudo apt install -y build-essential)
endif
endif
ifeq ($(UNAME), Darwin)
CMAKE := $(shell command -v cmake 2> /dev/null)
GCC := $(shell command -v gcc 2> /dev/null)
BREW := $(shell command -v brew 2> /dev/null)
CRYPTOPP := $(shell brew list | grep cryptopp)
ifeq ($(CMAKE),)
$(info CMake not found. Installing CMake using brew...)
$(shell brew install cmake)
endif
ifeq ($(GCC),)
$(info GCC not found. Installing GCC using brew...)
$(shell brew install gcc)
endif
ifeq ($(BREW),)
$(info Brew not found. Installing Brew...)
$(shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)")
endif
endif
all:
@cmake -S. -B build
@cmake --build build
@mkdir -p client1 client2
@cp -r client/server.info client1/
@cp -r client/server.info client2/
@cp -r build/client client1/
@cp -r build/client client2/
clean:
@rm -rf client/cmake-build-debug
@rm -rf build client1 client2
@rm -rf ../server/__pycache__ ../server/server.db