-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (55 loc) · 1.47 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
# Makefile for Go project
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
CURRENT_PATH=$(shell pwd)
UNAME_S := $(shell uname -s)
OS := unknown
BASIC_EXAMPLES := send_recv_pcm send_recv_yuv recv_h264 recv_pcm_loopback sample_vad
ADVANCED_EXAMPLES := multi_cons_rtx send_encoded_audio send_h264 send_mp4
ifeq ($(UNAME_S),Linux)
OS := linux
else ifeq ($(UNAME_S),Darwin)
OS := mac
# else ifeq ($(UNAME_S),CYGWIN) # Cygwin is Unix-like environment on Windows
# OS := windows
# else ifeq ($(UNAME_S),MINGW32) # MinGW is a native Windows port of GNU tools
# OS := windows
# else ifeq ($(UNAME_S),MSYS) # MSYS is a collection of GNU utilities for Windows
# OS := windows
else
$(error Unsupported OS: $(UNAME_S))
endif
# Install dependencies
.PHONY: deps
deps:
./scripts/install_agora_sdk.sh
$(GOGET) -v ./...
# Build the project
.PHONY: build
build:
mkdir -p $(CURRENT_PATH)/bin
$(GOBUILD) -C $(CURRENT_PATH)/go_sdk/agoraservice -v -o $(CURRENT_PATH)/bin/agoraservice.a
# Clean the project
.PHONY: clean
clean:
rm -rf $(CURRENT_PATH)/bin
$(GOCLEAN) -v
# Test the project
.PHONY: test
test:
$(GOTEST) -v ./...
# Install the project
.PHONY: install
install: deps
$(GOCMD) install -C $(CURRENT_PATH)/go_sdk/agoraservice -v
# Build examples
.PHONY: examples
examples:
./scripts/build_examples.sh $(BASIC_EXAMPLES)
.PHONY: advanced-examples
advanced-examples:
./scripts/build_examples.sh $(ADVANCED_EXAMPLES)