summaryrefslogtreecommitdiffstats
path: root/core/llvm_config_define_clang_flags.mk
blob: b7b57e27fce8ea7456c11b1cb71c52d74a3a6f57 (plain)
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
ifeq ($(strip $(llvm_arch)),)
  $(error "$$(llvm_arch) should be defined.")
endif

ifeq ($(strip $(CLANG_CONFIG_$(llvm_arch)_TARGET_TRIPLE)),)
  $(error "$$(CLANG_CONFIG_$(llvm_arch)_TARGET_TRIPLE) should be defined.")
endif

ifeq ($(strip $(CLANG_CONFIG_$(llvm_arch)_TARGET_TOOLCHAIN_PREFIX)),)
CLANG_CONFIG_$(llvm_arch)_TARGET_TOOLCHAIN_PREFIX := \
  $(TARGET_TOOLCHAIN_ROOT)/$(CLANG_CONFIG_$(llvm_arch)_TARGET_TRIPLE)/bin
endif

# Include common unknown flags
CLANG_CONFIG_$(llvm_arch)_UNKNOWN_CFLAGS += \
  $(CLANG_CONFIG_UNKNOWN_CFLAGS)

# Clang extra flags for host
CLANG_CONFIG_$(llvm_arch)_HOST_EXTRA_ASFLAGS := \
  $(CLANG_CONFIG_EXTRA_ASFLAGS) \
  $(CLANG_CONFIG_HOST_EXTRA_ASFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_ASFLAGS)

ifneq ($(strip $(CLANG_CONFIG_$(llvm_arch)_HOST_TRIPLE)),)
CLANG_CONFIG_$(llvm_arch)_HOST_EXTRA_ASFLAGS += \
  -target $(CLANG_CONFIG_$(llvm_arch)_HOST_TRIPLE)
endif

CLANG_CONFIG_$(llvm_arch)_HOST_EXTRA_CFLAGS := \
  $(CLANG_CONFIG_EXTRA_CFLAGS) \
  $(CLANG_CONFIG_HOST_EXTRA_CFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_CFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_HOST_EXTRA_ASFLAGS)

CLANG_CONFIG_$(llvm_arch)_HOST_EXTRA_CPPFLAGS := \
  $(CLANG_CONFIG_EXTRA_CPPFLAGS) \
  $(CLANG_CONFIG_HOST_EXTRA_CPPFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_CPPFLAGS)

CLANG_CONFIG_$(llvm_arch)_HOST_EXTRA_LDFLAGS := \
  $(CLANG_CONFIG_EXTRA_LDFLAGS) \
  $(CLANG_CONFIG_HOST_EXTRA_LDFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_LDFLAGS)

ifneq ($(strip $(CLANG_CONFIG_$(llvm_arch)_HOST_TRIPLE)),)
CLANG_CONFIG_$(llvm_arch)_HOST_EXTRA_LDFLAGS += \
  -target $(CLANG_CONFIG_$(llvm_arch)_HOST_TRIPLE)
endif

# Clang extra flags for target
CLANG_CONFIG_$(llvm_arch)_TARGET_EXTRA_ASFLAGS := \
  $(CLANG_CONFIG_EXTRA_ASFLAGS) \
  $(CLANG_CONFIG_TARGET_EXTRA_ASFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_ASFLAGS) \
  -target $(CLANG_CONFIG_$(llvm_arch)_TARGET_TRIPLE) \
  -B$(CLANG_CONFIG_$(llvm_arch)_TARGET_TOOLCHAIN_PREFIX)

CLANG_CONFIG_$(llvm_arch)_TARGET_EXTRA_CFLAGS := \
  $(CLANG_CONFIG_EXTRA_CFLAGS) \
  $(CLANG_CONFIG_TARGET_EXTRA_CFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_CFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_TARGET_EXTRA_ASFLAGS)

CLANG_CONFIG_$(llvm_arch)_TARGET_EXTRA_CPPFLAGS := \
  $(CLANG_CONFIG_EXTRA_CPPFLAGS) \
  $(CLANG_CONFIG_TARGET_EXTRA_CPPFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_CPPFLAGS)

CLANG_CONFIG_$(llvm_arch)_TARGET_EXTRA_LDFLAGS := \
  $(CLANG_CONFIG_EXTRA_LDFLAGS) \
  $(CLANG_CONFIG_TARGET_EXTRA_LDFLAGS) \
  $(CLANG_CONFIG_$(llvm_arch)_EXTRA_LDFLAGS) \
  -target $(CLANG_CONFIG_$(llvm_arch)_TARGET_TRIPLE) \
  -B$(CLANG_CONFIG_$(llvm_arch)_TARGET_TOOLCHAIN_PREFIX)

llvm_arch :=