-
Notifications
You must be signed in to change notification settings - Fork 74
/
magic.mk
81 lines (68 loc) · 3.07 KB
/
magic.mk
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
# This file is part of the HörTech Open Master Hearing Aid (openMHA)
# Copyright © 2013 2014 2015 2016 2017 2018 2021 HörTech gGmbH
#
# openMHA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# openMHA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License, version 3 for more details.
#
# You should have received a copy of the GNU Affero General Public License,
# version 3 along with openMHA. If not, see <http://www.gnu.org/licenses/>.
# This file sets some Makefile variables based on the settings of the
# build system specific found in config.mk
# MHA can be compiled with either GCC or Clang. The
# COMPILERPREFIX setting is for cross compilation (we did this for ARM)
CC := $(COMPILERPREFIX)gcc
CXX := $(COMPILERPREFIX)g++
PLATFORM_CC = $(ARCH)-$(PLATFORM)-gcc$(GCC_VER)
ifeq "$(TOOLSET)" "clang"
CC := $(COMPILERPREFIX)clang
CXX := $(COMPILERPREFIX)clang++
PLATFORM_CC = $(ARCH)-$(PLATFORM)-clang$(CLANG_VER)
ifeq "$(PLATFORM)" "Darwin"
RPATH_FLAGS += -rpath @executable_path/../lib
endif
endif
# iOS does not support dynamic plugins
ifeq "$(MHA_STATIC_PLUGINS)" "yes"
CFLAGS += -DMHA_STATIC_PLUGINS=1
CXXFLAGS += -DMHA_STATIC_PLUGINS=1
endif
# Default linker option for Jack if not set otherwise in config.mk
ifeq "x$(JACK_LINKER_COMMAND)" "x"
JACK_LINKER_COMMAND = -ljack
endif
# Standard source code subdirectory. May be overwritten by most
# nested Makefile. Used in rules.mk.
SOURCE_DIR = src
# The git commit SHA is compiled into the binaries for reproducible research.
# Detect current git commit hash:
GITCOMMITHASH = $(shell $(GIT_DIR)/mha/tools/get_git_commit_hash.sh)
GITCOMMITHASHCFLAGS = -DGITCOMMITHASH="\"$(GITCOMMITHASH)\""
# The name of the toolbox library.
MHATOOLBOX_NAME = openmha
# Setup relative paths. This breaks if the path contains spaces.
GIT_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
EXTERNAL_LIBS := $(GIT_DIR)/external_libs
# Use -isystem instead of -I to silence warnings in external libs
EXTERNAL_LIBS_INCLUDE = -isystem $(EXTERNAL_LIBS)/$(PLATFORM_CC)/include
EXTERNAL_LIBS_LDFLAGS = -L$(EXTERNAL_LIBS)/$(PLATFORM_CC)/lib
CFLAGS += $(EXTERNAL_LIBS_INCLUDE)
CXXFLAGS += $(EXTERNAL_LIBS_INCLUDE)
LDFLAGS += $(EXTERNAL_LIBS_LDFLAGS)
# How to extend the search path for dynamic libraries on windows and linux
EXTEND_DLLPATH_linux = LD_LIBRARY_PATH="$(1):$$LD_LIBRARY_PATH"
EXTEND_DLLPATH_MinGW = PATH="$(1):$$PATH"
# usage: Prepend shell command with
# $(call EXTEND_DLLPATH_$(PLATFORM),/some/directory) shell command ...
# modifications of DYLD_LIBRARY_PATH have no effect on recent mac os versions
# we use installname for in-sourcetree tests and rpath for installed executables
# Some private magic may override some settings in here. Do not use.
-include $(dir $(lastword $(MAKEFILE_LIST)))/private_magic.mk
# Local Variables:
# coding: utf-8-unix
# End: