forked from cjhannah/collab-vm-server-1
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
130 lines (86 loc) · 1.99 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Master makefile of CollabVM Server
ifeq ($(OS), Windows_NT)
# Allow selection of w64 or w32 target
# Is it Cygwin?
ifeq ($(shell uname -s|cut -d _ -f 1), CYGWIN)
$(info Compiling targeting Cygwin)
MKCONFIG=mk/cygwin.mkc
BINDIR=bin/
ARCH=$(shell uname -m)
CYGWIN=1
else
CYGWIN=0
ifneq ($(WARCH), win32)
$(info Compiling targeting Win64)
MKCONFIG=mk/win64.mkc
ARCH=amd64
BINDIR=bin/win64/
else
$(info Compiling targeting x86 Windows)
MKCONFIG=mk/win32.mkc
BINDIR=bin/win32/
ARCH=x86
endif
endif
else
# Is it Termux?
$(shell command -v termux-setup-storage >/dev/null)
ifeq ($(.SHELLSTATUS),0)
TERMUX=1
$(info Compiling targeting Android (Termux))
MKCONFIG=mk/termux.mkc
else
TERMUX=0
# Assume Linux or other *nix-likes
$(info Compiling targeting *nix)
MKCONFIG=mk/linux.mkc
endif
BINDIR=bin/
ARCH=$(shell uname -m)
endif
# Set defaults for DEBUG, JPEG and STATIC builds
ifeq ($(DEBUG),)
DEBUG = 0
endif
ifeq ($(JPEG),)
JPEG = 0
endif
ifeq ($(STATIC),)
JPEG = 0
endif
ifeq ($(DEBUG),1)
$(info Building in debug mode)
else
$(info Building in release mode)
endif
ifeq ($(JPEG),1)
$(info Building JPEG support)
endif
ifeq ($(STATIC),1)
$(info Building as a static binary)
endif
.PHONY: all clean help
all:
@$(MAKE) -f $(MKCONFIG) DEBUG=$(DEBUG) JPEG=$(JPEG)
@./scripts/build_site.sh $(ARCH)
-@ if [ -d "$(BINDIR)/http" ]; then rm -rf $(BINDIR)/http; fi;
-@mv -f http/ $(BINDIR)
ifeq ($(OS), Windows_NT)
ifeq ($(CYGWIN), 1)
@./scripts/copy_dlls_cyg.sh $(ARCH) $(BINDIR)
else
@./scripts/copy_dlls_mw.sh $(ARCH) $(BINDIR)
endif
else
ifeq ($(TERMUX), 1)
@./scripts/copy_dlls_tmux.sh $(ARCH) $(BINDIR)
endif
endif
clean:
@$(MAKE) -f $(MKCONFIG) clean
help:
@echo -e "CollabVM Server 1.2.9 Makefile help:\n"
@echo "make - Build release"
@echo "make DEBUG=1 - Build a debug build (Adds extra trace information and debug symbols)"
@echo "make JPEG=1 - Build with JPEG support (Useful for slower internet connections)"
@echo "make STATIC=1 - Build a static binary for those that need such"