-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
78 lines (65 loc) · 3.2 KB
/
GNUmakefile
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
# Copyright 2024 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
########################################################################################################################
# Suppress most of make message.
.SILENT:
NNCD_DIRECTORY ?= $(shell pwd)
NNCD_VERSION ?= $(shell cat $(NNCD_DIRECTORY)/VERSION.txt)
DOCKER_BUILD_ARGS = --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy}
NNCD_DOCKER_RUN_OPTS +=--rm
NNCD_DOCKER_RUN_OPTS +=--entrypoint=
NNCD_DOCKER_RUN_OPTS += -v $$(pwd):$$(pwd)
NNCD_DOCKER_RUN_OPTS += -w $$(pwd)
NNCD_DOCKER_RUN_OPTS += -u $$(id -u):$$(id -g)
# create web console directory for electron app
ELECTRON_TAG=$(shell find ./local_editor/ -type f -exec md5sum {} \; | md5sum |cut -d \ -f 1)
DOCKER_IMAGE_NNCD_WEB_PAGE_BUILD=sony/nnc-desktop-web-page-build:${ELECTRON_TAG}
DOCKER_IMAGE_NNCD_DEB_BUILD=sony/nnc-desktop-deb-build:${ELECTRON_TAG}
DOCKER_IMAGE_NNCD_RPM_BUILD=sony/nnc-desktop-rpm-build:${ELECTRON_TAG}
docker-image-nncd-web-page:
docker build \
-f local_editor/docker/web/Dockerfile.webserver $(DOCKER_BUILD_ARGS) \
-t $(DOCKER_IMAGE_NNCD_WEB_PAGE_BUILD) $(NNCD_DIRECTORY)
docker-image-nncd-cpu-deb-build:
docker build \
-f local_editor/docker/electron/Dockerfile.deb $(DOCKER_BUILD_ARGS) --build-arg BUILD_TYPE=cpu \
-t $(DOCKER_IMAGE_NNCD_DEB_BUILD) $(NNCD_DIRECTORY)
docker-image-nncd-deb-build:
docker build \
-f local_editor/docker/electron/Dockerfile.deb $(DOCKER_BUILD_ARGS) --build-arg BUILD_TYPE=gpu \
-t $(DOCKER_IMAGE_NNCD_DEB_BUILD) $(NNCD_DIRECTORY)
docker-image-nncd-rpm-build:
docker build \
-f local_editor/docker/electron/Dockerfile.rpm $(DOCKER_BUILD_ARGS) \
-t $(DOCKER_IMAGE_NNCD_RPM_BUILD) $(NNCD_DIRECTORY)
.PHONY: build-web-page
build-web-page: docker-image-nncd-web-page
$(eval CONTAINER_ID := $(shell docker run --rm -d $(DOCKER_IMAGE_NNCD_WEB_PAGE_BUILD) bash -c "tail -f /dev/null"))
docker cp $(CONTAINER_ID):/opt/dist/console ./
docker stop $(CONTAINER_ID)
.PHONY: build-cpu-deb
build-cpu-deb: docker-image-nncd-cpu-deb-build
$(eval CONTAINER_ID := $(shell docker run --rm -d $(DOCKER_IMAGE_NNCD_DEB_BUILD) bash -c "tail -f /dev/null"))
docker cp $(CONTAINER_ID):/tmp/electron_app/dist ./
docker stop $(CONTAINER_ID)
.PHONY: build-deb
build-deb: docker-image-nncd-deb-build
$(eval CONTAINER_ID := $(shell docker run --rm -d $(DOCKER_IMAGE_NNCD_DEB_BUILD) bash -c "tail -f /dev/null"))
docker cp $(CONTAINER_ID):/tmp/electron_app/dist ./
docker stop $(CONTAINER_ID)
.PHONY: build-rpm
build-rpm: docker-image-nncd-rpm-build
$(eval CONTAINER_ID := $(shell docker run --rm -d $(DOCKER_IMAGE_NNCD_RPM_BUILD) bash -c "tail -f /dev/null"))
docker cp $(CONTAINER_ID):/tmp/electron_app/dist ./
docker stop $(CONTAINER_ID)