-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
73 lines (67 loc) · 2.1 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
# Go
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOINSTALL=$(GOCMD) install
BINARY_NAME=vmix_gen
DIST_DIR=build
SERVER_DIR=server
WEB_DIR=web
# Replacing "RM" command for Windows PowerShell.
RM = rm -rf
ifeq ($(OS),Windows_NT)
RM = Remove-Item -Recurse -Force
endif
# Replacing "MKDIR" command for Windows PowerShell.
MKDIR = mkdir -p
ifeq ($(OS),Windows_NT)
MKDIR = New-Item -ItemType Directory
endif
# Replacing "CP" command for Windows PowerShell.
CP = cp -R
ifeq ($(OS),Windows_NT)
CP = powershell -Command Copy-Item -Recurse -Force
endif
# Replacing "GOPATH" command for Windows PowerShell.
GOPATHDIR = $GOPATH
ifeq ($(OS),Windows_NT)
GOPATHDIR = $$env:GOPATH
endif
.DEFAULT_GOAL := build
test:
$(GOTEST) -v ./...
clean:
@$(GOCLEAN)
-@$(RM) $(DIST_DIR)/*
deps: deps-web deps-server
deps-server:
@$(MKDIR) ./server/static
deps-web:
@git submodule init
@git submodule update
@cd ./web && yarn
build-prepare-web:
build-prepare-server: deps-server
build-prepare: build-prepare-server build-prepare-web
build: build-web build-server
build-server: build-prepare
#TODO: goxをやめる
@go run github.com/mitchellh/[email protected] --osarch "windows/amd64" --output ./${DIST_DIR}/${BINARY_NAME}_{{.OS}}_{{.Arch}} ./
build-web:
@cd ./web && yarn run build
@$(MKDIR) ./$(SERVER_DIR)/static
@$(RM) ./$(SERVER_DIR)/static/*
@$(CP) ./web/dist/* ./$(SERVER_DIR)/static/
@$(RM) ./$(SERVER_DIR)/vMixMultiview/
@$(MKDIR) ./$(SERVER_DIR)/vMixMultiview/vMixLayouts
@$(MKDIR) ./$(SERVER_DIR)/vMixMultiview/vMixPreset
@$(CP) ./vMixMultiview/vMixLayouts/index.html ./$(SERVER_DIR)/vMixMultiview/vMixLayouts/
@$(CP) ./vMixMultiview/vMixPreset/index.html ./$(SERVER_DIR)/vMixMultiview/vMixPreset/
@$(CP) ./vMixMultiview/favicon.ico ./$(SERVER_DIR)/vMixMultiview/
@$(CP) ./vMixMultiview/index.html ./$(SERVER_DIR)/vMixMultiview/
@$(CP) ./vMixMultiview/jquery.js ./$(SERVER_DIR)/vMixMultiview/
@$(CP) ./vMixMultiview/mask.png ./$(SERVER_DIR)/vMixMultiview/
@$(CP) ./vMixMultiview/script.js ./$(SERVER_DIR)/vMixMultiview/
@$(CP) ./vMixMultiview/style.css ./$(SERVER_DIR)/vMixMultiview/