-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathMakefile.toolchain
231 lines (160 loc) · 4.88 KB
/
Makefile.toolchain
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# Copyright (c) 2018, Michal Policht. This file is dually licensed under terms
# of either WTFPL or BEER-WARE LICENSE. You may obtain the copy of WTFPL or
# BEER-WARE LICENSE by googling, binging, yahooing or downloading it from pirate
# bay. NO WARRANTY.
# This makefile defines variables for required tools and commands used by
# various targets.
# Modify PATH variable to prevent interference with other tools/libraries!
C_DIR := $(patsubst %/,%,$(realpath C:/))
# Target machine triplet.
TARGET_MACHINE := $(shell $(CC) -dumpmachine)
# Build machine triplet.
BUILD_MACHINE := $(TARGET_MACHINE)
# Host machine triplet.
HOST_MACHINE := $(TARGET_MACHINE)
ifeq "$(OS)" "Windows_NT"
NATIVE_PATH_SEPARATOR := $(join \,)
NATIVE_EXECUTABLE_SUFFIX := .exe
# Input/Output Record Separator used by AWK.
NATIVE_IORS = '\r\n'
else
NATIVE_PATH_SEPARATOR := /
NATIVE_EXECUTABLE_SUFFIX :=
# Input/Output Record Separator used by AWK.
NATIVE_IORS = '\n'
endif
# AWK
AWK = awk
$(AWK):
# Shell and its builtins.
CD = cd
SH = sh
$(CD) $(SH):
# Coreutils
BASENAME = basename
CAT = cat
CUT = cut
CP = cp
DIRNAME = dirname
ECHO = echo
MKDIR = mkdir
MV = mv
PASTE = paste
RM = rm
TR = tr
UNIQ = uniq
SORT = sort
STAT = stat
TOUCH = touch
$(BASENAME) $(CAT) $(CUT) $(CP) $(DIRNAME) $(ECHO) $(MKDIR) $(MV) $(PASTE) \
$(RM) $(TR) $(UNIQ) $(SORT) $(STAT) $(TOUCH):
# Findutils
FIND = find
OLDFIND = oldfind
XARGS = xargs
$(FIND) $(OLDFIND) $(XARGS):
# Grep
GREP = grep
$(GREP):
# Make.
MAKE = make
$(MAKE):
# sed.
SED = sed
$(SED):
# wget.
WGET = wget
$(WGET):
# Qt programs are assumed to be in PATH.
QDOC = qdoc
QMLPLUGINDUMP = qmlplugindump
$(QDOC) $(QMLPLUGINDUMP):
# Doxygen.
ifeq "$(OS)" "Windows_NT"
DOXYGEN_DIR = $(C_DIR)/Program\ Files/doxygen
else
DOXYGEN_DIR = /usr
endif
DOXYGEN_BIN_DIR = $(DOXYGEN_DIR)/bin
DOXYGEN = $(DOXYGEN_BIN_DIR)/doxygen$(NATIVE_EXECUTABLE_SUFFIX)
# Python
ifeq "$(OS)" "Windows_NT"
PYTHON_DIR = $(C_DIR)/Python
PYTHON = $(PYTHON_DIR)/python$(NATIVE_EXECUTABLE_SUFFIX)
else
PYTHON_DIR = /usr/bin
PYTHON = $(PYTHON_DIR)/python3$(NATIVE_EXECUTABLE_SUFFIX)
endif
# Doxyqml.
ifeq "$(OS)" "Windows_NT"
DOXYQML_DIR = $(PYTHON_DIR)/Scripts
else
DOXYQML_DIR = /usr/bin
endif
DOXYQML = $(DOXYQML_DIR)/doxyqml
# CMake.
ifeq "$(OS)" "Windows_NT"
CMAKE_DIR = $(C_DIR)/Program\ Files/CMake
else
CMAKE_DIR = /usr
endif
CMAKE_BIN_DIR = $(CMAKE_DIR)/bin
CMAKE = $(CMAKE_BIN_DIR)/cmake$(NATIVE_EXECUTABLE_SUFFIX)
# Git.
ifeq "$(OS)" "Windows_NT"
GIT_DIR = $(C_DIR)/Program\ Files/Git
else
GIT_DIR = /usr
endif
GIT_BIN_DIR = $(GIT_DIR)/bin
GIT = $(GIT_BIN_DIR)/git$(NATIVE_EXECUTABLE_SUFFIX)
# Subversion.
ifeq "$(OS)" "Windows_NT"
SVN_DIR = $(C_DIR)/Program\ Files/TortoiseSVN
else
SVN_DIR = /usr
endif
SVN_BIN_DIR = $(SVN_DIR)/bin
SVN = $(SVN_BIN_DIR)/svn$(NATIVE_EXECUTABLE_SUFFIX)
# Bash.
BASH = bash
$(BASH):
# Include platform specific toolchain file.
-include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))Makefile.$(BUILD_MACHINE).toolchain
# Makefile.user may override variables defined elsewhere.
-include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))Makefile.user
$(DOXYGEN):
$(info --------------------------------------------------------------------------------)
$(info Program 'doxygen' not found!)
$(info Download it from: http://www.stack.nl/~dimitri/doxygen/download.html.)
$(info If 'doxygen' is installed in custom location, override DOXYGEN_DIR variable.)
$(info DOXYGEN_DIR = "$(DOXYGEN_DIR)")
$(error DOXYGEN = $(DOXYGEN) not found)
$(PYTHON):
$(info --------------------------------------------------------------------------------)
$(info Can not locate Python interpreter!)
$(info You can download it from: https://www.python.org/downloads/.)
$(info If Python is installed, override PYTHON_DIR variable.)
$(info PYTHON_DIR = "$(PYTHON_DIR)")
$(error PYTHON = $(PYTHON) not found)
$(DOXYQML): | $(PYTHON)
$(info --------------------------------------------------------------------------------) || \
$(info Program 'doxyqml' not found!)
$(info You can get it from: https://github.com/agateau/doxyqml.)
$(info If 'doxyqml' is installed, override DOXYQML_DIR variable.)
$(info DOXYQML_DIR = "$(DOXYQML_DIR)")
$(error DOXYQML = $(DOXYQML) not found)
$(CMAKE):
$(info --------------------------------------------------------------------------------)
$(info Program 'cmake' not found!)
$(info Download it from: https://cmake.org/download/.)
$(info If 'cmake' is installed in custom location, override CMAKE_DIR variable.)
$(info CMAKE_DIR = "$(CMAKE_DIR)")
$(error CMAKE = $(CMAKE) not found)
$(SVN):
$(info --------------------------------------------------------------------------------)
$(info Program 'subversion' not found!)
$(info Windows download: https://tortoisesvn.net/downloads.html.)
$(info If 'subversion' is installed in custom location, override SVN_DIR variable.)
$(info SVN_DIR = "$(SVN_DIR)")
$(error SVN = $(SVN) not found)