Skip to content

Commit 36df649

Browse files
committed
Updated build scripts
1 parent c209b58 commit 36df649

File tree

4 files changed

+111
-71
lines changed

4 files changed

+111
-71
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
=== 1.0.11 ===
66
* Removed Makefile.d. Dependencies are now automatically generated at the build stage.
7+
* Updated build scripts.
78

89
=== 1.0.10 ===
910
* Updated module versions in dependencies.

make/configure.mk

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,37 @@ ifneq ($(VERBOSE),1)
2121
.SILENT:
2222
endif
2323

24-
# Definitions
25-
PREFIX := /usr/local
26-
LIBDIR := $(PREFIX)/lib
27-
BINDIR := $(PREFIX)/bin
28-
SHAREDDIR := $(PREFIX)/share
29-
INCDIR := $(PREFIX)/include
30-
ETCDIR := /etc
3124
BASEDIR := $(CURDIR)
3225
ROOTDIR := $(CURDIR)
33-
BUILDDIR := $(BASEDIR)/.build
34-
TARGET_BUILDDIR := $(BUILDDIR)/target
35-
HOST_BUILDDIR := $(BUILDDIR)/host
36-
MODULES := $(BASEDIR)/modules
37-
CONFIG := $(BASEDIR)/.config.mk
3826
TEST := 0
3927
DEBUG := 0
4028
PROFILE := 0
4129
TRACE := 0
4230

43-
ifeq ($(DEVEL),1)
44-
X_URL_SUFFIX = _RW
45-
else
46-
X_URL_SUFFIX = _RO
47-
endif
48-
31+
# Configure system settings
4932
include $(BASEDIR)/project.mk
5033
include $(BASEDIR)/make/functions.mk
5134
include $(BASEDIR)/make/system.mk
35+
include $(BASEDIR)/make/paths.mk
5236
include $(BASEDIR)/make/tools.mk
5337
include $(BASEDIR)/modules.mk
5438
include $(BASEDIR)/dependencies.mk
5539

40+
# Definitions
41+
ifeq ($(PLATFORM),Windows)
42+
PREFIX := $(BASEDIR)/INSTALL
43+
ETCDIR := $(BASEDIR)/etc
44+
else
45+
PREFIX := /usr/local
46+
ETCDIR := /etc
47+
endif
48+
49+
ifeq ($(DEVEL),1)
50+
X_URL_SUFFIX = _RW
51+
else
52+
X_URL_SUFFIX = _RO
53+
endif
54+
5655
# Compute the full list of dependencies
5756
MERGED_DEPENDENCIES := \
5857
$(DEPENDENCIES) \
@@ -220,6 +219,7 @@ OVERALL_DEPS := $(call uniq,$(DEPENDENCIES) $(ARTIFACT_ID))
220219
__tmp := $(foreach dep,$(OVERALL_DEPS),$(call vardef, $(dep)))
221220

