-
Notifications
You must be signed in to change notification settings - Fork 55
/
Makefile
161 lines (134 loc) · 3.65 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#
# Master Makefile
#
#
# Logic is split up into various modules. See MK_COMPONENTS below for the
# complete list. Each of them provides a target identical to its name. The
# default target will build the tools for your host system.
#
# Configuration can be found in mk/target.mk. This file also contains a
# list of the variables you can pass into make to influence building.
#
# For cross compiling, AVS_OS and AVS_ARCH are your most important variables.
# AVS_OS selects the platform to build for and is one of android, ios, linux,
# and osx. AVS_ARCH select the architecture within the platform and is one of
# armv7, armv7s, arm64, i386, and x86_64. Not all architectures are
# available for all platforms.
#
# Both have "sane" defaults. AVS_OS defaults to your host platform. If you
# only state AVS_OS, AVS_ARCH will pick the most likely architecture for
# that platform.
#
# Call "make info" for a listing of some of the variables.
#
# Master version number
#
ifeq ($(BUILD_NUMBER),)
VER_PATCH := local
else
VER_PATCH := $(BUILD_NUMBER)
endif
VER_BRANCH := $(shell git rev-parse --abbrev-ref HEAD || echo "")
ifeq ($(AVS_VERSION),)
ifeq ($(word 1, $(subst -, , $(VER_BRANCH))), release)
AVS_PROJECT := avs
AVS_RELEASE := 1
VER_MAJOR_MINOR := $(word 2, $(subst -, , $(VER_BRANCH)))
AVS_VERSION := $(VER_MAJOR_MINOR).$(VER_PATCH)
else
AVS_PROJECT := avsmaster
AVS_RELEASE := 0
AVS_VERSION := 0.0.$(VER_PATCH)
endif
else
ifeq ($(shell echo $(AVS_VERSION) | head -c 3),0.0)
AVS_PROJECT := avsmaster
AVS_RELEASE := 0
else
AVS_PROJECT := avs
AVS_RELEASE := 1
endif
endif
MK_COMPONENTS := toolchain contrib avs tools test android linux iosx dist scan
#--- Configuration ---
-include config.mk
ifeq ($(HAVE_WEBRTC),)
ifeq ($(AVS_OS),wasm)
HAVE_WEBRTC := 0
else
ifeq ($(USE_REFLOW),1)
HAVE_WEBRTC := 0
else
HAVE_WEBRTC := 1
endif
endif
endif
include mk/target.mk
include mk/re.mk
OUTER_MKS := Makefile mk/target.mk
#
# NOTE: must be defined here, after target.mk is included
#
ifeq ($(AVS_OS),osx)
HAVE_PROTOBUF := 1
HAVE_CRYPTOBOX := 1
BUILD_OPTIONAL_MODULES := 1
endif
ifeq ($(AVS_OS),linux)
HAVE_PROTOBUF := 1
HAVE_CRYPTOBOX := 1
BUILD_OPTIONAL_MODULES := 1
endif
ifeq ($(AVS_OS),android)
BUILD_OPTIONAL_MODULES := 1
endif
ifneq ($(AVS_OS),wasm)
BUILD_NETWORK_MODULES := 1
endif
#--- All My Targets ---
all: tools test
ifeq ($(AVS_OS),android)
wrapper: android
else ifeq ($(AVS_OS),ios)
wrapper: iosx
else ifeq ($(AVS_OS),osx)
wrapper: iosx
else
wrapper:
echo "There ain't no wrapper for $(AVS_OS)."
endif
clean: $(patsubst %,%_clean,$(MK_COMPONENTS))
distclean: clean
@rm -rf $(BUILD_BASE)
include $(patsubst %,mk/%.mk,$(MK_COMPONENTS))
info:
@echo " AVS_OS: $(AVS_OS)"
@echo " AVS_ARCH: $(AVS_ARCH)"
@echo " AVS_FAMILY: $(AVS_FAMILY)"
@echo " HOST_OS: $(HOST_OS)"
@echo " HOST_ARCH: $(HOST_ARCH)"
@echo " CCACHE: $(CCACHE)"
@echo " CC: $(CC)"
@echo " CXX: $(CXX)"
@echo " LD: $(LD)"
@echo " AR: $(AR)"
@echo " AS: $(AS)"
@echo " RANLIB: $(RANLIB)"
@echo " CPPFLAGS: $(CPPFLAGS)"
@echo " CFLAGS: $(CFLAGS)"
@echo " CXXFLAGS: $(CXXFLAGS)"
@echo " LFLAGS: $(LFLAGS)"
@echo " LIBS: $(LIBS)"
@echo " AVS_LIBS: $(AVS_LIBS)"
@echo " AVS_DEPS: $(AVS_DEPS)"
@echo " BUILD_BIN: $(BUILD_BIN)"
@echo " BUILD_TARGET: $(BUILD_TARGET)"
@echo " SDK: $(SDK)"
@echo " HAVE_PROTOBUF: $(HAVE_PROTOBUF)"
@echo "HAVE_CRYPTOBOX: $(HAVE_CRYPTOBOX)"
@echo " HAVE_WEBRTC: $(HAVE_WEBRTC)"
version:
@echo "$(AVS_VERSION)"
avs_release:
git archive --format=tar --prefix=$(AVS_PROJECT)-$(AVS_VERSION)/ \
HEAD | gzip > $(AVS_PROJECT)-$(AVS_VERSION).tar.gz