-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (32 loc) · 1.24 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
OBJ := obj/
BIN := bin/
sources := common/AdapterInputStream common/AdapterOutputStream \
common/EOFException common/FileInputStream common/FileOutputStream \
common/HashOutputStream common/InputStream common/IOException \
common/OutputStream \
common/Reference
sources += ui/main
sources += client/EntryFactory client/DirectoryV1 client/RegularV1 \
client/SymlinkV1
sources += server/DirectoryV1 server/ObjectFactory server/RegularV1 \
server/Repository server/SymlinkV1 server/TransientOutputStream
objects := $(patsubst %, $(OBJ)%.o, $(sources))
check: $(BIN)synctl
./$< client | ./$< server
all: $(BIN)synctl
$(BIN)synctl: $(objects) | $(BIN)
g++ $^ -o $@ -lssl -lcrypto
$(OBJ)common/%.o: src/common/%.cxx | $(OBJ)common
g++ -Wall -Wextra -g -c $< -o $@ -Iinclude/
$(OBJ)ui/%.o: src/ui/%.cxx | $(OBJ)ui
g++ -Wall -Wextra -g -c $< -o $@ -Iinclude/
$(OBJ)client/%.o: src/client/%.cxx | $(OBJ)client
g++ -Wall -Wextra -g -std=c++17 -c $< -o $@ -Iinclude/
$(OBJ)server/%.o: src/server/%.cxx | $(OBJ)server
g++ -Wall -Wextra -g -std=c++17 -c $< -o $@ -Iinclude/
$(OBJ)common $(OBJ)client $(OBJ)server $(OBJ)ui: | $(OBJ)
mkdir $@
$(OBJ) $(BIN):
mkdir $@
clean:
-rm -rf $(OBJ) $(BIN)