222221
CONFIG_VARS = \
222+
$(PATH_VARS) \
223223
$(COMMON_VARS) \
224224
$(TOOL_VARS) \
225225
$(foreach name, $(OVERALL_DEPS), \
@@ -271,7 +271,7 @@ config: $(CONFIG_VARS)
271271
echo "Features: $(FEATURES)"
272272
echo "Configured OK"
273273

274-
help: | toolvars sysvars
274+
help: | pathvars toolvars sysvars
275275
echo ""
276276
echo "List of variables for each dependency:"
277277
echo " <ARTIFACT>_BIN location to put all binaries when building artifact"

make/paths.mk

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#
2+
# Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
# (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com>
4+
#
5+
# This file is part of lsp-r3d-base-lib
6+
#
7+
# lsp-r3d-base-lib is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU Lesser General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# any later version.
11+
#
12+
# lsp-r3d-base-lib is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU Lesser General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU Lesser General Public License
18+
# along with lsp-r3d-base-lib. If not, see <https://www.gnu.org/licenses/>.
19+
#
20+
21+
LIBDIR := $(PREFIX)/lib
22+
BINDIR := $(PREFIX)/bin
23+
SHAREDDIR := $(PREFIX)/share
24+
INCDIR := $(PREFIX)/include
25+
BUILDDIR := $(BASEDIR)/.build
26+
TARGET_BUILDDIR := $(BUILDDIR)/target
27+
HOST_BUILDDIR := $(BUILDDIR)/host
28+
MODULES := $(BASEDIR)/modules
29+
CONFIG := $(BASEDIR)/.config.mk
30+
31+
# Installation prefix
32+
ifndef PREFIX
33+
ifeq ($(PLATFORM),Windows)
34+
PREFIX := $(ProgramFiles)
35+
else
36+
PREFIX := /usr/local
37+
endif
38+
endif
39+
40+
# Library prefix
41+
ifndef LIBDIR
42+
LIBDIR := $(PREFIX)/lib
43+
endif
44+
45+
# Binaries prefix
46+
ifndef BINDIR
47+
BINDIR := $(PREFIX)/bin
48+
endif
49+
50+
# Binaries prefix
51+
ifndef INCDIR
52+
INCDIR := $(PREFIX)/include
53+
endif
54+
55+
# Temporary directory
56+
ifndef TEMPDIR
57+
ifeq ($(PLATFORM),Windows)
58+
TEMPDIR := $(TEMP)
59+
else
60+
TEMPDIR := /tmp
61+
endif
62+
endif
63+
64+
# Set-up list of common variables
65+
PATH_VARS = \
66+
BINDIR \
67+
BUILDDIR \
68+
ETCDIR \
69+
INCDIR \
70+
LIBDIR \
71+
PREFIX \
72+
ROOTDIR \
73+
SHAREDDIR \
74+
TEMPDIR
75+
76+
.PHONY: pathvars
77+
78+
pathvars:
79+
echo "List of available path variables:"
80+
echo " BINDIR location of the binaries"
81+
echo " BUILDDIR location of the build directory"
82+
echo " ETCDIR location of system configuration files"
83+
echo " INCDIR location of the header files"
84+
echo " LIBDIR location of the library"
85+
echo " PREFIX installation prefix for binary files"
86+
echo " SHAREDDIR location of the shared files"
87+
echo " TEMPDIR location of temporary directory"
88+
89+

make/system.mk

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ else ifeq ($(patsubst i%86,i586,$(BUILD_ARCH)),i586)
119119
ARCHITECTURE_FAMILY = ia32
120120
ARCHITECTURE_CFLAGS := -march=i586 -m32
121121
else ifeq ($(BUILD_ARCH),x86)
122-
override ARCHITECTURE = i586
122+
override ARCHITECTURE = i686
123123
ARCHITECTURE_FAMILY = ia32
124-
ARCHITECTURE_CFLAGS := -march=i586 -m32
124+
ARCHITECTURE_CFLAGS := -march=i686 -m32
125125
else ifeq ($(BUILD_ARCH),riscv32)
126126
override ARCHITECTURE = riscv32
127127
ARCHITECTURE_FAMILY = riscv32
@@ -173,67 +173,25 @@ ifndef PKGCONFIG_EXT
173173
PKGCONFIG_EXT := .pc
174174
endif
175175

176-
# Installation prefix
177-
ifndef PREFIX
178-
ifeq ($(PLATFORM),Windows)
179-
PREFIX := $(ProgramFiles)
180-
else
181-
PREFIX := /usr/local
182-
endif
183-
endif
184-
185-
# Library prefix
186-
ifndef LIBDIR
187-
LIBDIR := $(PREFIX)/lib
188-
endif
189-
190-
# Binaries prefix
191-
ifndef BINDIR
192-
BINDIR := $(PREFIX)/bin
193-
endif
194-
195-
# Binaries prefix
196-
ifndef INCDIR
197-
INCDIR := $(PREFIX)/include
198-
endif
199-
200-
# Temporary directory
201-
ifndef TEMPDIR
202-
ifeq ($(PLATFORM),Windows)
203-
TEMPDIR := $(TEMP)
204-
else
205-
TEMPDIR := /tmp
206-
endif
207-
endif
208-
209176
TEST := 0
210177

211178
# Set-up list of common variables
212179
COMMON_VARS = \
213180
ARCHITECTURE \
214181
ARCHITECTURE_FAMILY \
215182
ARCHITECTURE_CFLAGS \
216-
BINDIR \
217-
BUILDDIR \
218183
DEBUG \
219-
ETCDIR \
220184
EXECUTABLE_EXT \
221185
EXPORT_SYMBOLS \
222186
FEATURES \
223-
INCDIR \
224187
INSTALL_HEADERS \
225-
LIBDIR \
226188
LIBRARY_EXT \
227189
LIBRARY_PREFIX \
228190
PKGCONFIG_EXT \
229191
PLATFORM \
230-
PREFIX \
231-
ROOTDIR \
232192
ROOT_ARTIFACT_ID \
233193
PROFILE \
234-
SHAREDDIR \
235194
STATICLIB_EXT \
236-
TEMPDIR \
237195
TEST \
238196
TRACE
239197

@@ -246,27 +204,19 @@ sysvars:
246204
echo " ARCHITECTURE_CFLAGS compiler flags to specify architecture"
247205
echo " ARCHITECTURE_FAMILY compiler flags to specify architecture family"
248206
echo " ARCHITECTURE_LDFLAGS linker flags to specify architecture"
249-
echo " BINDIR location of the binaries"
250-
echo " BUILDDIR location of the build directory"
251207
echo " DEBUG build with debug options"
252208
echo " DEVEL build with modules checked out for read/write URL"
253-
echo " ETCDIR location of system configuration files"
254209
echo " EXECUTABLE_EXT file extension for executable files"
255210
echo " EXPORT_SYMBOLS make export symbols visible"
256211
echo " FEATURES list of features enabled in the build"
257-
echo " INCDIR location of the header files"
258212
echo " INSTALL_HEADERS install headers (enabled by default)"
259-
echo " LIBDIR location of the library"
260213
echo " LIBRARY_EXT file extension for library files"
261214
echo " LIBRARY_PREFIX prefix used for library file"
262215
echo " PKGCONFIG_EXT file extension for pkgconfig files"
263216
echo " PLATFORM target software platform to perform build"
264-
echo " PREFIX installation prefix for binary files"
265217
echo " PROFILE build with profile options"
266-
echo " SHAREDDIR location of the shared files"
267218
echo " STATICLIB_EXT file extension for static library files"
268219
echo " SUB_FEATURES list of features disabled in the build as a subtraction of default"
269-
echo " TEMPDIR location of temporary directory"
270220
echo " TEST use test build"
271221
echo " TRACE compile with additional trace information output"
272222

0 commit comments

Comments
 (0)