forked from cyberbotics/webots
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (74 loc) · 2.38 KB
/
Makefile
File metadata and controls
90 lines (74 loc) · 2.38 KB
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
# Copyright 1996-2026 Cyberbotics Ltd.
#
# 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
#
# https://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.
# clear out all suffixes for implicit rules to speed up Makefile
.SUFFIXES:
%:: %,v
%:: RCS/%,v
%:: RCS/%
%:: s.%
%:: SCCS/s.%
ifndef WEBOTS_HOME
export WEBOTS_HOME=../..
else
WEBOTS_HOME := $(WEBOTS_HOME)
endif
null :=
space := $(null) $(null)
WEBOTS_HOME_PATH?=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME))))
include $(WEBOTS_HOME_PATH)/resources/Makefile.os.include
.DEFAULT_GOAL := help
WEBOTS_SRC_PATH = $(WEBOTS_HOME_PATH)/src/webots
ifeq ($(OSTYPE),windows)
ifdef CI
LUPDATE = lupdate-qt6
LRELEASE = lrelease-qt6
else
LUPDATE = lupdate
LRELEASE = lrelease
endif
else
QT_BINARIES_PATH = $(WEBOTS_HOME_PATH)/bin/qt
ifeq ($(OSTYPE),linux)
LUPDATE = LD_LIBRARY_PATH=$(WEBOTS_LIB_PATH) $(QT_BINARIES_PATH)/lupdate
LRELEASE = LD_LIBRARY_PATH=$(WEBOTS_LIB_PATH) $(QT_BINARIES_PATH)/lrelease
endif
ifeq ($(OSTYPE),darwin)
LUPDATE = DYLD_FRAMEWORK_PATH=$(WEBOTS_HOME)/Contents/Frameworks $(QT_BINARIES_PATH)/lupdate
LRELEASE = DYLD_FRAMEWORK_PATH=$(WEBOTS_HOME)/Contents/Frameworks $(QT_BINARIES_PATH)/lrelease
endif
endif
LUPDATE_FLAGS = -silent -locations none -noobsolete -extensions cpp,hpp
LRELEASE_FLAGS = -silent
GENERIC = wb_generic.ts
TS_SOURCES = $(wildcard *.ts)
QM_FILES = $(subst $(GENERIC:.ts=.qm),,$(TS_SOURCES:.ts=.qm))
ifneq ($(MAKECMDGOALS),update)
WEBOTS_SOURCES =
else
WEBOTS_SOURCES = $(wildcard $(WEBOTS_SRC_PATH)/*/*.[ch]pp)
endif
help:
@echo Usage: make \<TARGET\>
@echo \'make release\': rebuild the QM files from TS files.
@echo \'make update\': \ rebuild the TS files from the Webots sources files.
@echo \'make clean\': \ \ remove all QM files.
release debug profile update: $(QM_FILES) $(GENERIC)
%.qm: %.ts
@echo "# compiling $< -> $@"
@$(LRELEASE) $(LRELEASE_FLAGS) $<
wb_*.ts: $(WEBOTS_SOURCES)
@echo "# updating $@"
@$(LUPDATE) $(LUPDATE_FLAGS) $(WEBOTS_SRC_PATH) -ts $@
clean:
rm -f *.qm